RealtimeHub channels demo

Open this page in two browsers (or one normal window and one private window), connect as different users and try public, private and presence channels.

How to try it (2 browsers, or one normal and one private window)

  1. Public. Browser 1: name alice, Token Scoped, tick room-a, Connect. Browser 2: name bob, tick room-a and room-b, Connect. Both click Join on public.lobby and chat. Anyone can join this one.
  2. Private. In browser 1 (alice) click Join on private.room-b. It is refused, because alice's token does not list it. In browser 2 (bob) it works. Your backend decides this when it creates the token.
  3. Open mode. Fields are locked while connected: click Disconnect, set Token to Open, Connect again. Now alice can join private.room-b or any name you type in the custom box, such as trips.21. No channel list means any channel.
  4. Presence. Both browsers join presence.office. The member list shows who is in the room, and the event log shows each join and leave live. Click Leave in one browser and watch the other.
Private access: disconnected
Not connected.

Channels

Pick a channel, join it, then send. Messages reach everyone who joined that channel.
What am I looking at?

Public public.lobby: everyone's token lists it, so anyone can join.
Private private.room-a / room-b: only tokens whose backend listed them can join. Connect as bob without room-b, then try to join it and read the refusal in the event log. Switch Token to Open and the same join succeeds: that is what "no channel list" means.
Presence presence.office: every channel tracks who is in it. Join it in two browsers and watch the member list and the join/leave events. Two tabs of one name count as one member.

Event log

What the hub tells your browser.