Created by: renovate[bot]
This PR contains the following updates:
Package | Change | Age | Adoption | Passing | Confidence |
---|---|---|---|---|---|
socket.io | ~0.9.16 -> ~3.1.0 |
Release Notes
socketio/socket.io
v3.1.1
Bug Fixes
- 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)
v3.1.0
Features
- 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)
Bug Fixes
- allow integers as event names (1c220dd)
3.0.5 (2021-01-05)
Bug Fixes
- properly clear timeout on connection failure (170b739)
Reverts
- restore the socket middleware functionality (bf54327)
3.0.4 (2020-12-07)
3.0.3 (2020-11-19)
3.0.2 (2020-11-17)
Bug Fixes
- merge Engine.IO options (43705d7)
3.0.1 (2020-11-09)
Bug Fixes
- export ServerOptions and Namespace types (#3684) (f62f180)
- typings: update the signature of the emit method (50671d9)
v3.0.5
Bug Fixes
- properly clear timeout on connection failure (170b739)
Reverts
- restore the socket middleware functionality (bf54327)
v3.0.4
v3.0.3
v3.0.2
Bug Fixes
- merge Engine.IO options (43705d7)
v3.0.1
Bug Fixes
- export ServerOptions and Namespace types (#3684) (f62f180)
- typings: update the signature of the emit method (50671d9)
v3.0.0
Bug Fixes
- close clients with no namespace (91cd255)
Features
- 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)
BREAKING CHANGES
-
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.
v2.4.1
This release reverts the breaking change introduced in 2.4.0
(f78a575
).
If you are using Socket.IO v2, you should explicitly allow/disallow cross-origin requests:
- without CORS (server and client are served from the same domain):
const io = require("socket.io")(httpServer, {
allowRequest: (req, callback) => {
callback(null, req.headers.origin === undefined); // cross-origin requests will not be allowed
}
});
- with CORS (server and client are served from distinct domains):
io.origins(["http://localhost:3000"]); // for local development
io.origins(["https://example.com"]);
In any case, please consider upgrading to Socket.IO v3, where this security issue is now fixed (CORS is disabled by default).
Reverts
- fix(security): do not allow all origins by default (a169050)
Links:
- Diff: https://github.com/socketio/socket.io/compare/2.4.0...2.4.1
- Client release: -
- engine.io version:
~3.5.0
- ws version:
~7.4.2
v2.4.0
Related blog post: https://socket.io/blog/socket-io-2-4-0/
Features (from Engine.IO)
Bug Fixes
- security: do not allow all origins by default (f78a575)
- properly overwrite the query sent in the handshake (d33a619)
Previously, CORS was enabled by default, which meant that a Socket.IO server sent the necessary CORS headers (Access-Control-Allow-xxx
) to any domain. This will not be the case anymore, and you now have to explicitly enable it.
Please note that you are not impacted if:
- you are using Socket.IO v2 and the
origins
option to restrict the list of allowed domains - you are using Socket.IO v3 (disabled by default)
This commit also removes the support for '*' matchers and protocol-less URL:
io.origins('https://example.com:443'); => io.origins(['https://example.com']);
io.origins('localhost:3000'); => io.origins(['http://localhost:3000']);
io.origins('http://localhost:*'); => io.origins(['http://localhost:3000']);
io.origins('*:3000'); => io.origins(['http://localhost:3000']);
To restore the previous behavior (please use with caution):
io.origins((_, callback) => {
callback(null, true);
});
See also:
- https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
- https://socket.io/docs/v3/handling-cors/
- https://socket.io/docs/v3/migrating-from-2-x-to-3-0/#CORS-handling
Thanks a lot to @ni8walk3r for the security report.
Links:
- Milestone: 2.4.0
- Diff: https://github.com/socketio/socket.io/compare/2.3.0...2.4.0
- Client release: 2.4.0
- engine.io version:
~3.5.0
- ws version:
~7.4.2
v2.3.0
This release mainly contains a bump of the engine.io
and ws
packages, but no additional features.
Links:
- Milestone: 2.3.0
- Diff: https://github.com/socketio/socket.io/compare/2.2.0...2.3.0
- Client release: 2.3.0
- engine.io version:
~3.4.0
(diff: https://github.com/socketio/engine.io/compare/3.3.1...3.4.2) - ws version:
^7.1.2
(diff: https://github.com/websockets/ws/compare/6.1.2...7.3.1)
v2.2.0
Features
- add cache-control header when serving the client source (#2907)
Bug fixes
- throw an error when trying to access the clients of a dynamic namespace (#3355)
Links
- Milestone: 2.2.0
- Diff: https://github.com/socketio/socket.io/compare/2.1.1...2.2.0
- Client release: 2.2.0
- engine.io version:
~3.3.1
(diff: https://github.com/socketio/engine.io/compare/3.2.0...3.3.1) - ws version:
~6.1.0
(diff: https://github.com/websockets/ws/compare/3.3.1...6.1.2)
v2.1.1
Features
- add local flag to the socket object (#3219)
socket.local.to('room101').emit(/* */);
Bug fixes
(client) fire an error event on middleware failure for non-root namespace (socketio/socket.io-client#1202)
Links:
- Milestone: 2.1.1
- Diff: https://github.com/socketio/socket.io/compare/2.1.0...2.1.1
- Client release: 2.1.1
- engine.io version:
~3.3.1
- ws version:
~6.1.0
v2.1.0
Features
- add a 'binary' flag (#3185)
// by default, the object is recursively scanned to check whether it contains some binary data
// in the following example, the check is skipped in order to improve performance
socket.binary(false).emit('plain-object', object);
// it also works at the namespace level
io.binary(false).emit('plain-object', object);
- add support for dynamic namespaces (#3195)
io.of(/^\/dynamic-\d+$/).on('connect', (socket) => {
// socket.nsp.name = '/dynamic-101'
});
// client-side
const client = require('socket.io-client')('/dynamic-101');
Bug fixes
- properly emit 'connect' when using a custom namespace (#3197)
- include the protocol in the origins check (#3198)
⚠ from Engine.IO 3.2.0 release
Important note There are two non-breaking changes that are somehow quite important:
-
ws
was reverted as the default wsEngine (socketio/engine.io#550), as there was several blocking issues withuws
. You can still useuws
by runningnpm install uws --save
in your project and using thewsEngine
option:
var engine = require('engine.io');
var server = engine.listen(3000, {
wsEngine: 'uws'
});
-
pingTimeout
now defaults to 5 seconds (instead of 60 seconds): socketio/engine.io#551
Links:
- Milestone: 2.1.0
- Diff: https://github.com/socketio/socket.io/compare/2.0.4...2.1.0
- Client release: 2.1.0
- engine.io version:
~3.2.0
(diff: https://github.com/socketio/engine.io/compare/3.1.0...3.2.0) - ws version:
~3.3.1
(diff: https://github.com/websockets/ws/compare/2.3.1...3.3.1)
v2.0.4
Bug fixes
- do not throw when receiving an unhandled error packet (#3038)
- reset rooms object before broadcasting from namespace (#3039)
Links:
- Milestone: 2.0.4
- Diff: 2.0.3...2.0.4
- Client release: 2.0.4
- Diff
engine.io
: - - Diff
ws
: -
v2.0.3
Bug fixes
Links:
- Milestone: 2.0.3
- Diff: 2.0.2...2.0.3
- Client release: 2.0.3
- Diff
engine.io
: - - Diff
ws
: -
v2.0.2
Bug fixes
- fix timing issues with middleware (#2948)
Links:
- Milestone: 2.0.2
- Diff: 2.0.1...2.0.2
- Client release: 2.0.2
- Diff
engine.io
: - - Diff
ws
: -
v2.0.1
Bug fixes
- update path of client file (#2934)
Links:
- Milestone: 2.0.1
- Diff: 2.0.0...2.0.1
- Client release: 2.0.1
- Diff
engine.io
: - - Diff
ws
: -
v2.0.0
This major release brings several performance improvements:
-
uws is now the default Websocket engine. It should bring significant improvement in performance (particularly in terms of memory consumption) (https://github.com/socketio/engine.io/releases/tag/2.0.0)
-
the Engine.IO and Socket.IO handshake packets were merged, reducing the number of roundtrips necessary to establish a connection. (#2833)
-
it is now possible to provide a custom parser according to the needs of your application (#2829). Please take a look at the example for more information.
Please note that this release is not backward-compatible, due to:
- a breaking change related to utf-8 encoding in engine.io-parser (socketio/engine.io-parser#81)
- an update to make the socket id on the client match the id on the server-side (socketio/socket.io-client#1058)
Please also note that if you are using a self-signed certificate, rejectUnauthorized
now defaults to true
(socketio/engine.io-client#558).
Finally, the API documentation is now in the repository (here), and the content of the website here. Do not hesitate if you see something wrong or missing!
The full list of changes:
- [feat] Move binary detection to the parser (#2923)
- [feat] Allow to join several rooms at once (#2879)
- [feat] Merge Engine.IO and Socket.IO handshake packets (#2833)
- [feat] Allow the use of custom parsers (#2829)
- [fix] Use path.resolve by default and require.resolve as a fallback (#2797) (by @a-lucas)
- [fix] Properly close the connection on error (#2681) (by @Nibbler999)
- [fix] Prevent null from being accepted as argument (#2606) (by @ianbrode)
- [perf] Use shared instance of the encoder (#2825) (by @Nibbler999)
- [perf] Reset properties instead of deleting them (#2826) (by @Nibbler999)
- [perf] micro-optimisations (#2793) (by @billouboq)
- [chore] Merge history of 1.7.x and 0.9.x branches (#2930)
- [chore] Added backers and sponsors on the README (#2933) (by @xdamman)
- [chore] Bump dependencies (#2926)
- [chore] Bump socket.io-adapter to version 1.0.0 (#2867)
- [chore] Bump engine.io to version 2.0.2 (#2864)
- [chore] Bump engine.io to version 2.0.0 (#2832) (by @sgress454)
- [chore] Update issue template with fiddle (#2811)
- [chore] Update copyright year LICENSE to 2017 (#2803) (by @isabellatea)
- [docs] Add an example of custom parser (#2929)
- [docs] Replace non-breaking space with proper whitespace (#2913) (by @epicTCK)
- [docs] Update emit cheatsheet (#2906) (by @FarazPatankar)
- [docs] Explicitly document that Server extends EventEmitter (#2874) (by @i8-pi)
- [docs] Add server.engine.generateId attribute (#2880) (by @efkan)
- [docs] Fix wrong space character in README (#2900) (by @SimenB)
- [docs] Fix documentation for 'connect' event (#2898) (by @swhgoon)
- [docs] Add webpack build example (#2828)
- [docs] Update the wording to match the code example (#2853) (by @timruffles)
- [docs] Small addition to the Express Readme Part (#2846) (by @H3rby7)
- [docs] Add a 'Features' section in the README (#2824)
- [docs] Add httpd cluster example (#2819)
- [docs] Add haproxy cluster example (#2818)
- [docs] Add nginx cluster example (#2817)
- [docs] Implement whiteboard example (#2810)
- [docs] Fix documentation for
local
flag (#2816) - [docs] Add emit cheatsheet (#2815)
- [docs] Add pingInterval/pingTimeout/transports options in the API documentation (#2814)
- [docs] Add an example for socket.join() method (#2813)
- [docs] Fix a typo on
clients
method in the API documentation (#2812) - [docs] Fix wrong argument name in API.md (#2802) (by @andrea11)
- [docs] Add install script on Readme.md (#2780) (by @bananaappletw)
- [docs] API documentation (#2784)
Besides, we are proud to announce that Socket.IO is now a part of open collective: https://opencollective.com/socketio. More on that later.
v1.7.4
- [chore] Bump engine.io to version 1.8.4
v1.7.3
- [chore] Bump engine.io-client to version 1.8.3
v1.7.2
v1.7.1
(following socket.io-client
update)
v1.7.0
- [docs] Comment connected socket availability for adapters (#2081)
- [docs] Fixed grammar issues in the README.md (#2159)
- [feature] serve sourcemap for socket.io-client (#2482)
- [feature] Add a
local
flag (#2628) - [chore] Bump engine.io to version 1.8.1 (#2765)
- [chore] Update client location and serve minified file (#2766)
v1.6.0
- [fix] Make ETag header comply with standard. (#2603)
- [feature] Loading client script on demand. (#2567)
- [test] Fix leaking clientSocket (#2721)
- [feature] Add support for all event emitter methods (#2601)
- [chore] Update year to 2016 (#2456)
- [feature] Add support for socket middleware (#2306)
- [feature] add support for Server#close(callback) (#2748)
- [fix] Don't drop query variables on handshake (#2745)
- [example] Add disconnection/reconnection logs to the chat example (#2675)
- [perf] Minor code optimizations (#2219)
- [chore] Bump debug to version 2.3.3 (#2754)
- [chore] Bump engine.io to version 1.8.0 (#2755)
- [chore] Bump socket.io-adapter to version 0.5.0 (#2756)
v1.5.1
- [fix] Avoid swallowing exceptions thrown by user event handlers (#2682)
- [test] Use client function to unify
client
in test script (#2731) - [docs] Add link to LICENSE (#2221)
- [docs] Fix JSDoc of optional parameters (#2465)
- [docs] Fix typo (#2724)
- [docs] Link readme npm package badge to npm registry page (#2612)
- [docs] Minor fixes (#2526)
- [chore] Bump socket.io-parser to 2.3.0 (#2730)
- [chore] Add Github issue and PR templates (#2733)
- [chore] Bump engine.io to 1.7.2 (#2729)
- [chore] Bump socket.io-parser to 2.3.1 (#2734)
v1.5.0
- [feature] stop append /# before id when no namespace (#2509)
- [feature] Add a 'disconnecting' event to access to socket.rooms upon disconnection (#2332)
- [fix] Fix query string management (#2422)
- [fix] add quote to exec paths, prevent error when spaces in path (#2508)
- [docs] Prevent mixup for new programmers (#2599)
- [example] Fix chat display in Firefox (#2477)
- [chore] Add gulp & babel in the build process (#2471)
- [chore] Bump engine.io to 1.7.0 (#2707)
- [chore] Remove unused zuul-ngrok dependency (#2708)
- [chore] Point towards current master of socket.io-client (#2710)
- [chore] Restrict files included in npm package (#2709)
- [chore] Link build badge to master branch (#2549)
v1.4.8
v1.4.7
v1.4.6
v1.4.5
v1.4.4
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.3.7
v1.3.6
v1.3.5
v1.3.4
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.2.1
v1.2.0
v1.1.0
v1.0.6
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
Renovate configuration
-
If you want to rebase/retry this PR, check this box
This PR has been generated by WhiteSource Renovate. View repository job log here.