post htrps fix

This commit is contained in:
barwie2@st.amu.edu.pl 2020-03-08 22:19:43 +01:00
parent 3e57141b8f
commit e200410e51

View File

@ -2,10 +2,6 @@ const WebSocket = require('ws');
var https = require('https'); var https = require('https');
const fs = require('fs'); 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 = []; var lookup = [];
wss.on('connection', function connection(ws) { wss.on('connection', function connection(ws) {
@ -44,7 +40,8 @@ var server = https.createServer({
response.end("Undefined request ."); response.end("Undefined request .");
} }
}); });
var websocket_port = 8888;
const wss = new WebSocket.Server({port: websocket_port});
var http_port = 8889; server.listen(websocket_port);
server.listen(http_port); console.log("HTTP server running on port " + websocket_port);
console.log("HTTP server running on port " + http_port);