-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Target specific socket connections? #30
Comments
If you need to emit events to socket.io instances from a non-socket.io process, you should use socket.io-emitter. |
Thanks I'll have a look at that, maybe there is a workaround there. |
Use rooms, and send the message to the room with the client you desire. Regards,
|
I'll try. |
I just want to confirm that talking to a client of another socket.io server can be done by using their socket.io id as room name. It also works when you put this target client in a custom room with a fixed name and talk to that room from another socket.io server instance. But sadly, emitting into a room is considered broadcasting, probably because there can be multiple clients in a room, so you can't use callbacks. You'll get the following error when trying:
|
So I see two possible solutions:
|
I created a redis pub/sub wrapper with a callback system. This allows me to, from one instance, execute a emit on another instance and retrieve the response using a callback. |
Is there any way to target specific socket connections, from an instance that doesn't have the connection to that socket connection?
I'm afraid this requires similar functionality as rooms, which also isn't implemented yet.
The text was updated successfully, but these errors were encountered: