socket.io
4.8.4 · 25 Sep 2026MIT16.6M / weekRepositoryHomepagenpmAtom feed
4.8.4 is the newest release of 4.x.
In short
1 fixed2 internal
Security
1 advisory affects 4.5.0; 4.6.2 fixes them
- Moderatesocket.io has an unhandled 'error' eventGHSA-25hc-qcg6-38wj · 19 Jun 2024Fixed in 4.6.2
Release note
The section about socket.io of a note shared by several packages.
Bug Fixes
typings: ensure compatibility with TypeScript 3.x
Features
Catch-all listeners for outgoing packets
This is similar to onAny(), but for outgoing packets.
Syntax:
socket.onAnyOutgoing((event, ...args) => {
console.log(event);
});Added in 531104d.
Broadcast and expect multiple acknowledgements
Syntax:
io.timeout(1000).emit("some-event", (err, responses) => {
// ...
});Added in 8b20457.
maxHttpBufferSize value negotiation
A "maxPayload" field is now included in the Engine.IO handshake, so that clients in HTTP long-polling can decide how many packets they have to send to stay under the maxHttpBufferSize value.
This is a backward compatible change which should not mandate a new major revision of the protocol (we stay in v4), as we only add a field in the JSON-encoded handshake data:
0{"sid":"lv_VI97HAXpY6yYWAAAC","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000,"maxPayload":1000000}Added in 088dcb4.