NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2395 most downloaded on npm
Realtime application framework client
Last release 9 days ago
25 Sep 2026
Release timing varies
gaps range from 8 days to 1.2 years
Some releases are documented
notes for 35 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
132 releases · first in 2011
types: export ExtendedError for connect_error event
engine.io-client@~6.6.1 (no change)ws@~8.21.0 (diff)There were some minor bug fixes on the server side, which mandate a client bump.
One column per quarter.
There were some minor bug fixes on the server side, which mandate a client bump.
engine.io-client@~6.6.1 (no change)ws@~8.18.3 (diff)bundle do not mangle the "_placeholder" attribute (bis)
engine.io-client@~6.6.1 (no change)ws@~8.17.1 (no change)bundle: do not mangle the "_placeholder" attribute
engine.io-client@~6.6.1 (no change)ws@~8.17.1 (no change)The transports option now accepts an array of transport implementations:
The transports option now accepts an array of transport implementations:
import { io } from "socket.io-client";
import { XHR, WebSocket } from "engine.io-client";
const socket = io({
transports: [XHR, WebSocket]
});
Here is the list of provided implementations:
| Transport | Description |
|---|---|
Fetch |
HTTP long-polling based on the built-in fetch() method. |
NodeXHR |
HTTP long-polling based on the XMLHttpRequest object provided by the xmlhttprequest-ssl package. |
XHR |
HTTP long-polling based on the built-in XMLHttpRequest object. |
NodeWebSocket |
WebSocket transport based on the WebSocket object provided by the ws package. |
WebSocket |
WebSocket transport based on the built-in WebSocket object. |
WebTransport |
WebTransport transport based on the built-in WebTransport object. |
Usage:
| Transport | browser | Node.js | Deno | Bun |
|---|---|---|---|---|
Fetch |
:white_check_mark: | :white_check_mark: (1) | :white_check_mark: | :white_check_mark: |
NodeXHR |
:white_check_mark: | :white_check_mark: | :white_check_mark: | |
XHR |
:white_check_mark: | |||
NodeWebSocket |
:white_check_mark: | :white_check_mark: | :white_check_mark: | |
WebSocket |
:white_check_mark: | :white_check_mark: (2) | :white_check_mark: | :white_check_mark: |
WebTransport |
:white_check_mark: | :white_check_mark: |
(1) since v18.0.0 (2) since v21.0.0
When setting the tryAllTransports option to true, if the first transport (usually, HTTP long-polling) fails, then the other transports will be tested too:
import { io } from "socket.io-client";
const socket = io({
tryAllTransports: true
});
This feature is useful in two cases:
transports: ["websocket", "polling"])The only potential downside is that the connection attempt could take more time in case of failure, as there have been reports of WebSocket connection errors taking several seconds before being detected (that's one reason for using HTTP long-polling first). That's why the option defaults to false for now.
Added in 579b243.
engine.io-client@~6.6.1 (diff and diff)ws@~8.17.1 (diff)discard acknowledgements upon disconnection
engine.io-client@~6.5.2 (no change)ws@~8.11.0 (no change)There were some minor bug fixes on the server side, which mandate a client bump.
There were some minor bug fixes on the server side, which mandate a client bump.
engine.io-client@~6.5.2 (no change)ws@~8.11.0 (no change)improve compatibility with node16 module resolution
engine.io-client@~6.5.2 (no change)ws@~8.11.0 (no change)Some bug fixes are included from the engine.io-client package:
Some bug fixes are included from the engine.io-client package:
engine.io-client@~6.5.2 (diff)ws@~8.11.0 (no change)Some bug fixes are included from the engine.io-client package:
Some bug fixes are included from the engine.io-client package:
engine.io-client@~6.5.1 (diff)ws@~8.11.0 (no change)properly report timeout error when connecting
The Engine.IO client can now use WebTransport as the underlying transport.
WebTransport is a web API that uses the HTTP/3 protocol as a bidirectional transport. It's intended for two-way communications between a web client and an HTTP/3 server.
References:
For Node.js clients: until WebTransport support lands in Node.js, you can use the @fails-components/webtransport package:
import { WebTransport } from "@fails-components/webtransport";
global.WebTransport = WebTransport;
Added in 7195c0f.
When setting the withCredentials option to true, the Node.js client will now include the cookies in the HTTP requests, making it easier to use it with cookie-based sticky sessions.
import { io } from "socket.io-client";
const socket = io("https://example.com", {
withCredentials: true
});
Added in 5fc88a6.
By default, the ESM build does not include the debug package in the browser environments, because it increases the bundle size (see 16b6569).
Which means that, unfortunately, debug logs are not available in the devtools console, even when setting the localStorage.debug = ... attribute.
You can now import the build which includes the debug packages with a conditional import. Example with vite:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
server: {
port: 4000
},
resolve: {
conditions: ["development"]
}
})
Reference: https://v2.vitejs.dev/config/#resolve-conditions
Added in 781d753.
engine.io-client@~6.5.0 (diff)ws@~8.11.0 (no change)exports: move types condition to the top
do not drain the queue while the socket is offline
engine.io-client@~6.4.0 (no change)ws@~8.11.0 (no change)typings: do not expose browser-specific types
The trailing slash which was added by default can now be disabled:
import { io } from "socket.io-client";
const socket = io("https://example.com", {
addTrailingSlash: false
});
In the example above, the request URL will be https://example.com/socket.io instead of https://example.com/socket.io/.
Added in 21a6e12.
This commit adds some syntactic sugar around acknowledgements:
// without timeout
const response = await socket.emitWithAck("hello", "world");
// with a specific timeout
try {
const response = await socket.timeout(1000).emitWithAck("hello", "world");
} catch (err) {
// the server did not acknowledge the event in the given delay
}
Note: environments that do not support Promises will need to add a polyfill in order to use this feature.
Added in 47b979d.
This feature allows a client to reconnect after a temporary disconnection and restore its ID and receive any packets that was missed during the disconnection gap. It must be enabled on the server side.
A new boolean attribute named recovered is added on the socket object:
socket.on("connect", () => {
console.log(socket.recovered); // whether the recovery was successful
});
Added in 54d5ee0 (server) and b4e20c5 (client).
Two new options are available:
retries: the maximum number of retries. Above the limit, the packet will be discarded.ackTimeout: the default timeout in milliseconds used when waiting for an acknowledgement (not to be mixed up with the already existing timeout option, which is used by the Manager during the connection)const socket = io({
retries: 3,
ackTimeout: 10000
});
// implicit ack
socket.emit("my-event");
// explicit ack
socket.emit("my-event", (err, val) => { /* ... */ });
// custom timeout (in that case the ackTimeout is optional)
socket.timeout(5000).emit("my-event", (err, val) => { /* ... */ });
In all examples above, "my-event" will be sent up to 4 times (1 + 3), until the server sends an acknowledgement.
Assigning a unique ID to each packet is the duty of the user, in order to allow deduplication on the server side.
Added in 655dce9.
Nothing published for this version
Nothing published for this version
This release contains a bump of the socket.io-parser dependency, in order to fix CVE-2022-2421.
This release contains a bump of the socket.io-parser dependency, in order to fix CVE-2022-2421.
engine.io-client@~6.2.3 (no change)ws@~8.2.3 (no change)### Bug Fixes * do not swallow user exceptions (2403b88) ### Dependencies - `engine.io-client@~6.2.3` (https://github.com/socketio/engine.io-client/co
engine.io-client@~6.2.3 (https://github.com/socketio/engine.io-client/compare/6.2.1...6.2.3)ws@~8.2.3 (no change)handle ill-formatted packet from server
engine.io-client@~6.2.1 (no change)ws@~8.2.3 (no change)engine.io-client@~3.5.0 (no change)ws@~7.4.2 (no change)There were some minor bug fixes on the server side, which mandate a client bump.
There were some minor bug fixes on the server side, which mandate a client bump.
engine.io-client@~6.2.1 (no change)ws@~8.2.3 (no change)The "disconnect" event will now include additional details to help debugging if anything has gone wrong.
Example when a payload is over the maxHttpBufferSize value in HTTP long-polling mode:
socket.on("disconnect", (reason, details) => {
console.log(reason); // "transport error"
// in that case, details is an error object
console.log(details.message); "xhr post error"
console.log(details.description); // 413 (the HTTP status of the response)
// details.context refers to the XMLHttpRequest object
console.log(details.context.status); // 413
console.log(details.context.responseText); // ""
});
Added in b862924.
This is similar to onAny(), but for outgoing packets.
Syntax:
socket.onAnyOutgoing((event, ...args) => {
console.log(event);
});
Added in 74e3e60.
The server will now include a "maxPayload" field in the handshake details, allowing the clients to decide how many packets they have to send to stay under the maxHttpBufferSize value.
Added in 46fdc2f.
engine.io-client@~6.2.1 (https://github.com/socketio/engine.io-client/compare/6.1.1...6.2.1)ws@~8.2.3 (no change)Nothing published for this version
add package name in nested package.json (53d8fca), closes socketio/socket.io-client#1513
socket.disconnect().connect() usage (99c2cb8)socket.timeout(5000).emit("my-event", (err) => {
if (err) {
// the server did not acknowledge the event in the given delay
}
});
Nothing published for this version
restore the default export (bis)
```html import { io } from "https://cdn.socket.io/4.3.0/socket.io.esm.min.js";
An ESM bundle is now provided:
<script type="module">
import { io } from "https://cdn.socket.io/4.3.0/socket.io.esm.min.js";
const socket = io();
socket.emit("hello", "world");
</script>
Nothing published for this version
Nothing published for this version
Nothing published for this version
typings: add missing closeOnBeforeunload option
There were some minor bug fixes on the server side, which mandate a client bump.
Nothing published for this version
typings: add fallback to untyped event listener
typings: make auth property public
Nothing published for this version
The major bump is due to some breaking changes on the server side.
restore support for web workers
include the path in the manager ID
Nothing published for this version
emit a connect_error event upon connection failure
emit an error when reaching a v2.x server (ec1f8c3), closes /github.com/socketio/engine.io-protocol#difference-between-v3-and-v4 /github.com/socketio/
properly export io in ES modules wrapper
typings: export withCredentials option
typings: export Socket and SocketOptions types
// before
socket.on("error", () => {});
// after
socket.on("connect_error", () => {});
the Socket#binary() method is removed, as this use case is now covered by the ability to provide your own parser.
the Socket instance will no longer forward the events of its Manager
Those events can still be accessed on the Manager instance though:
socket.io.on("reconnect", () => {
// ...
});
// before
socket.on("error", () => {});
// after
socket.on("connect_error", () => {});
Those events can still be accessed on the Manager instance though:
socket.io.on("reconnect", () => {
// ...
});
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
The debug dependency has been reverted to ~3.1.0, as the newer versions contains ES6 syntax which breaks in IE browsers.
The debug dependency has been reverted to ~3.1.0, as the newer versions contains ES6 syntax which breaks in IE
browsers.
Please note that this only applied to users that bundle the Socket.IO client in their application, with webpack for example, as the "official" bundles (in the dist/ folder) were already transpiled with babel.
For webpack users, you can also take a look at the webpack-remove-debug plugin.
The minor bump is matching the bump of the server, but there is no new feature in this release.
global variable (related: https://github.com/socketio/socket.io-client/issues/1166)Nothing published for this version
Nothing published for this version
fire an error event on middleware failure for non-root namespace
// by default, the object is recursively scanned to check whether it contains some binary data
// in the following example, the check is skipped in order to improve performance
socket.binary(false).emit('plain-object', object);
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →