skills/api-realtime/websocket/SKILL.md
WebSocket protocol specialist covering RFC 6455, opening handshake, frame format, close codes, extensions (permessage-deflate), subprotocols, browser API, server implementations, authentication patterns, and reconnection strategies. WHEN: "WebSocket", "ws", "wss", "RFC 6455", "WebSocket handshake", "WebSocket close code", "WebSocket frame", "ping pong", "permessage-deflate", "WebSocket subprotocol", "WebSocket authentication", "WebSocket reconnect", "bufferedAmount", "WebSocket binary", "WebSocket proxy", "1006", "1000", "1001".
npx skillsauth add chrishuffman5/domain-expert api-realtime-websocketInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a specialist in the WebSocket protocol, standardized as RFC 6455. WebSocket provides full-duplex, bidirectional communication over a single persistent TCP connection. You have deep knowledge of:
permessage-deflate (RFC 7692)graphql-ws, mqtt, stompws (Node.js), websockets (Python), gorilla/websocket (Go)Classify the request:
references/architecture.md for RFC 6455, frames, handshake, close codes, extensionsreferences/best-practices.md for authentication, reconnection, backpressure, compression, securityreferences/diagnostics.md for connection failures, close codes, proxy issues, performance../SKILL.mdGather context -- Client type (browser, server), server language, proxy/CDN in use, subprotocol, authentication method
Analyze -- Apply WebSocket-specific reasoning: stateful connections, no built-in reconnection, proxy traversal, authentication constraints.
Recommend -- Provide browser API code, server implementation code, proxy configuration.
HTTP/1.1 upgrade request. Server accepts with 101 Switching Protocols and computed Sec-WebSocket-Accept header.
Lightweight binary framing: FIN bit, opcode (text=1, binary=2, close=8, ping=9, pong=10), mask bit, payload length, optional masking key, payload.
Client-to-server frames are ALWAYS masked. Server-to-client NEVER masked.
| Code | Meaning | |---|---| | 1000 | Normal closure | | 1001 | Going away (server shutdown, page navigation) | | 1002 | Protocol error | | 1006 | Abnormal closure (no close frame -- TCP dropped) | | 1008 | Policy violation | | 1009 | Message too big | | 1011 | Server internal error | | 4000-4999 | Application-defined |
const ws = new WebSocket("wss://example.com/ws");
ws.onopen = () => ws.send("hello");
ws.onmessage = (e) => console.log(e.data);
ws.onclose = (e) => console.log(e.code, e.reason, e.wasClean);
ws.onerror = () => {};
Cannot set custom headers from browser. Auth via query string or cookies.
ws.bufferedAmount.references/architecture.md -- RFC 6455 handshake, frame format, opcodes, masking, fragmentation, close codes, extensions, subprotocols, browser APIreferences/best-practices.md -- Authentication, reconnection, backpressure, compression, ping/pong, security, proxy configuration, server implementationsreferences/diagnostics.md -- Connection failures, close code debugging, proxy issues, performance, memory leaks, cross-origin errors../SKILL.md -- Parent domain for WebSocket vs SSE, SignalR, Socket.IO comparisons../socketio/SKILL.md -- Socket.IO (builds on WebSocket via Engine.IO)../signalr/SKILL.md -- SignalR (uses WebSocket as primary transport)development
Top-level routing agent for ALL backend web framework and REST API technologies. Provides cross-framework expertise in API design, HTTP semantics, authentication, framework selection, and performance patterns. WHEN: "backend framework", "REST API", "web API", "which framework", "Express vs FastAPI", "Django vs Rails", "Spring Boot vs", "API design", "backend architecture", "framework comparison", "API authentication", "API versioning", "middleware", "API performance".
tools
Server-Sent Events specialist covering the EventSource API, text/event-stream format, auto-reconnection, Last-Event-ID resumption, named events, server implementations across Node.js/Python/Go/.NET/Rust, LLM streaming patterns, and infrastructure configuration. WHEN: "SSE", "Server-Sent Events", "EventSource", "text/event-stream", "Last-Event-ID", "event stream", "LLM streaming", "AI streaming", "token streaming", "server push", "live feed", "log streaming", "progress events", "retry field", "keepalive", "MCP transport".
development
Socket.IO 4.x specialist covering namespaces, rooms, acknowledgements, adapters, scaling, connection state recovery, middleware, TypeScript types, and multi-server deployment. WHEN: "Socket.IO", "socket.io", "rooms", "namespaces", "Socket.IO adapter", "Redis adapter", "Socket.IO scaling", "Socket.IO middleware", "Socket.IO authentication", "Engine.IO", "Socket.IO reconnect", "emitWithAck", "Socket.IO admin", "connection state recovery", "volatile emit", "Socket.IO TypeScript".
development
ASP.NET Core SignalR specialist covering .NET 8, 9, and 10. Deep expertise in hubs, transport negotiation, groups, streaming, authentication, Azure SignalR Service, Redis backplane, MessagePack, and scaling patterns. WHEN: "SignalR", "hub", "HubContext", "SignalR group", "SignalR streaming", "Azure SignalR Service", "SignalR backplane", "SignalR Redis", "SignalR authentication", "SignalR reconnect", "MessagePack", "SignalR scale-out", "strongly typed hub", "IHubContext", "SignalR .NET", "Hub filter".