Update server.js

fix bug
This commit is contained in:
Jairo Caro-Accino Viciana 2018-08-13 10:05:25 +02:00 committed by GitHub
parent 5012793f23
commit 177d4f0f6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@ app._initializeWSS = function(server) {
this._wss = new WebSocketServer({ path: path, server: server}); this._wss = new WebSocketServer({ path: path, server: server});
this._wss.on('connection', function(socket, req) { this._wss.on('connection', function(socket, req) {
if(!req.url) return;
var query = url.parse(req.url, true).query; var query = url.parse(req.url, true).query;
var id = query.id; var id = query.id;
var token = query.token; var token = query.token;