web-realtime-socket-io
Installation
SKILL.md
Socket.IO Real-Time Communication Patterns
Quick Guide: Socket.IO is a protocol layered over WebSocket, not an implementation of it — its client and a plain WebSocket server cannot talk to each other in either direction. What the layer buys is transport fallback, automatic reconnection, rooms, namespaces and acknowledgments, for about 14.5KB gzipped. The facts that change the answer:
authaccepts a function that re-runs on every reconnection,timeoutandackTimeoutare different clocks, andsocket.recovered(v4.6.0+) tells you whether missed events were replayed or a full state refresh is owed.
Detailed Resources:
- examples/core.md — typed socket factory, connection and event hooks, emit-with-ack, offline queue, volatile events, Manager multiplexing
- examples/authentication.md — token auth, refresh on reconnect, per-namespace auth, cookie auth, auth state machine
- examples/rooms.md — room manager and hooks, multi-room chat, namespace sockets, conditional namespace access
- reference.md — client options, socket and manager events, disconnect reasons, comparison table, checklists
Which path applies
- One connection to the default namespace —
io(url, options)creates the socket and its Manager together. This is the shape in examples/core.md and covers most apps. - Several namespaces over one connection — construct
new Manager(url)yourself and callmanager.socket("/chat")per namespace. The namespaces share a single transport and can each carry their ownauth, which is what makes per-namespace authorization possible. See examples/rooms.md.
Calling io() more than once against the same URL opens a second transport rather than multiplexing — the Manager is what shares one.