Expand description
The half of broadcasting that needs HTTP: the authorisation endpoint, the socket header, and the notification channel.
rainier-broadcast depends on support and nothing else, so it can be used
from a worker with no router. What lives here is what genuinely needs a
request: /broadcasting/auth, which is how a browser proves to your
WebSocket server that it may subscribe to a private channel.
browser ──subscribe private-orders.7──▶ soketi
│ │
└──POST /broadcasting/auth─────────────┘ "prove it"
▲
└── this module: is this user allowed, and here is the signatureStructs§
- Broadcast
Channel - Sends notifications to a private channel for the recipient.
Constants§
- SOCKET_
ID_ HEADER - The header a Pusher client sends its socket id in.
Functions§
- authorize
POST /broadcasting/auth— decide whether this user may subscribe.- authorize_
notifications - Register the notification channel’s authoriser.
- bind_
defaults - Bind broadcasting into
appwith the log driver and an empty channel table. - socket_
id - The socket id this request came from, if the client sent one.