Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: socketio/socket.io
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.2.0
Choose a base ref
...
head repository: socketio/socket.io
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.5.0
Choose a head ref
  • 19 commits
  • 15 files changed
  • 5 contributors

Commits on Mar 15, 2019

  1. [chore] Update the license of the chat example (#3410)

    There was no obvious reason to use BSD instead of MIT for that very basic chat app.
    
    Closes #3411
    grant authored and darrachequesne committed Mar 15, 2019
    Configuration menu
    Copy the full SHA
    9c1e73c View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2019

  1. Configuration menu
    Copy the full SHA
    1150eb5 View commit details
    Browse the repository at this point in the history
  2. [docs] Fix the default value of the 'origins' parameter (#3464)

    Fix documentation about default origins value. The default should read `*:*` instead of `*
    JonaMX authored and darrachequesne committed Sep 20, 2019
    Configuration menu
    Copy the full SHA
    8227192 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4d01b2c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cf39362 View commit details
    Browse the repository at this point in the history
  5. [chore] Release 2.3.0

    darrachequesne committed Sep 20, 2019
    Configuration menu
    Copy the full SHA
    47161a6 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2021

  1. ci: migrate to GitHub Actions

    Due to the recent changes to the Travis CI platform (see [1]), we will
    now use GitHub Actions to run the tests.
    
    Reference: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-nodejs
    
    [1]: https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
    darrachequesne committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    6fa026f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3951a79 View commit details
    Browse the repository at this point in the history
  3. fix: properly overwrite the query sent in the handshake

    The `query` option of the Manager had the priority over the one of the
    Socket instance, which meant updating the Socket#query object on the
    client-side was not reflected in the Socket#handshake object on the
    server-side.
    
    Please note that the behavior of the `query` option is still a bit
    weird in Socket.IO v2, as it only applies to non-default namespace.
    This is fixed in v3:
    
    - https://socket.io/docs/v3/migrating-from-2-x-to-3-0/#Add-a-clear-distinction-between-the-Manager-query-option-and-the-Socket-query-option
    - https://socket.io/docs/v3/middlewares/#Sending-credentials
    
    Fixes #3495
    sebamarynissen authored and darrachequesne committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    d33a619 View commit details
    Browse the repository at this point in the history
  4. fix(security): do not allow all origins by default

    BREAKING CHANGE: previously, all origins were allowed by default, which
    meant that a Socket.IO server sent the necessary CORS headers
    (`Access-Control-Allow-xxx`) to any domain by default.
    
    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):
    
    ```js
    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 https://github.com/ni8walk3r for the security report.
    darrachequesne committed Jan 4, 2021
    1 Configuration menu
    Copy the full SHA
    f78a575 View commit details
    Browse the repository at this point in the history
  5. chore(release): 2.4.0

    darrachequesne committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    873fdc5 View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2021

  1. revert: fix(security): do not allow all origins by default

    This reverts commit f78a575.
    
    This commit contains a breaking change which deviates from semver,
    which we try to follow as closely as possible. That's why this change
    is reverted and we will rather suggest users to upgrade to v3.
    
    Related: #3741
    darrachequesne committed Jan 7, 2021
    Configuration menu
    Copy the full SHA
    a169050 View commit details
    Browse the repository at this point in the history
  2. chore(release): 2.4.1

    darrachequesne committed Jan 7, 2021
    Configuration menu
    Copy the full SHA
    e6b8697 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2022

  1. Configuration menu
    Copy the full SHA
    dfded53 View commit details
    Browse the repository at this point in the history
  2. fix: ignore packet received after disconnection

    Related: #3095
    
    Backported from 494c64e
    darrachequesne committed Jun 26, 2022
    Configuration menu
    Copy the full SHA
    22d4bdf View commit details
    Browse the repository at this point in the history
  3. fix: fix race condition in dynamic namespaces

    Using an async operation with `io.use()` could lead to the creation of
    several instances of a same namespace, each of them overriding the
    previous one.
    
    Example:
    
    ```js
    io.use(async (nsp, auth, next) => {
      await anOperationThatTakesSomeTime();
      next();
    });
    ```
    
    Related: #4136
    
    Backported from 9d86397
    darrachequesne committed Jun 26, 2022
    Configuration menu
    Copy the full SHA
    05e1278 View commit details
    Browse the repository at this point in the history
  4. fix: only set 'connected' to true after middleware execution

    The Socket instance is only considered connected when the "connection"
    event is emitted, and not during the middleware(s) execution.
    
    ```js
    io.use((socket, next) => {
      console.log(socket.connected); // prints "false"
      next();
    });
    
    io.on("connection", (socket) => {
      console.log(socket.connected); // prints "true"
    });
    ```
    
    Related: #4129
    
    Backported from 02b0f73
    darrachequesne committed Jun 26, 2022
    Configuration menu
    Copy the full SHA
    226cc16 View commit details
    Browse the repository at this point in the history
  5. fix: prevent the socket from joining a room after disconnection

    Calling `socket.join()` after disconnection would lead to a memory
    leak, because the room was never removed from the memory:
    
    ```js
    io.on("connection", (socket) => {
      socket.disconnect();
      socket.join("room1"); // leak
    });
    ```
    
    Related:
    
    - #4067
    - #4380
    
    Backported from 18f3fda
    darrachequesne committed Jun 26, 2022
    Configuration menu
    Copy the full SHA
    f223178 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    baa6804 View commit details
    Browse the repository at this point in the history
Loading