6.2.0
Features
- add details to the "close" event (b9252e2)
The close 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("close", (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); // ""
});
Note: the error object was already included before this commit and is kept for backward compatibility.
- slice write buffer according to the maxPayload value (46fdc2f)
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.
Links
- Diff: 6.1.1...6.2.0
- Server release: 6.2.0
- ws version:
~8.2.3