Phoenix/cowboy: fast access to connected WebSocket clients

I am building some sort of a web app that is like customers support service to learn Elixir (I’m new)
I found this template: GitHub - holsee/wizz: Demo application showing cowboy WebSockets in elixir with Plug and I faced a problem, i want to do something like:

current_connected_users = [{ "user_token_0": ws_conn }, ...]

so I could send/broadcast new messages to the user once they came in.
and thx.

If you have all them join to channel say room:id, then you can broadcast to room:* … Have a look too at Presence.

thx that was useful.

1 Like