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
This method works perfectly:
io.sockets.adapter.clients(["room1"], function(err, clients){ console.log("total clients in room1: %d", clients.length); })