https post

This commit is contained in:
barwie2@st.amu.edu.pl 2020-03-08 22:26:42 +01:00
parent e200410e51
commit f3765ccbaa

View File

@ -1,10 +1,14 @@
const WebSocket = require('ws');
var https = require('https');
const fs = require('fs');
var websocket_port = 8888;
const wss = new WebSocket.Server({port: websocket_port});
console.log("Websocket server running on port " + websocket_port);
var lookup = [];
wss.on('connection', function connection(ws) {
console.log(ws);
lookup[ws.protocol] = ws;
});
@ -40,8 +44,7 @@ var server = https.createServer({
response.end("Undefined request .");
}
});
var websocket_port = 8888;
const wss = new WebSocket.Server({port: websocket_port});
server.listen(websocket_port);
console.log("HTTP server running on port " + websocket_port);
var https_port = 8889;
server.listen(https_port);
console.log("HTTP server running on port " + https_port);