Reverb WebSockets
Connection Flow
Section titled “Connection Flow”Configuration
Section titled “Configuration”Server-side:
BROADCAST_CONNECTION=reverbREVERB_APP_ID=generatedREVERB_APP_KEY=generatedREVERB_APP_SECRET=generatedREVERB_HOST=0.0.0.0REVERB_PORT=8080REVERB_SCHEME=httpClient-side:
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"VITE_REVERB_HOST="${APP_DOMAIN}"VITE_REVERB_PORT=443VITE_REVERB_SCHEME=httpsBroadcasting Events
Section titled “Broadcasting Events”class OrderShipped implements ShouldBroadcast{ public function __construct( public Order $order ) {}
public function broadcastOn(): array { return [ new PrivateChannel('orders.'.$this->order->user_id), ]; }}
// Dispatchevent(new OrderShipped($order));Client Integration
Section titled “Client Integration”import Echo from 'laravel-echo';import Pusher from 'pusher-js';
window.Pusher = Pusher;window.Echo = new Echo({ broadcaster: 'reverb', key: import.meta.env.VITE_REVERB_APP_KEY, wsHost: import.meta.env.VITE_REVERB_HOST, wsPort: import.meta.env.VITE_REVERB_PORT, wssPort: import.meta.env.VITE_REVERB_PORT, forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https', enabledTransports: ['ws', 'wss'],});Channel Types
Section titled “Channel Types”| Type | Auth | Use Case |
|---|---|---|
| Public | None | Global notifications |
| Private | User auth | User-specific updates |
| Presence | User auth + metadata | Who’s online, typing indicators |
Proxy Configuration
Section titled “Proxy Configuration”Coolify handles SSL termination. Reverb runs on port 8080 internally, exposed via HTTPS:
Client (wss://app.com/app/key) → Coolify Proxy → Reverb:8080Scaling Considerations
Section titled “Scaling Considerations”Single Reverb instance handles ~10,000 concurrent connections. For higher loads:
- Run multiple application containers
- Use Redis pub/sub for cross-container communication
- Consider dedicated WebSocket servers