ihatecsv ihatecsv - 2 years ago 78
Javascript Question

How do I add a socket.io socket to a room via their socketid?

I'm running a function with this line I pilfered from the internet somewhere:


It isn't working properly. Is there any way I can accomplish adding a socket to a room without having reference to the socket object? Or is there any way to get a reference to the socket object from an ID?


Answer Source

In socket.io 1+, you would use the socket id on the server like this:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download