I saw this code snippet which talks about how to group socket connections from the same user but in different windows:
sio.on('connection', function (socket) {
socket.join(socket.handshake.sessionID);
});
app.get('/user/:id/:message', function (req, res) {
sio.sockets.in(req.params.id).send(req.params.message);
});
I got this from this blog post.
How do I catch this sent message on the JS client side?
Figured this out. This is how we can catch the message on the client side: