Releases: socketio/socket.io
Releases · socketio/socket.io
4.5.3
Bug Fixes
- typings: accept an HTTP2 server in the constructor (d3d0a2d)
- typings: apply types to "io.timeout(...).emit()" calls (e357daf)
Links:
- Diff: 4.5.2...4.5.3
- Client release: 4.5.3
- engine.io version:
~6.2.0
- ws version:
~8.2.3
4.5.2
Bug Fixes
- prevent the socket from joining a room after disconnection (18f3fda)
- uws: prevent the server from crashing after upgrade (ba497ee)
Links:
- Diff: 4.5.1...4.5.2
- Client release: 4.5.2
- engine.io version:
~6.2.0
- ws version:
~8.2.3
2.5.0
The default value of the maxHttpBufferSize
option has been decreased from 100 MB to 1 MB, in order to prevent attacks by denial of service.
Security advisory: GHSA-j4f2-536g-r55m
Bug Fixes
- fix race condition in dynamic namespaces (05e1278)
- ignore packet received after disconnection (22d4bdf)
- only set 'connected' to true after middleware execution (226cc16)
- prevent the socket from joining a room after disconnection (f223178)
Links:
- Diff: 2.4.1...2.5.0
- Client release: 2.5.0
- engine.io version:
~3.6.0
(diff) - ws version:
~7.4.2
4.5.1
4.5.0
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: 4.4.1...4.5.0
- Client release: 4.5.0
- engine.io version:
~6.2.0
(diff) - ws version:
~8.2.3
4.4.1
4.4.0
Bug Fixes
- only set 'connected' to true after middleware execution (02b0f73)
Features
- add an implementation based on uWebSockets.js (c0d8c5a)
const { App } = require("uWebSockets.js");
const { Server } = require("socket.io");
const app = new App();
const io = new Server();
io.attachApp(app);
io.on("connection", (socket) => {
// ...
});
app.listen(3000, (token) => {
if (!token) {
console.warn("port already in use");
}
});
- add timeout feature (f0ed42f)
socket.timeout(5000).emit("my-event", (err) => {
if (err) {
// the client did not acknowledge the event in the given delay
}
});
interface SocketData {
name: string;
age: number;
}
const io = new Server<ClientToServerEvents, ServerToClientEvents, InterServerEvents, SocketData>();
io.on("connection", (socket) => {
socket.data.name = "john";
socket.data.age = 42;
});
Links:
- Diff: 4.3.2...4.4.0
- Client release: 4.4.0
- engine.io version:
~6.1.0
(diff) - ws version:
~8.2.3
4.3.2
Bug Fixes
Links:
- Diff: 4.3.1...4.3.2
- Client release: 4.3.2
- engine.io version:
~6.0.0
- ws version:
~8.2.3
4.3.1
Bug Fixes
Links:
- Diff: 4.3.0...4.3.1
- Client release: 4.3.1
- engine.io version:
~6.0.0
- ws version:
~8.2.3
4.3.0
For this release, most of the work was done on the client side, see here.
Bug Fixes
- typings: add name field to cookie option (#4099) (033c5d3)
- send volatile packets with binary attachments (dc81fcf)
Features
- serve ESM bundle (60edecb)
Links:
- Diff: 4.2.0...4.3.0
- Client release: 4.3.0
- engine.io version:
~6.0.0
(diff) - ws version:
~8.2.3
(diff)