Install
openclaw skills install @codenova58/websocket-patternsDeep WebSocket/SSE workflow—handshake and auth, session lifecycle, heartbeats, ordering, backpressure, scaling, and observability. Use when building realtime dashboards, chat, collaborative editing, or live notifications.
openclaw skills install @codenova58/websocket-patternsRealtime connections add stateful complexity: who is connected, what order messages arrive, and what happens when links flap. Design for at-least-once delivery, explicit heartbeats, and horizontal scaling early.
Trigger conditions:
Initial offer:
Use six stages: (1) choose transport, (2) connection & auth, (3) protocol & messages, (4) reliability & ordering, (5) scale & ops, (6) security & abuse). Confirm browser vs server clients and proxies (nginx, ALB, Cloudflare).
Goal: WebSocket vs SSE vs long polling—right tool per direction.
Exit condition: Transport choice documented with why not alternatives.
Goal: Authenticated sockets without long-lived secrets in query strings when avoidable.
Exit condition: Auth diagram: issue token → connect → authorize subscriptions.
Goal: Versioned message schema; predictable errors.
{ type, id, ts, payload }; correlation ids for RPC-styleExit condition: Protocol doc + example session transcript.
Goal: Define delivery semantics—usually at-least-once over TCP; ordering per channel.
Exit condition: Reconnect story documented; storm mitigation tested.
Goal: Many connections across many nodes—affinity and pub/sub backbone.
Exit condition: Capacity model: connections per node × message fan-out cost.
Goal: Minimize attack surface on long-lived pipes.