B
B
Burgul2014-06-15 19:10:33
JavaScript
Burgul, 2014-06-15 19:10:33

How to get a list of users in a room in Socket.io 1.0.4

How to get a list of connected clients to a specific room in the latest version of Socket.io 1.0.4?
Previously, the list could be obtained with:
var cl = io.sockets.clients(name_of_the_room);
Now this code does not work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
affair, 2014-07-08
@Burgul

var group_clients = sio.eio.clients[group];
are now stored a little differently.
It's just an object, not a function.
<group name>: {
socket.id: true,
socket.id: true
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question