Service

Server-side signal helpers: trigger the signal server for a real-time channel, and issue the client tokens a browser needs to open a WebSocket connection to it.

This page is a pure reference. For how the framework fits together, see the Guide.

Classes
  • Service - static signal helpers for triggering the signal server and issuing client tokens.

Service

Static functions for real-time signalling: trigger the signal server for a channel, read a channel token for the current session, and issue a client token for a browser WebSocket connection.

GetSignalToken

Service::GetSignalToken(): void

Get a client token for a WebSocket connection from the signal server, and output it. Returns JSON with the client token and the signal server url.

Returns void

RealtimeChannelTokenForCurrentSession

Service::RealtimeChannelTokenForCurrentSession(): string

The real-time channel token for the current session.

Returns string The channel token for the current session.

RealtimeTrigger

Service::RealtimeTrigger(string $channelIdHex32): void

Trigger the signal server for a channel, with an HTTP PUT carrying the channel id and the admin token.

NameTypeDescription
$channelIdHex32stringThe channel id, as 32 lowercase hexadecimal characters.

Returns void