How to know which web socket was disconnected in express-ws (npm) ?
I am using express-ws npm for websocket. How i know which user is disconnected ?
var allclients = [];
router.ws('/', function(ws, req) { allclients.push({id: req.headers.userid,data: ws});
ws.on('close',function(msg) { console.log(msg); })
})
When any client disconnect then all websockets ws.readyState give us status 3 instead of 1.