I start building chat server using Socket.io with multiple nodes. It uses Socket.io-redis to connect all servers together and rooms for messaging.
When a client connects with server I join client to some room.
io.on('connection', function(socket){
socket.join("CLIENT_1");
});
So I want to get number of clients connected to room "CLIENT_1"
,
io.sockets.adapter.rooms["CLIENT_1"];
but I only get connection from current process. How can I get connection from all server processes connected through the redis adapter?
I have gone through this question:
How to check socket is alive (connected) in socket.io with multiple nodes and socket.io-redis
but it didn't help me.
Thanks for advance.