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: 4.4.1
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: 4.5.0
Choose a head ref
  • 17 commits
  • 51 files changed
  • 4 contributors

Commits on Jan 6, 2022

  1. chore: revert to lockfile v1

    Updating to v2 fails in the CI on Node.js 12 & 14 with the following
    error:
    
    > npm ERR! Error while executing:
    > npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/uNetworking/uWebSockets.js.git
    > npm ERR!
    > npm ERR! Warning: Permanently added the RSA host key for IP address '140.82.113.3' to the list of known hosts.
    > npm ERR! git@github.com: Permission denied (publickey).
    > npm ERR! fatal: Could not read from remote repository.
    > npm ERR!
    > npm ERR! Please make sure you have the correct access rights
    > npm ERR! and the repository exists.
    > npm ERR!
    > npm ERR! exited with error code: 128
    
    So we will revert the change for now.
    darrachequesne committed Jan 6, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    IvanGoncharov Ivan Goncharov
    Copy the full SHA
    aa5312a View commit details

Commits on Jan 10, 2022

  1. docs: remove broken badges

    Related: #4242
    darrachequesne committed Jan 10, 2022
    Copy the full SHA
    af54565 View commit details
  2. Copy the full SHA
    37b6d8f View commit details

Commits on Jan 25, 2022

  1. Copy the full SHA
    02c87a8 View commit details
  2. Copy the full SHA
    2f96438 View commit details

Commits on Mar 30, 2022

  1. Copy the full SHA
    0b7d70c View commit details

Commits on Mar 31, 2022

  1. feat: broadcast and expect multiple acks

    Syntax:
    
    ```js
    io.timeout(1000).emit("some-event", (err, responses) => {
      // ...
    });
    ```
    
    The adapter exposes two additional methods:
    
    - `broadcastWithAck(packets, opts, clientCountCallback, ack)`
    
    Similar to `broadcast(packets, opts)`, but:
    
    * `clientCountCallback()` is called with the number of clients that
      received the packet (can be called several times in a cluster)
    * `ack()` is called for each client response
    
    - `serverCount()`
    
    It returns the number of Socket.IO servers in the cluster (1 for the
    in-memory adapter).
    
    Those two methods will be implemented in the other adapters (Redis,
    Postgres, MongoDB, ...).
    
    Related:
    
    - #1811
    - #4163
    - socketio/socket.io-redis-adapter#445
    darrachequesne committed Mar 31, 2022
    Copy the full SHA
    8b20457 View commit details
  2. feat: add support for catch-all listeners for outgoing packets

    This is similar to `onAny()`, but for outgoing packets.
    
    Syntax:
    
    ```js
    socket.onAnyOutgoing((event, ...args) => {
      console.log(event);
    });
    ```
    darrachequesne committed Mar 31, 2022
    Copy the full SHA
    531104d View commit details
  3. refactor: make the protocol implementation stricter

    This commit handles several edge cases that were silently ignored
    before:
    
    - receiving several CONNECT packets during a session
    - receiving any packet without CONNECT packet first
    darrachequesne committed Mar 31, 2022
    Copy the full SHA
    0b35dc7 View commit details

Commits on Apr 1, 2022

  1. Copy the full SHA
    9f75868 View commit details

Commits on Apr 2, 2022

  1. Copy the full SHA
    d12aab2 View commit details

Commits on Apr 7, 2022

  1. Copy the full SHA
    be3d7f0 View commit details

Commits on Apr 20, 2022

  1. Copy the full SHA
    1f03a44 View commit details

Commits on Apr 22, 2022

  1. Copy the full SHA
    06e6838 View commit details
  2. Copy the full SHA
    6e1bb62 View commit details
  3. Copy the full SHA
    572133a View commit details

Commits on Apr 23, 2022

  1. chore(release): 4.5.0

    darrachequesne committed Apr 23, 2022
    Copy the full SHA
    8ecfcba View commit details
Showing with 2,268 additions and 953 deletions.
  1. +1 −1 .github/ISSUE_TEMPLATE/bug_report.md
  2. +46 −0 CHANGELOG.md
  3. +0 −2 Readme.md
  4. +2 −2 client-dist/socket.io.esm.min.js
  5. +1 −1 client-dist/socket.io.esm.min.js.map
  6. +891 −691 client-dist/socket.io.js
  7. +1 −1 client-dist/socket.io.js.map
  8. +2 −2 client-dist/socket.io.min.js
  9. +1 −1 client-dist/socket.io.min.js.map
  10. +2 −2 client-dist/socket.io.msgpack.min.js
  11. +1 −1 client-dist/socket.io.msgpack.min.js.map
  12. +7 −0 examples/basic-crud-application/README.md
  13. +1 −1 examples/basic-crud-application/angular-client/package.json
  14. +16 −0 examples/basic-crud-application/server-postgres-cluster/README.md
  15. +9 −0 examples/basic-crud-application/server-postgres-cluster/docker-compose.yml
  16. +26 −0 examples/basic-crud-application/server-postgres-cluster/lib/app.js
  17. +28 −0 examples/basic-crud-application/server-postgres-cluster/lib/cluster.js
  18. +51 −0 examples/basic-crud-application/server-postgres-cluster/lib/index.js
  19. +140 −0 examples/basic-crud-application/server-postgres-cluster/lib/todo-management/todo.handlers.js
  20. +74 −0 examples/basic-crud-application/server-postgres-cluster/lib/todo-management/todo.repository.js
  21. +22 −0 examples/basic-crud-application/server-postgres-cluster/lib/util.js
  22. +30 −0 examples/basic-crud-application/server-postgres-cluster/package.json
  23. +14 −1 examples/create-react-app-example/src/App.js
  24. +16 −0 examples/express-session-example/README.md
  25. BIN examples/express-session-example/assets/demo.gif
  26. +57 −0 examples/express-session-example/index.html
  27. +91 −0 examples/express-session-example/index.js
  28. +15 −0 examples/express-session-example/package.json
  29. +1 −0 examples/rollup-server-bundle/.gitignore
  30. +3 −0 examples/rollup-server-bundle/index.js
  31. +19 −0 examples/rollup-server-bundle/package.json
  32. +12 −0 examples/rollup-server-bundle/rollup.config.js
  33. +1 −10 examples/webpack-build/README.md
  34. +2 −3 examples/webpack-build/index.html
  35. +15 −0 examples/webpack-build/index.js
  36. +0 −12 examples/webpack-build/lib/index.js
  37. +5 −10 examples/webpack-build/package.json
  38. +0 −2 examples/webpack-build/support/noop.js
  39. +0 −8 examples/webpack-build/support/webpack.config.js
  40. +0 −33 examples/webpack-build/support/webpack.config.json-parser.js
  41. +0 −31 examples/webpack-build/support/webpack.config.slim.js
  42. +7 −0 examples/webpack-build/webpack.config.js
  43. +80 −6 lib/broadcast-operator.ts
  44. +25 −15 lib/client.ts
  45. +18 −1 lib/index.ts
  46. +17 −0 lib/namespace.ts
  47. +120 −10 lib/socket.ts
  48. +87 −100 package-lock.json
  49. +4 −4 package.json
  50. +306 −1 test/socket.io.ts
  51. +1 −1 test/support/util.ts
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
labels: 'to triage'
assignees: ''

---
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
# [4.5.0](https://github.com/socketio/socket.io/compare/4.4.1...4.5.0) (2022-04-23)


### Bug Fixes

* **typings:** ensure compatibility with TypeScript 3.x ([#4259](https://github.com/socketio/socket.io/issues/4259)) ([02c87a8](https://github.com/socketio/socket.io/commit/02c87a85614e217b8e7b93753f315790ae9d99f6))


### Features

* add support for catch-all listeners for outgoing packets ([531104d](https://github.com/socketio/socket.io/commit/531104d332690138b7aab84d5583d6204132c8b4))

This is similar to `onAny()`, but for outgoing packets.

Syntax:

```js
socket.onAnyOutgoing((event, ...args) => {
console.log(event);
});
```

* broadcast and expect multiple acks ([8b20457](https://github.com/socketio/socket.io/commit/8b204570a94979bbec307f23ca078f30f5cf07b0))

Syntax:

```js
io.timeout(1000).emit("some-event", (err, responses) => {
// ...
});
```

* add the "maxPayload" field in the handshake details ([088dcb4](https://github.com/socketio/engine.io/commit/088dcb4dff60df39785df13d0a33d3ceaa1dff38))

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}
```



## [4.4.1](https://github.com/socketio/socket.io/compare/4.4.0...4.4.1) (2022-01-06)


2 changes: 0 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@
[![Run on Repl.it](https://repl.it/badge/github/socketio/socket.io)](https://replit.com/@socketio/socketio-minimal-example)
[![Backers on Open Collective](https://opencollective.com/socketio/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/socketio/sponsors/badge.svg)](#sponsors)
[![Build Status](https://github.com/socketio/socket.io/workflows/CI/badge.svg)](https://github.com/socketio/socket.io/actions)
[![Dependency Status](https://david-dm.org/socketio/socket.io.svg)](https://david-dm.org/socketio/socket.io)
[![devDependency Status](https://david-dm.org/socketio/socket.io/dev-status.svg)](https://david-dm.org/socketio/socket.io#info=devDependencies)
[![NPM version](https://badge.fury.io/js/socket.io.svg)](https://www.npmjs.com/package/socket.io)
![Downloads](https://img.shields.io/npm/dm/socket.io.svg?style=flat)
[![](https://slackin-socketio.now.sh/badge.svg)](https://slackin-socketio.now.sh)
Loading