4.5.0
版本发布时间: 2022-04-25 04:19:58
socketio/socket.io最新发布版本:2.5.1(2024-06-19 17:36:33)
Bug Fixes
Features
- add support for catch-all listeners for outgoing packets (531104d)
This is similar to onAny()
, but for outgoing packets.
Syntax:
socket.onAnyOutgoing((event, ...args) => {
console.log(event);
});
- broadcast and expect multiple acks (8b20457)
Syntax:
io.timeout(1000).emit("some-event", (err, responses) => {
// ...
});
- add the "maxPayload" field in the handshake details (088dcb4)
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}
Links:
- Diff: https://github.com/socketio/socket.io/compare/4.4.1...4.5.0
- Client release: 4.5.0
- engine.io version:
~6.2.0
(diff) - ws version:
~8.2.3