diff --git a/src/index.js b/src/index.js index c64ad89..d503026 100644 --- a/src/index.js +++ b/src/index.js @@ -48,11 +48,11 @@ server.on('upgrade', (req, socket, head) => { wss1.emit('connection', socket, req) }) } else if (pathname[1] === 'stream') { - wss2.handleUpgrade(req, socket, head, (socket) => { - if (req.id != null || req.id != '') { - req.id = token - wss2.emit('connection', socket, req) - } - }) + if (token != null || token != '' || token != "") { + wss2.handleUpgrade(req, socket, head, (socket) => { + req.id = token + wss2.emit('connection', socket, req) + }) + } } }) \ No newline at end of file