Commit Graph

7586 Commits

Author SHA1 Message Date
BCCSTeam
df8e70f798 fix: return the first response when broadcasting to a single socket (#4878) 2024-01-02 17:43:10 +01:00
Damien Arrachequesne
f9c16f2265 fix(typings): fix the type of the socket#id attribute
Related: https://github.com/socketio/socket.io/issues/4884
2024-01-02 15:55:56 +01:00
Damien Arrachequesne
b3f0cab1a0 ci: add Node.js 20 in the test matrix
Reference: https://github.com/nodejs/Release
2023-11-24 08:48:19 +01:00
Damien Arrachequesne
5a3eafed1c fix(typings): accept string | undefined as init argument
Related: https://github.com/socketio/socket.io/issues/4873
2023-11-24 08:48:08 +01:00
Xì Gà
8c9ebc30e5 fix(typings): allow to bind to a non-secure Http2Server (#4853) 2023-11-22 17:48:59 +01:00
Damien Arrachequesne
efb5c21e85 docs(examples): add Vue client with CRUD example 2023-11-22 10:12:17 +01:00
Damien Arrachequesne
3848280125 docs(examples): upgrade basic-crud-application to Angular v17
Related: https://github.com/socketio/socket.io/issues/4875
2023-11-21 14:15:50 +01:00
dependabot[bot]
23213858c6 chore: bump browserify-sign from 4.2.1 to 4.2.2 (#138)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2.
- [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: browserify-sign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-10 18:12:46 +01:00
Damien Arrachequesne
ff0fbfb61f chore(release): 6.5.4
Diff: https://github.com/socketio/engine.io/compare/6.5.3...6.5.4
2023-11-09 18:07:45 +01:00
Damien Arrachequesne
09acb177a6 ci: add Node.js 20 in the test matrix
Reference: https://github.com/nodejs/Release
2023-11-09 18:04:07 +01:00
Damien Arrachequesne
fa47916425 chore(release): 6.5.3
Diff: https://github.com/socketio/engine.io-client/compare/6.5.2...6.5.3
2023-11-09 16:28:04 +01:00
Damien Arrachequesne
ef9ad7d1d6 ci: add Node.js 20 in the test matrix
Reference: https://github.com/nodejs/Release
2023-11-09 16:16:41 +01:00
Damien Arrachequesne
707597df26 fix: add a maximum length for the URL
The regular expression used to parse the URL provided by the user has a
time complexity of O(n^2), hence the length limitation.

Please note that this does not seem realistically exploitable, as an
attacker would have to be able to provide a malicious URL to the user
and inject it in the Engine.IO client.

We could also have:

- modified the regex, but there are a lot of edge cases and the current test coverage is probably not sufficient
- use the built-in URL object, but we would have to add a polyfill for old platforms like IE

Thanks to Young-jin Hwang from the Soonchunhyang University for the
responsible disclosure.
2023-11-09 15:35:57 +01:00
dependabot[bot]
8d86e0d892 chore: bump browserify-sign from 4.2.1 to 4.2.2 (#713)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2.
- [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: browserify-sign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-09 15:19:00 +01:00
dependabot[bot]
f2aca29494 chore: bump @babel/traverse from 7.12.9 to 7.23.2 (#712)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.12.9 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-09 15:18:47 +01:00
Damien Arrachequesne
39937f8f4d refactor: minor cleanups 2023-11-09 12:18:55 +01:00
Damien Arrachequesne
43c1c1c1e2 refactor: simplify code 2023-11-09 12:13:15 +01:00
Damien Arrachequesne
3b5e79ef79 refactor: remove useless references
Those timers are only used during the upgrade, so there is no need to
keep those references in memory.
2023-11-09 12:05:38 +01:00
Damien Arrachequesne
f27a6c3501 refactor: remove useless reference
A reference to the initial IncomingMessage object (the first HTTP
request of the session) is kept in memory by default (`socket.request`),
so its attached ServerResponse object (`req.res`) would not be
garbage-collected. This will now be the case.

Note: the IncomingMessage object is needed in two cases:

- when working with the `express-session` middleware (`request.session`)
- when fetching the certificate of the client with `request.socket.getPeerCertificate()`

That's why removing it would be a breaking change.
2023-11-09 11:45:43 +01:00
Tyler Butler
605de78d2c fix: improve compatibility with node16 module resolution (#1595)
Related:

- https://github.com/microsoft/TypeScript/issues/46770#issuecomment-966612103
- https://github.com/socketio/socket.io-client/issues/1589
2023-11-06 23:34:58 +01:00
James Baldassari
c1795ef568 refactor: export TransportError (#709) 2023-11-06 23:20:46 +01:00
Tyler Butler
46ef8512ed fix: improve compatibility with node16 module resolution (#711)
Related:

- https://github.com/microsoft/TypeScript/issues/46770#issuecomment-966612103
- https://github.com/socketio/socket.io-client/issues/1589
2023-11-06 23:18:25 +01:00
dependabot[bot]
b96f0cb45a chore: bump @babel/traverse from 7.9.5 to 7.23.2 (#137)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.9.5 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-23 22:19:35 +02:00
Damien Arrachequesne
9f76ea22b4 ci: bump appiumVersion for Android tests in SauceLabs
> Error: Appium 1.22.1 does not support Android latest.
2023-10-23 22:18:28 +02:00
dependabot[bot]
9228596240 chore: bump @babel/traverse from 7.9.6 to 7.23.2 (#126)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.9.6 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-23 22:17:11 +02:00
Damien Arrachequesne
d00ccd253d ci: bump appiumVersion for Android tests in SauceLabs
> Error: Appium 1.22.1 does not support Android latest.
2023-10-23 11:54:38 +02:00
Damien Arrachequesne
9a2a83fdd4 refactor: cleanup after merge 2023-10-11 10:45:59 +02:00
Zachary Haber
f6ef267b03 refactor(typings): improve emit types (#4817)
This commit fixes several issues with emit types:

- calling `emit()` without calling `timeout()` first is now only available for events without acknowledgement
- calling `emit()` after calling `timeout()` is now only available for events with an acknowledgement
- calling `emitWithAck()` is now only available for events with an acknowledgement
- `timeout()` must be called before calling `emitWithAck()`
2023-10-11 10:37:13 +02:00
Maxime Kjaer
1cdf36bfea test: build examples in the CI (#3856) 2023-10-10 20:02:52 +02:00
Toha
bbf1fdc7a6 docs: add Elephant.IO as PHP client library (#4779) 2023-10-10 17:32:19 +02:00
Damien Arrachequesne
2da559a8fa chore(release): 6.5.3
Diff: https://github.com/socketio/engine.io/compare/6.5.2...6.5.3
2023-10-06 10:20:34 +02:00
Damien Arrachequesne
9545b44b3c refactor: add cache-control header in the polling response
This header should not be needed since the client already includes a
cache busting query parameter ("t"), but a misconfigured CDN could
ignore the query parameters and cache the server response.

Related: https://github.com/socketio/socket.io/issues/4842
2023-10-05 17:19:08 +02:00
Damien Arrachequesne
ff1c861548 fix(webtransport): properly handle abruptly closed connections
Refreshing the page with a client connected with WebTransport would
trigger the following exception:

> node:internal/process/promises:288
>            triggerUncaughtException(err, true /* fromPromise */);
>            ^
>
> [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "0".] {
>   code: 'ERR_UNHANDLED_REJECTION'
> }

Related: https://github.com/socketio/engine.io/issues/688
2023-10-05 16:57:33 +02:00
Damien Arrachequesne
b4dc83eb9b docs(examples): add codesandbox configuration 2023-09-20 12:57:37 +02:00
Damien Arrachequesne
ccbb4c0773 docs: add example with connection state recovery 2023-09-20 12:45:04 +02:00
Théodore Prévot
4f633dd6a4 docs: add test should close the connection if no handshake is received (#31) 2023-09-19 17:15:55 +02:00
Damien Arrachequesne
d744fda772 docs: improve example with express-session
The example is now available with different syntaxes:

- CommonJS
- ES modules
- TypeScript

Related: https://github.com/socketio/socket.io/pull/4787
2023-09-13 15:56:15 +02:00
Damien Arrachequesne
8259cdac84 docs: use io.engine.use() with express-session
Related: https://github.com/socketio/socket.io/discussions/4819
2023-09-13 12:13:03 +02:00
Damien Arrachequesne
3dcb88cb31 docs: add note about the agent option
Related: https://github.com/socketio/engine.io-client/pull/708
2023-09-13 11:58:29 +02:00
Avi Vahl
c6bf8c0f57 fix: improve compatibility with node16 module resolution (#689)
Related: https://github.com/microsoft/TypeScript/issues/46770#issuecomment-966612103
2023-08-17 07:59:32 +02:00
Damien Arrachequesne
fd9dd74eee docs: use "connection" instead of "connect"
"connect" and "connection" have the same meaning, but "connection" is
the preferred version.
2023-08-12 10:10:55 +02:00
Damien Arrachequesne
9efa1d0aec test: add more stream decoding tests 2023-08-05 00:34:20 +02:00
Damien Arrachequesne
c332643ad8 chore(release): 4.7.2
Diff: https://github.com/socketio/socket.io/compare/4.7.1...4.7.2
4.7.2
2023-08-03 01:51:04 +02:00
Damien Arrachequesne
3468a197af fix(webtransport): properly handle WebTransport-only connections
A WebTransport-only connection has no `request` attribute, so we need
to handle that case.
2023-08-03 01:45:21 +02:00
Damien Arrachequesne
928d76d255 chore(release): 4.7.2
Diff: https://github.com/socketio/socket.io-client/compare/4.7.1...4.7.2
2023-08-03 01:40:17 +02:00
Damien Arrachequesne
09d45491c4 chore: bump engine.io to version 6.5.2
Diff: https://github.com/socketio/engine.io/compare/6.5.0...6.5.2
Release notes: https://github.com/socketio/engine.io/releases/tag/6.5.2
2023-08-03 00:39:46 +02:00
Damien Arrachequesne
74ca7ac0c7 chore: bump engine.io-client to version 6.5.2
Diff: https://github.com/socketio/engine.io-client/compare/6.5.1...6.5.2
Release notes: https://github.com/socketio/engine.io-client/releases/tag/6.5.2
2023-08-03 00:30:57 +02:00
Damien Arrachequesne
12ca32b534 chore(release): 6.5.2
Diff: https://github.com/socketio/engine.io/compare/6.5.1...6.5.2
2023-08-02 02:00:02 +02:00
Damien Arrachequesne
10970563bf chore(release): 6.5.2
Diff: https://github.com/socketio/engine.io-client/compare/6.5.1...6.5.2
2023-08-02 01:57:14 +02:00
Chris Dewbery
ed34a45a07 refactor: reset ping timeout on any incoming packet (#706)
The client will now match the behavior of the server.

See also: be7b4e7478
2023-08-02 01:53:29 +02:00