flâneur — a map of the web's best reading

How it works | Socket.IO

socket.io · 870 words · saved by 1 readers

The bidirectional channel between the Socket.IO server (Node.js) and the Socket.IO client (browser, Node.js, or another programming language) is established with a WebSocket connection whenever possible, and will use HTTP long-polling as fallback. The Socket.IO codebase is split into two distinct layers: Engine.IO is responsible for establishing the low-level connection between the server and the client. It handles: A detailed version of the Engine.IO protocol can be found here. The source code of the reference implementation (written in TypeScript) can be found here: There are currently two implemented transports: The HTTP long-polling transport (also simply referred as "polling") consists of successive HTTP requests: Due to the nature of the transport, successive emits may be concatenated and sent within the same HTTP request. The WebSocket transport consists, well, of a WebSocket connection, which provides a bidirectional and low-latency communication channel between the server and

Version: 4.x On this page The bidirectional connection between the Socket.IO server and the Socket.IO client is established with either: a WebTransport bidirectional stream a WebSocket connection or HTTP long-polling, in the worst case The Socket.IO codebase is split into two distinct layers: the low-level plumbing: what we call Engine.IO, the engine inside Socket.IO the high-level API: Socket.IO itself Engine.IO ​ Engine.IO is responsible for establishing the low-level connection between the server and the client. It handles: the various transports and the upgrade mechanism the disconnection

Explore this link on the map →

related reading