Choosing the transport (how messages arrive)

Share
Options > Real Time Chat > Real-time transport: · Last updated:

Comparison of the transports

TransportHow it worksChoose it if
SSE (default)one open connection per membersmall or medium forum, no requirement. Each stream takes a PHP process: limited to 3 streams per member and 300 s per stream (the browser reconnects by itself).
Pollinga short request every few seconds (5 s by default)hosting that copes badly with long connections. A little less instant, very light.
WebSocketdedicated gatewaymany members connected at the same time. Needs a gateway (see below).
AutoWebSocket as long as the gateway answers, otherwise the chosen fallback (SSE or Polling)you want WebSocket without the risk of a total outage
Guests: Transport for guests (default Polling (recommended)). The other choice (Same as the members) gives them what the members have, at the cost of a PHP process per open stream.

Hosting the WebSocket gateway (Gateway hosting)

ModeHow it works
Integrated (default)the gateway runs on the server of the forum. Engine of your choice: Node.js (18 or later) or Workerman (pure PHP, no Node). Start, stop, installation of the dependencies and diagnostics from WebSocket Server > Integrated Server.
Externalthe gateway runs on another machine: you fill in its addresses (WebSocket URL wss://…/ws as seen by the browsers, Publisher URL https://…/internal/publish called by XenForo). The External Server page generates the Node configuration (Generate Node configuration).
Managed Servicethird-party service Ably or Pusher Channels, set on WebSocket Server > Managed Service. The credentials (key, secret) are entered there and are not shown again afterwards.
Notes:
  • In Integrated mode with the Auto transport, WebSocket is only used if WebSocket URL is filled in (the public address cannot be guessed); otherwise the fallback takes over.
  • Do not expose the internal publication address (/internal/publish) on the Internet: only /ws and, if needed, /health should be.
  • On the command line: php cmd.php xs-rtc:websocket start|stop|restart|status|diagnostics.
  • Secrets (WebSocket token, internal publication, Ably key, Pusher secret): never in a field of the options form. They are shown masked with the Show / Set / Regenerate buttons. After changing a secret, regenerate the configuration of the external gateway and restart it, otherwise the events are refused.
For the installation of an external gateway in detail: docs/REALTIMECHAT_EXTERNAL_GATEWAY.md.
Back
Top Bottom