Realtime application framework (client)
~6.2.1
~8.2.3
Size of the bundles:
min | min+gzip | |
---|---|---|
socket.io.min.js | 42.6 KB (-) | 13.6 KB (-) |
socket.io.msgpack.min.js | 47.7 KB (-) | 14.6 KB (-) |
socket.io.esm.min.js | 34.5 KB (-) | 11.5 KB (-) |
~6.2.1
(diff)~8.2.3
Size of the bundles:
min | min+gzip | |
---|---|---|
socket.io.min.js | 42.6 KB (-) | 13.6 KB (-) |
socket.io.msgpack.min.js | 47.7 KB (-) | 14.6 KB (-) |
socket.io.esm.min.js | 34.5 KB (-) | 11.5 KB (-) |
~3.5.0
~7.4.2
There were some minor bug fixes on the server side, which mandate a client bump.
~6.2.1
(diff)~8.2.3
Size of the bundles:
min | min+gzip | |
---|---|---|
socket.io.min.js | 42.6 KB (-) | 13.6 KB (-) |
socket.io.msgpack.min.js | 47.7 KB (-) | 14.6 KB (-) |
socket.io.esm.min.js | 34.5 KB (-) | 11.5 KB (-) |
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); // ""
});
This is similar to onAny()
, but for outgoing packets.
Syntax:
socket.onAnyOutgoing((event, ...args) => {
console.log(event);
});
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.
~6.2.1
(diff)~8.2.3
Size of the bundles:
min | min+gzip | |
---|---|---|
socket.io.min.js | 42.6 KB (+ 2.2 KB :arrow_up:) | 13.6 KB (+ 0.5 KB :arrow_up:) |
socket.io.msgpack.min.js | 47.7 KB (+ 2.1 KB :arrow_up:) | 14.6 KB (+ 0.4 KB :arrow_up:) |
socket.io.esm.min.js | 34.5 KB (+ 1.4 KB :arrow_up:) | 11.5 KB (+ 0.2 KB :arrow_up:) |
This release only contains minor changes. Please see the diff for more details.
~6.1.1
~8.2.3
Size of the bundles:
min | min+gzip | |
---|---|---|
socket.io.min.js | 40.4 KB (-) | 13.1 KB (-) |
socket.io.msgpack.min.js | 45.6 KB (-) | 14.2 KB (-) |
socket.io.esm.min.js | 33.1 KB (-) | 11.3 KB (-) |
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
}
});
~6.1.1
(diff)~8.2.3
Size of the bundles:
min | min+gzip | |
---|---|---|
socket.io.min.js | 40.4 KB (+ 0.4 KB :arrow_up:) | 13.1 KB (+ 0.1 KB :arrow_up:) |
socket.io.msgpack.min.js | 45.6 KB (+ 0.4 KB :arrow_up:) | 14.2 KB (-) |
socket.io.esm.min.js | 33.1 KB (+ 0.3 KB :arrow_up:) | 11.3 KB (+ 0.2 KB :arrow_up:) |
~6.0.1
~8.2.3
Size of the bundles:
min | min+gzip | |
---|---|---|
socket.io.min.js | 40.0 KB (-) | 13.0 KB (-) |
socket.io.msgpack.min.js | 45.2 KB (-) | 14.2 KB (-) |
socket.io.esm.min.js | 32.8 KB (-) | 11.1 KB (-) |
~6.0.1
~8.2.3
Size of the bundles:
min | min+gzip | |
---|---|---|
socket.io.min.js | 40.0 KB (+ 0.1 KB :arrow_up:) | 13.0 KB (+ 0.1 KB :arrow_up:) |
socket.io.msgpack.min.js | 45.2 KB (+ 0.1 KB :arrow_up:) | 14.2 KB (+ 0.1 KB :arrow_up:) |
socket.io.esm.min.js | 32.8 KB (+ 0.1 KB :arrow_up:) | 11.1 KB (-) |
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>
The bundle size has also been greatly reduced, from 16.0 KB
to 12.9 KB
(min+gzip).
~6.0.1
(diff)~8.2.3
(diff)Size of the bundles:
min | min+gzip | |
---|---|---|
socket.io.min.js | 39.9 KB (-24.6 KB :arrow_down:) | 12.9 KB (-3.1 KB :arrow_down:) |
socket.io.msgpack.min.js | 45.1 KB (-25.6 KB :arrow_down:) | 14 KB (-2.6 KB :arrow_down:) |
socket.io.esm.min.js | 32.7 KB | 11.1 KB |