https post
This commit is contained in:
parent
e200410e51
commit
f3765ccbaa
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user