BROADCAST_CONNECTION=null
the application broadcasts nothing, and each live screen reloads its data every
few seconds. Turn websockets on when you want changes to show as they happen, or
when many people keep those screens open and the polling adds up.
Nothing about the installation changes when it is off: Reverb ships with Core but
does not run, and the browser never downloads the websocket client.
How it works
/broadcasting/auth, on the
tenant’s own host, with the same session and account checks as the console. The
websocket server only relays.
The browser learns whether to connect, and where, from the page itself at
runtime — nothing is compiled into the front end, so the prebuilt images work on
any domain.
Docker Compose
Reverb runs as thereverb service behind the realtime profile. It uses the
application image, and nginx (the web service) forwards browsers to it at
/app/ on the site’s own origin, so TLS in front covers the websocket too and no
extra port or certificate is needed.
-
Generate three values — any random strings will do:
-
Add them to the
.envbesidecompose.yaml, and switch the broadcaster:REVERB_HOST,REVERB_PORTandREVERB_SCHEMEare set bycompose.yamlto thereverbservice; leave them out of the.env. -
Start the stack with the profile — together with any other profiles you use:
Configuration is cached when the containers start, so
app,horizonandschedulermust be recreated to pick up the new values;up -ddoes that when the.envchanged.
BROADCAST_CONNECTION=null, recreate the containers,
and stop reverb.
Bare metal
Run the server under your process supervisor next to Horizon:BROADCAST_CONNECTION and REVERB_APP_* values as above, plus
where the application publishes to it:
server block:
php artisan reverb:restart).
Configuration
Reverb’s own settings — connection limits, ping interval, scaling across several
servers through Redis — are read from the
REVERB_* variables described in the
Reverb documentation. One Reverb process is
plenty for a single installation.
Pusher, Soketi and other servers
The browser speaks the Pusher protocol, so any server that does works in place of Reverb:- Pusher:
BROADCAST_CONNECTION=pusherwithPUSHER_APP_ID,PUSHER_APP_KEY,PUSHER_APP_SECRETandPUSHER_APP_CLUSTER. No other setting is needed. - Soketi or another self-run Pusher-protocol server: the same
pusherconnection, withPUSHER_HOST,PUSHER_PORTandPUSHER_SCHEMEfor the application, andBROADCAST_CLIENT_HOST(and port and scheme) for browsers.
redis, ably) deliver on the server side, but the
console has no client for them and keeps polling.
Troubleshooting
The live hint still says it refreshes. The page decides when it loads: check thatphp artisan config:show broadcasting.default prints reverb inside the
app container, and that the containers were recreated after the .env change.
REVERB_APP_KEY must be set — without it the browser has nothing to connect
with and polls.
The browser console shows a failed websocket connection. reverb is not
running (nginx answers 502 at /app/), or a proxy in front does not pass
websocket upgrades. Caddy does by default; other proxies need it enabled for
/app/.
Subscribing fails with 403. The private channel was refused at
/broadcasting/auth: the user is signed out, or no longer has access to the
assistant. The screen falls back to its periodic reload.
Related
- Services — the processes an installation runs
- Docker Compose — profiles and the stack
- Configuration — the
.envfile