-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Comparing changes
Open a pull request
base repository: socketio/socket.io
base: 2.5.0
head repository: socketio/socket.io
compare: 3.0.0
Commits on Apr 14, 2020
-
Configuration menu - View commit details
-
Copy full SHA for b74bb80 - Browse repository at this point
Copy the full SHA b74bb80View commit details -
Configuration menu - View commit details
-
Copy full SHA for edb95ea - Browse repository at this point
Copy the full SHA edb95eaView commit details -
1
Configuration menu - View commit details
-
Copy full SHA for 281de9e - Browse repository at this point
Copy the full SHA 281de9eView commit details
Commits on Apr 17, 2020
-
docs(chat-example): bump dependencies
In order to include https://github.com/socketio/engine.io/releases/tag/3.4.1
Configuration menu - View commit details
-
Copy full SHA for 17747e4 - Browse repository at this point
Copy the full SHA 17747e4View commit details -
docs(examples): bump dependencies
In order to include https://github.com/socketio/engine.io/releases/tag/3.4.1
Configuration menu - View commit details
-
Copy full SHA for 2a1aa1c - Browse repository at this point
Copy the full SHA 2a1aa1cView commit details
Commits on May 22, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 8f90ba9 - Browse repository at this point
Copy the full SHA 8f90ba9View commit details
Commits on Jun 4, 2020
-
docs(examples/webpack-build-server): update engine.io version
In order to include [0], which fixes the following error: ERROR in ./node_modules/engine.io/lib/server.js Module not found: Error: Can't resolve 'uws' in '/media/damien/git/other-bets/socket.io-parent/socket.io/examples/webpack-build-server/node_modules/engine.io/lib' @ ./node_modules/engine.io/lib/server.js 107:27-41 @ ./node_modules/engine.io/lib/engine.io.js @ ./node_modules/socket.io/lib/index.js @ ./lib/index.js [0] socketio/engine.io@85e544a
Configuration menu - View commit details
-
Copy full SHA for 5d16319 - Browse repository at this point
Copy the full SHA 5d16319View commit details
Commits on Jun 5, 2020
-
docs(examples/react-native): add example with React Native
Includes socketio/engine.io-client@e5bc106
Configuration menu - View commit details
-
Copy full SHA for 7a219f9 - Browse repository at this point
Copy the full SHA 7a219f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for f5a8f52 - Browse repository at this point
Copy the full SHA f5a8f52View commit details
Commits on Jul 9, 2020
-
Configuration menu - View commit details
-
Copy full SHA for a66f083 - Browse repository at this point
Copy the full SHA a66f083View commit details
Commits on Sep 1, 2020
-
docs: points towards the website
The website is now much more stable, so there's no need to keep two copies of the same content (which must be manually kept in sync).
Configuration menu - View commit details
-
Copy full SHA for e0b35d0 - Browse repository at this point
Copy the full SHA e0b35d0View commit details
Commits on Sep 17, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 1238ddb - Browse repository at this point
Copy the full SHA 1238ddbView commit details -
test: add Node.js 12 and 14 in the build matrix
Node.js 8 is removed, as it is now EOL. Note: the node_modules folder is cached by default
Configuration menu - View commit details
-
Copy full SHA for d9bfcae - Browse repository at this point
Copy the full SHA d9bfcaeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 13cc07d - Browse repository at this point
Copy the full SHA 13cc07dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d760b7 - Browse repository at this point
Copy the full SHA 3d760b7View commit details
Commits on Sep 19, 2020
-
Configuration menu - View commit details
-
Copy full SHA for af165ae - Browse repository at this point
Copy the full SHA af165aeView commit details
Commits on Sep 25, 2020
-
Configuration menu - View commit details
-
Copy full SHA for a5581a9 - Browse repository at this point
Copy the full SHA a5581a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2464de7 - Browse repository at this point
Copy the full SHA 2464de7View commit details -
Breaking changes: - Namespace#connected is now a Map instead of an object. - Namespace#clients() is renamed to Namespace#allSockets() and now returns a Promise Diff: socketio/socket.io-adapter@1.1.2...2.0.0
Configuration menu - View commit details
-
Copy full SHA for 84437dc - Browse repository at this point
Copy the full SHA 84437dcView commit details -
feat: remove Socket#rooms object
The value stored in the adapter will now be used, instead of duplicating it in the Socket class. Breaking change: Socket#rooms is now a Set instead of an object Closes #2890
Configuration menu - View commit details
-
Copy full SHA for 1507b41 - Browse repository at this point
Copy the full SHA 1507b41View commit details -
refactor: use ES6 Maps instead of plain objects
These attributes were not part of the public API, so there's no breaking change.
Configuration menu - View commit details
-
Copy full SHA for 424a473 - Browse repository at this point
Copy the full SHA 424a473View commit details -
feat: remove Server#set() method
This method was kept for backward-compatibility with pre-1.0 versions.
Configuration menu - View commit details
-
Copy full SHA for 029f478 - Browse repository at this point
Copy the full SHA 029f478View commit details
Commits on Sep 28, 2020
-
Breaking change: - the encode() method is now synchronous Please note that the exchange [protocol][1] is left untouched and thus stays in version 4. Diff: socketio/socket.io-parser@3.4.1...4.0.0 [1] https://github.com/socketio/socket.io-protocol
Configuration menu - View commit details
-
Copy full SHA for 1108ede - Browse repository at this point
Copy the full SHA 1108edeView commit details
Commits on Sep 29, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 0540c36 - Browse repository at this point
Copy the full SHA 0540c36View commit details
Commits on Oct 4, 2020
-
Configuration menu - View commit details
-
Copy full SHA for bb43ff2 - Browse repository at this point
Copy the full SHA bb43ff2View commit details
Commits on Oct 13, 2020
-
chore: point towards the develop branch of the client
The package-lock.json file is temporarily removed in order to include the latest commits to the client and make the tests pass.
Configuration menu - View commit details
-
Copy full SHA for 4396bd0 - Browse repository at this point
Copy the full SHA 4396bd0View commit details -
Release notes: https://github.com/socketio/engine.io/releases/tag/4.0.0
Configuration menu - View commit details
-
Copy full SHA for 64bd9fb - Browse repository at this point
Copy the full SHA 64bd9fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a51c76 - Browse repository at this point
Copy the full SHA 7a51c76View commit details -
feat: remove the implicit connection to the default namespace
In previous versions, a client was always connected to the default namespace, even if it requested access to another namespace. This meant that the middlewares registered for the default namespace were triggered in any case, which is a surprising behavior for end users. This also meant that the query option of the Socket on the client-side was not sent in the Socket.IO CONNECT packet for the default namespace: ```js // default namespace: query sent in the query params const socket = io({ query: { abc: "def" } }); // another namespace: query sent in the query params + the CONNECT packet const socket = io("/admin", { query: { abc: "def" } }); ``` The client will now send a CONNECT packet in any case, and the query option of the Socket is renamed to "auth", in order to make a clear distinction with the query option of the Manager (included in the query parameters of the HTTP requests). ```js // server-side io.use((socket, next) => { // not triggered anymore }); io.of("/admin").use((socket, next => { // triggered console.log(socket.handshake.query.abc); // "def" console.log(socket.handshake.auth.abc); // "123" }); // client-side const socket = io("/admin", { query: { abc: "def" }, auth: { abc: "123" } }); ```
Configuration menu - View commit details
-
Copy full SHA for 3289f7e - Browse repository at this point
Copy the full SHA 3289f7eView commit details -
feat: do not reuse the Engine.IO id
In previous versions, the Socket#id attribute was equal (or derived, for a non-default namespace) to the underlying Engine.IO id, which is used as a mean to authenticate the user throughout the Engine.IO session and thus is sensitive information that should be kept secret. The problem with reusing the Engine.IO id is that users could be tempted to transmit this id to other clients, in order to implement private messaging for example. So we'll now generate a new random id for each new socket. Please note that this id will now be different from the one found in the query parameters of the HTTP requests.
Configuration menu - View commit details
-
Copy full SHA for 2875d2c - Browse repository at this point
Copy the full SHA 2875d2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 83a2356 - Browse repository at this point
Copy the full SHA 83a2356View commit details -
Both CommonJS and ES6 import are now supported: - with `{ "type": "commonjs" }` in the package.json file ```js const io = require("socket.io")(8080); // or const { Server } = require("socket.io"); const io = new Server(8080); ``` - with `{ "type": "module" }` ```js import { Server } from "socket.io"; const io = new Server(8080); ``` Related: https://nodejs.org/api/packages.html#packages_dual_commonjs_es_module_packages
Configuration menu - View commit details
-
Copy full SHA for 8b6b100 - Browse repository at this point
Copy the full SHA 8b6b100View commit details -
feat: remove the 'origins' option
The underlying Engine.IO server now supports a 'cors' option, which will be forwarded to the cors module. Breaking change: the 'origins' option is removed Before: ```js 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: ```js new Server(3000, { cors: { origin: "https://example.com", methods: ["GET", "POST"], allowedHeaders: ["content-type"] } }); ``` The already existing 'allowRequest' option can be used for validation: ```js new Server(3000, { allowRequest: (req, callback) => { callback(null, req.headers.referer.startsWith("https://example.com")); } }); ```
Configuration menu - View commit details
-
Copy full SHA for a8c0600 - Browse repository at this point
Copy the full SHA a8c0600View commit details -
feat: throw upon reserved event names
These events cannot be used by the end users, because they are part of the Socket.IO public API, so using them will now throw an error explicitly.
Configuration menu - View commit details
-
Copy full SHA for 4bd5b23 - Browse repository at this point
Copy the full SHA 4bd5b23View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c7a48d - Browse repository at this point
Copy the full SHA 9c7a48dView commit details -
Configuration menu - View commit details
-
Copy full SHA for c0d171f - Browse repository at this point
Copy the full SHA c0d171fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ebb0575 - Browse repository at this point
Copy the full SHA ebb0575View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d2a31e - Browse repository at this point
Copy the full SHA 2d2a31eView commit details
Commits on Oct 15, 2020
-
feat: move binary detection back to the parser
See socketio/socket.io-parser@285e7cd Breaking change: the Socket#binary() method is removed, as this use case is now covered by the ability to provide your own parser.
Configuration menu - View commit details
-
Copy full SHA for 669592d - Browse repository at this point
Copy the full SHA 669592dView commit details -
refactor: hide internal methods and properties
There is no concept of package-private methods in TypeScript, so we'll just prefix them with "_" and mark them as private in the JSDoc.
Configuration menu - View commit details
-
Copy full SHA for 58b66f8 - Browse repository at this point
Copy the full SHA 58b66f8View commit details -
fix: close clients with no namespace
After a given timeout, a client that did not join any namespace will be closed in order to prevent malicious clients from using the server resources. The timeout defaults to 45 seconds, in order not to interfere with the Engine.IO heartbeat mechanism (30 seconds).
Configuration menu - View commit details
-
Copy full SHA for 91cd255 - Browse repository at this point
Copy the full SHA 91cd255View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a05042 - Browse repository at this point
Copy the full SHA 2a05042View commit details -
refactor: remove duplicate _sockets map
Both the "connected" and the "_sockets" maps were used to track the Socket instances in the namespace. Let's merge them into "sockets". It's a breaking change, but: - the "sockets" object did already exist in Socket.IO v2 (and appears in some examples/tutorials) - "sockets" makes more sense than "connected" in my opinion - there was already a breaking change regarding the "connected" property (from object to Map) Breaking change: the "connected" map is renamed to "sockets"
Configuration menu - View commit details
-
Copy full SHA for 8a5db7f - Browse repository at this point
Copy the full SHA 8a5db7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ce5b4c - Browse repository at this point
Copy the full SHA 0ce5b4cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 20ea6bd - Browse repository at this point
Copy the full SHA 20ea6bdView commit details -
docs(examples): add example with TypeScript
There are two issues with the typings: - on the client-side, the Emitter class is not properly imported (hence the @ts-ignore) - on the server-side, the Socket class is not exported (in order to cast it in the "connect" event)
Configuration menu - View commit details
-
Copy full SHA for a81b9f3 - Browse repository at this point
Copy the full SHA a81b9f3View commit details
Commits on Oct 17, 2020
-
feat: remove prod dependency to socket.io-client
The client bundles are included in the repository in order to remove socket.io-client from the list of production dependencies and thus to reduce the total number of dependencies when installing the server. This means the release of the client and the server must now be in sync (which is almost always the case actually). The minified build is now served: - /<path>/socket.io.js - /<path>/socket.io.js.map - /<path>/socket.io.min.js - /<path>/socket.io.min.js.map The content will now be compressed as well.
Configuration menu - View commit details
-
Copy full SHA for 7603da7 - Browse repository at this point
Copy the full SHA 7603da7View commit details -
refactor(typings): export Socket class
In order to be able to cast it on the argument of the "connect" event: ```js import { Socket } from "socket.io"; io.on("connect", (socket: Socket) => { // ... }); ```
Configuration menu - View commit details
-
Copy full SHA for 0d74f29 - Browse repository at this point
Copy the full SHA 0d74f29View commit details
Commits on Oct 21, 2020
-
feat: make Socket#join() and Socket#leave() synchronous
Depending on the adapter, Socket#join() may return: - nothing (in-memory and Redis adapters) - a promise (custom adapters) Breaking change: Socket#join() and Socket#leave() do not accept a callback argument anymore. Before: ```js 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 ``` Note: the need for an asynchronous method came from the Redis adapter, which did override the Adapter#add() method in earlier versions, but this is not the case anymore. Reference: - https://github.com/socketio/socket.io/blob/2.3.0/lib/socket.js#L236-L258 - https://github.com/socketio/socket.io-adapter/blob/1.1.2/index.js#L56-L65 - socketio/socket.io-redis-adapter@05f926e Related: #3662
Configuration menu - View commit details
-
Copy full SHA for 129c641 - Browse repository at this point
Copy the full SHA 129c641View commit details
Commits on Oct 25, 2020
-
feat: add support for catch-all listeners
Inspired from EventEmitter2 [1] ```js io.on("connect", socket => { socket.onAny((event, ...args) => {}); socket.prependAny((event, ...args) => {}); socket.offAny(); // remove all listeners socket.offAny(listener); const listeners = socket.listenersAny(); }); ``` Breaking change: the socket.use() method is removed This method was introduced in [2] for the same feature (having a catch-all listener), but there were two issues: - the API is not very user-friendly, since the user has to know the structure of the packet argument - it uses an ERROR packet, which is reserved for Namespace authentication issues (see [3]) [1]: https://github.com/EventEmitter2/EventEmitter2 [2]: #434 [3]: https://github.com/socketio/socket.io-protocol
2Configuration menu - View commit details
-
Copy full SHA for 5c73733 - Browse repository at this point
Copy the full SHA 5c73733View commit details
There are no files selected for viewing