Realtime messaging (Reverb / WebSockets)
Operator guide
Realtime messaging (Reverb / WebSockets)
VulaSocial ships with Laravel Reverb for realtime features — live message delivery, typing indicators and reactions. On shared hosting without WebSocket support you can run in log mode (realtime off; everything still works via normal HTTP refresh).
The two modes
BROADCAST_CONNECTION |
Behaviour |
|---|---|
reverb |
Live WebSockets (needs Reverb running + a proxy) |
log |
No realtime; safe fallback for any host. Set this if you don't run Reverb. |
Log mode (simplest, shared-hosting friendly)
BROADCAST_CONNECTION=log
No worker, no proxy, no ports. Users see new messages on refresh/reload. This is the recommended default for shared hosting.
Reverb mode
1. Generate credentials
Reverb needs an app id, key and secret. Generate once:
php artisan reverb:generate
2. Configure .env
BROADCAST_CONNECTION=reverb
REVERB_APP_ID=your-node
REVERB_APP_KEY=<generated-key>
REVERB_APP_SECRET=<generated-secret>
REVERB_HOST=your-node.example # public hostname browsers connect to
REVERB_PORT=443
REVERB_SCHEME=https
REVERB_SERVER_HOST=0.0.0.0 # internal bind
REVERB_SERVER_PORT=8080 # internal port the proxy targets
REVERB_ALLOWED_ORIGINS=https://your-node.example
The browser reads REVERB_HOST/PORT/SCHEME at runtime — no asset rebuild when
you change them.
3. Run Reverb
Shared hosting / a long-running process:
php artisan reverb:start --host=0.0.0.0 --port=8080
Docker: docker compose up -d reverb (a reverb service is defined in the
compose file).
4. Reverse-proxy WebSocket upgrades
Terminate TLS on your proxy and forward upgrade requests to :8080. nginx
example:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443 ssl http2;
server_name your-node.example;
location /app {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_read_timeout 60s;
}
}
Verify realtime
- Open two browser tabs, log in as two members, and send a message between them.
- The second tab should show it appear without refresh.
- If it doesn't, check Reverb is running and
REVERB_ALLOWED_ORIGINSincludes your origin.
Troubleshooting
| Symptom | Likely fix |
|---|---|
| No live updates | BROADCAST_CONNECTION still log, or Reverb not running / not proxied |
| Connection refused on 8080 | Reverb not started |
| 401 / bad signature | REVERB_APP_KEY/SECRET mismatch with VITE_REVERB_* (they must match) |
| Cross-origin blocked | REVERB_ALLOWED_ORIGINS missing your domain |
Important: when realtime is on, message bodies are broadcast to conversation members. On a node with plaintext (non-E2EE) messaging the server relays the body. See
docs/E2EE-PRIVATE-MESSAGING.mdfor the pinned end-to-end encryption design if you need server-blind messaging.
Related
Still stuck? Contact the node administrator.