socket.io-client
Advanced tools
Changelog
4.5.4 (2022-11-22)
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)Changelog
4.5.3 (2022-10-15)
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)Changelog
4.5.2 (2022-09-02)
engine.io-client@~6.2.1
(no change)ws@~8.2.3
(no change)Changelog
2.5.0 (2022-06-26)
engine.io-client@~3.5.0
(no change)ws@~7.4.2
(no change)Changelog
4.5.1 (2022-05-17)
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)Changelog
4.5.0 (2022-04-23)
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)Changelog
4.4.0 (2021-11-18)
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
}
});