I\'d like to know if it\'s possible to broadcast on different websocket \"connections\" running from the same node-websocket-server app instance. Imagine a chatroom server w
I'm not sure if rooms were a feature when the other answers were created, but in the documentation, they have a feature exactly what you are looking for. So go to that link and search for rooms.
Here is an example from the site:
var io = require('socket.io').listen(80);
io.sockets.on('connection', function (socket) {
socket.join('justin bieber fans');
socket.broadcast.to('justin bieber fans').emit('new fan');
io.sockets.in('rammstein fans').emit('new non-fan');
});
Based on the other answers, it was more focused on scaling, I would love some insight if the built in version scales well as the proposed answers.