-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
How to use this function #3663
Comments
You have the docs for this. You also disregarded the notice you had in the issue template; Note: for support questions, please use one of these channels: stackoverflow or slack Please just RTFM and close this issue. |
OK! thank you! |
@jonalan7 you can only broadcast on the server-side, there's no such concept on the client-side. I will update the documentation to make it clearer. |
Yeah looking back at it, the reply I posted above wasn't really kind, I'm sorry, @jonalan7 To make up for it, if you haven't "RTFM" yet 😛 ... You can not emit a payload to a specific socket from client side, because your client only knows about one socket connection, the one that it has established with the server. If you want to sent some data from one client to all clients, you have to emit a specific event with the payload from the client to server, and then the server handles that event with a handler which then emits that data payload to all other sockets. |
How to use the io.in function
io.to(socketId).emit('message');
through the front-end.
The text was updated successfully, but these errors were encountered: