Fix for update to ws@5.2.0 module.
This commit is contained in:
parent
9c789f96b5
commit
19d6380927
@ -20,12 +20,12 @@ app._initializeWSS = function(server) {
|
||||
// Create WebSocket server as well.
|
||||
this._wss = new WebSocketServer({ path: path, server: server});
|
||||
|
||||
this._wss.on('connection', function(socket) {
|
||||
var query = url.parse(socket.upgradeReq.url, true).query;
|
||||
this._wss.on('connection', function(socket, req) {
|
||||
var query = url.parse(req.url, true).query;
|
||||
var id = query.id;
|
||||
var token = query.token;
|
||||
var key = query.key;
|
||||
var ip = socket.upgradeReq.socket.remoteAddress;
|
||||
var ip = req.socket.remoteAddress;
|
||||
|
||||
if (!id || !token || !key) {
|
||||
socket.send(JSON.stringify({ type: 'ERROR', payload: { msg: 'No id, token, or key supplied to websocket server' } }));
|
||||
|
Loading…
x
Reference in New Issue
Block a user