Closed marchaos closed 6 years ago
Hey there @marchaos !
Try listening for the close
event:
ws.on('connection', (socket) => {
console.info('Someone connected!')
socket.on('message', (data) => {
// Handle messages
})
socket.on('close', () => {
console.info('Someone disconnected.')
})
})
Hey @gj. Nice one, that works.
Hey,
I've tried to listen for when a websocket disconnects using:
disconnect never gets called. Is there a way to know when someone disconnects?