Back to demos
Real-time WebSocket
Simulated WebSocket connection with live events, metrics, and message sending. No backend required.
Disconnected
ws://localhost:8081/ws
Live Event Feed
0Connect to start receiving events
Connection Metrics
Received
0
Sent
0
Latency
--
Uptime
--
Heartbeat
inactive
Send Test Message
Architecture
BrowserWebSocket client
WebSocketws:// upgrade
Go Hubpkg/ws/
Notificationsfeature
AI Chatfeature
The WebSocket hub is a reusable pkg/ws/ module. Any feature can broadcast real-time events by implementing the Broadcaster interface. The hub manages connections, rooms, and fan-out — features only call hub.Broadcast(event).
This is a simulated demo. In production, events arrive via WebSocket at GET /ws?token=xxx from the Go backend.