Plugin
Real-time
Reverb — WebSocket broadcasting
Laravel Reverb–style channel subscriptions over WebSockets. Complements Transmit (SSE): use SSE for simple server → client push; use Reverb when clients subscribe to named channels and you may need bidirectional JSON control messages.
§ Features
GETWebSocket endpoint (default/reverb/ws, override withREVERB_PATH).- JSON text frames:
subscribe,unsubscribe,ping. reverb.Broadcast(ctx, channel, data)— withREDIS_URL, fan-out uses Redis Pub/Sub so every instance delivers to its local subscribers; without Redis, broadcasts are single-process only.GET …/healthnext to the WS path (e.g./reverb/healthwhen WS is/reverb/ws).- Optional
REVERB_ALLOWED_ORIGINS(comma-separated) for the WebSocketOrigincheck.
§ Installation
$ nimbus plugin:install reverb
Registers app.Use(reverb.New(nil)) and scaffolds config/reverb.go / loadReverb().
§ Server-side broadcast
import (
"context"
"github.com/CodeSyncr/nimbus/plugins/reverb"
)
func notifyOrderShipped(orderID string) {
_ = reverb.Broadcast(context.Background(), "orders."+orderID, map[string]any{
"event": "shipped",
})
}
§ Browser protocol
Connect to wss://your-host/reverb/ws (or your REVERB_PATH). After connected, send:
{"action":"subscribe","channel":"orders.42"}
{"action":"unsubscribe","channel":"orders.42"}
{"action":"ping"}
Server events include subscribed, message (payload in data), and pong.
§ Environment
| Variable | Description |
|---|---|
REDIS_URL | Multi-instance fan-out (default Pub/Sub channel nimbus:reverb:fanout) |
REVERB_PATH | WebSocket route (default /reverb/ws) |
REVERB_ALLOWED_ORIGINS | Allowed Origin hosts, comma-separated |
REVERB_REDIS_CHANNEL | Override Redis channel name |
Core vs plugin: Low-level hubs live in github.com/CodeSyncr/nimbus/websocket. Reverb adds channel routing, JSON protocol, and optional Redis — see WebSockets.