|
|
|
@ -45,12 +45,14 @@ server.on('upgrade', (req, socket, head) => {
|
|
|
|
|
if (pathname[1] === 'ws' && get(token)) {
|
|
|
|
|
wss1.handleUpgrade(req, socket, head, (socket) => {
|
|
|
|
|
req.id = token
|
|
|
|
|
wss1.emit('connection', socket, req);
|
|
|
|
|
wss1.emit('connection', socket, req)
|
|
|
|
|
})
|
|
|
|
|
} else if (pathname[1] === 'stream') {
|
|
|
|
|
wss2.handleUpgrade(req, socket, head, (socket) => {
|
|
|
|
|
req.id = token
|
|
|
|
|
wss2.emit('connection', socket, req);
|
|
|
|
|
if (req.id != null || req.id != '') {
|
|
|
|
|
req.id = token
|
|
|
|
|
wss2.emit('connection', socket, req)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|