3.1.1 (2021-02-03)
- properly parse the CONNECT packet in v2 compatibility mode (6f4bd7f)
- typings: add return types and general-case overload signatures (#3776) (9e8f288)
- typings: update the types of "query", "auth" and "headers" (4f2e9a7)
3.1.0 (2021-01-15)
- confirm a weak but matching ETag (#3485) (161091d)
- esm: export the Namespace and Socket class (#3699) (233650c)
- add support for Socket.IO v2 clients (9925746)
- add room events (155fa63)
- allow integers as event names (1c220dd)
3.0.5 (2021-01-05)
- properly clear timeout on connection failure (170b739)
- restore the socket middleware functionality (bf54327)
3.0.4 (2020-12-07)
3.0.3 (2020-11-19)
3.0.2 (2020-11-17)
- merge Engine.IO options (43705d7)
3.0.1 (2020-11-09)
- export ServerOptions and Namespace types (#3684) (f62f180)
- typings: update the signature of the emit method (50671d9)
3.0.0 (2020-11-05)
- close clients with no namespace (91cd255)
- emit an Error object upon middleware error (54bf4a4)
- serve msgpack bundle (aa7574f)
- add support for catch-all listeners (5c73733)
- make Socket#join() and Socket#leave() synchronous (129c641)
- remove prod dependency to socket.io-client (7603da7)
- move binary detection back to the parser (669592d)
- add ES6 module export (8b6b100)
- do not reuse the Engine.IO id (2875d2c)
- remove Server#set() method (029f478)
- remove Socket#rooms object (1507b41)
- remove the 'origins' option (a8c0600)
- remove the implicit connection to the default namespace (3289f7e)
- throw upon reserved event names (4bd5b23)
-
the Socket#use() method is removed (see 5c73733)
-
Socket#join() and Socket#leave() do not accept a callback argument anymore.
Before:
socket.join("room1", () => {
io.to("room1").emit("hello");
});
After:
socket.join("room1");
io.to("room1").emit("hello");
// or await socket.join("room1"); for custom adapters
- the "connected" map is renamed to "sockets"
- the Socket#binary() method is removed, as this use case is now covered by the ability to provide your own parser.
- the 'origins' option is removed
Before:
new Server(3000, {
origins: ["https://example.com"]
});
The 'origins' option was used in the allowRequest method, in order to determine whether the request should pass or not. And the Engine.IO server would implicitly add the necessary Access-Control-Allow-xxx headers.
After:
new Server(3000, {
cors: {
origin: "https://example.com",
methods: ["GET", "POST"],
allowedHeaders: ["content-type"]
}
});
The already existing 'allowRequest' option can be used for validation:
new Server(3000, {
allowRequest: (req, callback) => {
callback(null, req.headers.referer.startsWith("https://example.com"));
}
});
-
Socket#rooms is now a Set instead of an object
-
Namespace#connected is now a Map instead of an object
-
there is no more implicit connection to the default namespace:
// client-side
const socket = io("/admin");
// server-side
io.on("connect", socket => {
// not triggered anymore
})
io.use((socket, next) => {
// not triggered anymore
});
io.of("/admin").use((socket, next) => {
// triggered
});
- the Server#set() method was removed
This method was kept for backward-compatibility with pre-1.0 versions.
3.0.0-rc4 (2020-10-30)
3.0.0-rc3 (2020-10-26)
- add support for catch-all listeners (5c73733)
- make Socket#join() and Socket#leave() synchronous (129c641)
- remove prod dependency to socket.io-client (7603da7)
-
the Socket#use() method is removed (see 5c73733)
-
Socket#join() and Socket#leave() do not accept a callback argument anymore.
Before:
socket.join("room1", () => {
io.to("room1").emit("hello");
});
After:
socket.join("room1");
io.to("room1").emit("hello");
// or await socket.join("room1"); for custom adapters
3.0.0-rc2 (2020-10-15)
- close clients with no namespace (91cd255)
- remove duplicate _sockets map (8a5db7f)
- move binary detection back to the parser (669592d)
- the "connected" map is renamed to "sockets"
- the Socket#binary() method is removed, as this use case is now covered by the ability to provide your own parser.
3.0.0-rc1 (2020-10-13)
- add ES6 module export (8b6b100)
- do not reuse the Engine.IO id (2875d2c)
- remove Server#set() method (029f478)
- remove Socket#rooms object (1507b41)
- remove the 'origins' option (a8c0600)
- remove the implicit connection to the default namespace (3289f7e)
- throw upon reserved event names (4bd5b23)
- the 'origins' option is removed
Before:
new Server(3000, {
origins: ["https://example.com"]
});
The 'origins' option was used in the allowRequest method, in order to determine whether the request should pass or not. And the Engine.IO server would implicitly add the necessary Access-Control-Allow-xxx headers.
After:
new Server(3000, {
cors: {
origin: "https://example.com",
methods: ["GET", "POST"],
allowedHeaders: ["content-type"]
}
});
The already existing 'allowRequest' option can be used for validation:
new Server(3000, {
allowRequest: (req, callback) => {
callback(null, req.headers.referer.startsWith("https://example.com"));
}
});
-
Socket#rooms is now a Set instead of an object
-
Namespace#connected is now a Map instead of an object
-
there is no more implicit connection to the default namespace:
// client-side
const socket = io("/admin");
// server-side
io.on("connect", socket => {
// not triggered anymore
})
io.use((socket, next) => {
// not triggered anymore
});
io.of("/admin").use((socket, next) => {
// triggered
});
- the Server#set() method was removed
This method was kept for backward-compatibility with pre-1.0 versions.