Skip to content
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

Room management #45

Open
hAz4rd0uS opened this issue Oct 18, 2018 · 1 comment
Open

Room management #45

hAz4rd0uS opened this issue Oct 18, 2018 · 1 comment

Comments

@hAz4rd0uS
Copy link

hAz4rd0uS commented Oct 18, 2018

Hi,

I can't find any code in sources nor attribute in ctx.websocket object when logging it in the console related to room management, how to broadcast messages to listed sockets only ?

There's nothing in your example.

Thanks in advance.

@combustpizza
Copy link

Hi,

I know this is very late, however rooms and channels are not part of the websockets. Instead, they are part of the WS libraries (like socket.io).

If you want rooms, you basically have to add an array to the socket object and add/remove rooms from it (you can implement that in any way you want).

For sending to specific rooms, create a separate function, which will filter out sockets that belong to the specified room and send the message only to those sockets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants