Compare commits

...

4 Commits

25 changed files with 7033 additions and 5990 deletions

View File

@@ -7,6 +7,8 @@ on:
- 'packages/engine.io-client/**'
- 'packages/socket.io-parser/**'
- 'packages/socket.io-client/**'
tags-ignore:
- '**@*'
permissions:
contents: read

View File

@@ -2,6 +2,8 @@ name: CI
on:
push:
tags-ignore:
- '**@*'
pull_request:
schedule:
- cron: '0 0 * * 0'

6
package-lock.json generated
View File

@@ -15162,7 +15162,7 @@
}
},
"packages/engine.io": {
"version": "6.6.0",
"version": "6.6.1",
"license": "MIT",
"dependencies": {
"@types/cookie": "^0.4.1",
@@ -15181,7 +15181,7 @@
}
},
"packages/engine.io-client": {
"version": "6.6.0",
"version": "6.6.1",
"license": "MIT",
"dependencies": {
"@socket.io/component-emitter": "~3.1.0",
@@ -15252,7 +15252,7 @@
"dependencies": {
"@socket.io/component-emitter": "~3.1.0",
"debug": "~4.3.2",
"engine.io-client": "~6.6.0",
"engine.io-client": "~6.6.1",
"socket.io-parser": "~4.2.4"
},
"engines": {

View File

@@ -2,6 +2,7 @@
| Version | Release date |
|------------------------------------------------------------------------------------------------------|----------------|
| [6.6.1](#661-2024-09-21) | September 2024 |
| [6.6.0](#660-2024-06-21) | June 2024 |
| [6.5.5](#655-2024-06-18) (from the [6.5.x](https://github.com/socketio/engine.io/tree/6.5.x) branch) | June 2024 |
| [3.6.2](#362-2024-06-18) (from the [3.x](https://github.com/socketio/engine.io/tree/3.x) branch) | June 2024 |
@@ -45,6 +46,21 @@
# Release notes
## [6.6.1](https://github.com/socketio/socket.io/compare/engine.io@6.6.0...engine.io@6.6.1) (2024-09-21)
### Bug Fixes
* discard all pending packets when the server is closed ([923a12e](https://github.com/socketio/socket.io/commit/923a12e2de83ecaa75746a575e71a4739815d5c5))
* **uws:** prevent the client from upgrading twice ([d5095fe](https://github.com/socketio/socket.io/commit/d5095fe98c3976673c19f433c0114d06dbd8de1b))
### Dependencies
- [`ws@~8.17.1`](https://github.com/websockets/ws/releases/tag/8.17.1) (no change)
## [6.6.0](https://github.com/socketio/engine.io/compare/6.5.4...6.6.0) (2024-06-21)

View File

@@ -1,6 +1,6 @@
{
"name": "engine.io",
"version": "6.6.0",
"version": "6.6.1",
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server",
"type": "commonjs",
"main": "./build/engine.io.js",

View File

@@ -2,6 +2,7 @@
| Version | Release date | Bundle size (UMD min+gzip) |
|-------------------------------------------------------------------------------------------------------------|----------------|----------------------------|
| [4.8.0](#480-2024-09-21) | September 2024 | `14.4 KB` |
| [4.7.5](#475-2024-03-14) | March 2024 | `14.6 KB` |
| [4.7.4](#474-2024-01-12) | January 2024 | `14.5 KB` |
| [4.7.3](#473-2024-01-03) | January 2024 | `14.5 KB` |
@@ -50,6 +51,88 @@
# Release notes
# [4.8.0](https://github.com/socketio/socket.io/compare/socket.io-client@4.7.5...socket.io-client@4.8.0) (2024-09-21)
### Features
#### Custom transport implementations
The `transports` option now accepts an array of transport implementations:
```js
import { io } from "socket.io-client";
import { XHR, WebSocket } from "engine.io-client";
const socket = io({
transports: [XHR, WebSocket]
});
```
Here is the list of provided implementations:
| Transport | Description |
|-----------------|------------------------------------------------------------------------------------------------------|
| `Fetch` | HTTP long-polling based on the built-in `fetch()` method. |
| `NodeXHR` | HTTP long-polling based on the `XMLHttpRequest` object provided by the `xmlhttprequest-ssl` package. |
| `XHR` | HTTP long-polling based on the built-in `XMLHttpRequest` object. |
| `NodeWebSocket` | WebSocket transport based on the `WebSocket` object provided by the `ws` package. |
| `WebSocket` | WebSocket transport based on the built-in `WebSocket` object. |
| `WebTransport` | WebTransport transport based on the built-in `WebTransport` object. |
Usage:
| Transport | browser | Node.js | Deno | Bun |
|-----------------|--------------------|------------------------|--------------------|--------------------|
| `Fetch` | :white_check_mark: | :white_check_mark: (1) | :white_check_mark: | :white_check_mark: |
| `NodeXHR` | | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `XHR` | :white_check_mark: | | | |
| `NodeWebSocket` | | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `WebSocket` | :white_check_mark: | :white_check_mark: (2) | :white_check_mark: | :white_check_mark: |
| `WebTransport` | :white_check_mark: | :white_check_mark: | | |
(1) since [v18.0.0](https://nodejs.org/api/globals.html#fetch)
(2) since [v21.0.0](https://nodejs.org/api/globals.html#websocket)
Added in [f4d898e](https://github.com/socketio/engine.io-client/commit/f4d898ee9652939a4550a41ac0e8143056154c0a) and [b11763b](https://github.com/socketio/engine.io-client/commit/b11763beecfe4622867b4dec9d1db77460733ffb).
#### Test each low-level transports
When setting the `tryAllTransports` option to `true`, if the first transport (usually, HTTP long-polling) fails, then the other transports will be tested too:
```js
import { io } from "socket.io-client";
const socket = io({
tryAllTransports: true
});
```
This feature is useful in two cases:
- when HTTP long-polling is disabled on the server, or if CORS fails
- when WebSocket is tested first (with `transports: ["websocket", "polling"]`)
The only potential downside is that the connection attempt could take more time in case of failure, as there have been reports of WebSocket connection errors taking several seconds before being detected (that's one reason for using HTTP long-polling first). That's why the option defaults to `false` for now.
Added in [579b243](https://github.com/socketio/engine.io-client/commit/579b243e89ac7dc58233f9844ef70817364ecf52).
### Bug Fixes
* accept string | undefined as init argument (bis) ([60c757f](https://github.com/socketio/socket.io/commit/60c757f718d400e052c3160ee377bbe4973277c9))
* allow to manually stop the reconnection loop ([13c6d2e](https://github.com/socketio/socket.io/commit/13c6d2e89deb1e6c6c8c7245118f9b37d66537cb))
* close the engine upon decoding exception ([04c8dd9](https://github.com/socketio/socket.io/commit/04c8dd979ce40acaceec1f4507c1ae69325d6158))
* do not send a packet on an expired connection ([#5134](https://github.com/socketio/socket.io/issues/5134)) ([8adcfbf](https://github.com/socketio/socket.io/commit/8adcfbfde50679095ec2abe376650cf2b6814325))
### Dependencies
- [`engine.io-client@~6.6.1`](https://github.com/socketio/engine.io-client/releases/tag/6.5.2) ([diff](https://github.com/socketio/engine.io-client/compare/6.5.3...6.6.0) and [diff](https://github.com/socketio/socket.io/compare/engine.io-client@6.6.0...engine.io-client@6.6.1))
- [`ws@~8.17.1`](https://github.com/websockets/ws/releases/tag/8.17.1) ([diff](https://github.com/websockets/ws/compare/8.11.0...8.17.1))
## [4.7.5](https://github.com/socketio/socket.io-client/compare/4.7.4...4.7.5) (2024-03-14)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "socket.io-client",
"version": "4.7.5",
"version": "4.8.0",
"description": "Realtime application framework client",
"keywords": [
"realtime",
@@ -47,7 +47,7 @@
"dependencies": {
"@socket.io/component-emitter": "~3.1.0",
"debug": "~4.3.2",
"engine.io-client": "~6.6.0",
"engine.io-client": "~6.6.1",
"socket.io-parser": "~4.2.4"
},
"scripts": {

View File

@@ -1,72 +1,72 @@
# History
## 2024
- [4.7.5](#475-2024-03-14) (Mar 2024)
- [4.7.4](#474-2024-01-12) (Jan 2024)
- [4.7.3](#473-2024-01-03) (Jan 2024)
## 2023
- [4.7.2](#472-2023-08-02) (Aug 2023)
- [4.7.1](#471-2023-06-28) (Jun 2023)
- [4.7.0](#470-2023-06-22) (Jun 2023)
- [4.6.2](#462-2023-05-31) (May 2023)
- [4.6.1](#461-2023-02-20) (Feb 2023)
- [4.6.0](#460-2023-02-07) (Feb 2023)
## 2022
- [4.5.4](#454-2022-11-22) (Nov 2022)
- [4.5.3](#453-2022-10-15) (Oct 2022)
- [4.5.2](#452-2022-09-02) (Sep 2022)
- [2.5.0](#250-2022-06-26) (Jun 2022) (from the [2.x](https://github.com/socketio/socket.io/tree/2.x) branch)
- [4.5.1](#451-2022-05-17) (May 2022)
- [4.5.0](#450-2022-04-23) (Apr 2022)
- [4.4.1](#441-2022-01-06) (Jan 2022)
## 2021
- [4.4.0](#440-2021-11-18) (Nov 2021)
- [4.3.2](#432-2021-11-08) (Nov 2021)
- [4.3.1](#431-2021-10-16) (Oct 2021)
- [4.3.0](#430-2021-10-14) (Oct 2021)
- [4.2.0](#420-2021-08-30) (Aug 2021)
- [4.1.3](#413-2021-07-10) (Jul 2021)
- [4.1.2](#412-2021-05-17) (May 2021)
- [4.1.1](#411-2021-05-11) (May 2021)
- [4.1.0](#410-2021-05-11) (May 2021)
- [4.0.2](#402-2021-05-06) (May 2021)
- [4.0.1](#401-2021-03-31) (Mar 2021)
- [**4.0.0**](#400-2021-03-10) (Mar 2021)
- [3.1.2](#312-2021-02-26) (Feb 2021)
- [3.1.1](#311-2021-02-03) (Feb 2021)
- [3.1.0](#310-2021-01-15) (Jan 2021)
- [2.4.1](#241-2021-01-07) (Jan 2021) (from the [2.x](https://github.com/socketio/socket.io/tree/2.x) branch)
- [3.0.5](#305-2021-01-05) (Jan 2021)
- [2.4.0](#240-2021-01-04) (Jan 2021) (from the [2.x](https://github.com/socketio/socket.io/tree/2.x) branch)
## 2020
- [3.0.4](#304-2020-12-07) (Dec 2020)
- [3.0.3](#303-2020-11-19) (Nov 2020)
- [3.0.2](#302-2020-11-17) (Nov 2020)
- [3.0.1](#301-2020-11-09) (Nov 2020)
- [**3.0.0**](#300-2020-11-05) (Nov 2020)
## 2019
- [2.3.0](#230-2019-09-20) (Sep 2019)
## 2018
- [2.2.0](#220-2018-11-29) (Nov 2018)
- [2.1.1](#211-2018-05-17) (May 2018)
- [2.1.0](#210-2018-03-29) (Mar 2018)
| Version | Release date |
|--------------------------------------------------------------------------------------------------|----------------|
| [4.8.0](#480-2024-09-21) | September 2024 |
| [4.7.5](#475-2024-03-14) | March 2024 |
| [4.7.4](#474-2024-01-12) | January 2024 |
| [4.7.3](#473-2024-01-03) | January 2024 |
| [4.7.2](#472-2023-08-02) | August 2023 |
| [4.7.1](#471-2023-06-28) | June 2023 |
| [4.7.0](#470-2023-06-22) | June 2023 |
| [4.6.2](#462-2023-05-31) | May 2023 |
| [4.6.1](#461-2023-02-20) | February 2023 |
| [4.6.0](#460-2023-02-07) | February 2023 |
| [4.5.4](#454-2022-11-22) | November 2022 |
| [4.5.3](#453-2022-10-15) | October 2022 |
| [4.5.2](#452-2022-09-02) | September 2022 |
| [2.5.0](#250-2022-06-26) (from the [2.x](https://github.com/socketio/socket.io/tree/2.x) branch) | June 2022 |
| [4.5.1](#451-2022-05-17) | May 2022 |
| [4.5.0](#450-2022-04-23) | April 2022 |
| [4.4.1](#441-2022-01-06) | January 2022 |
| [4.4.0](#440-2021-11-18) | November 2021 |
| [4.3.2](#432-2021-11-08) | November 2021 |
| [4.3.1](#431-2021-10-16) | October 2021 |
| [4.3.0](#430-2021-10-14) | October 2021 |
| [4.2.0](#420-2021-08-30) | August 2021 |
| [4.1.3](#413-2021-07-10) | July 2021 |
| [4.1.2](#412-2021-05-17) | May 2021 |
| [4.1.1](#411-2021-05-11) | May 2021 |
| [4.1.0](#410-2021-05-11) | May 2021 |
| [4.0.2](#402-2021-05-06) | May 2021 |
| [4.0.1](#401-2021-03-31) | March 2021 |
| [**4.0.0**](#400-2021-03-10) | March 2021 |
| [3.1.2](#312-2021-02-26) | February 2021 |
| [3.1.1](#311-2021-02-03) | February 2021 |
| [3.1.0](#310-2021-01-15) | January 2021 |
| [2.4.1](#241-2021-01-07) (from the [2.x](https://github.com/socketio/socket.io/tree/2.x) branch) | January 2021 |
| [3.0.5](#305-2021-01-05) | January 2021 |
| [2.4.0](#240-2021-01-04) (from the [2.x](https://github.com/socketio/socket.io/tree/2.x) branch) | January 2021 |
| [3.0.4](#304-2020-12-07) | December 2020 |
| [3.0.3](#303-2020-11-19) | November 2020 |
| [3.0.2](#302-2020-11-17) | November 2020 |
| [3.0.1](#301-2020-11-09) | November 2020 |
| [**3.0.0**](#300-2020-11-05) | November 2020 |
| [2.3.0](#230-2019-09-20) | September 2019 |
| [2.2.0](#220-2018-11-29) | November 2018 |
| [2.1.1](#211-2018-05-17) | May 2018 |
| [2.1.0](#210-2018-03-29) | March 2018 |
# Release notes
## [4.8.0](https://github.com/socketio/socket.io/compare/socket.io@4.7.5...socket.io@4.8.0) (2024-09-21)
### Bug Fixes
* allow to join a room in a middleware (uws) ([b04fa64](https://github.com/socketio/socket.io/commit/b04fa64365729244a9c50a6b54b12e9bcc9e55d0))
* correctly await async close on adapters ([#4971](https://github.com/socketio/socket.io/issues/4971)) ([e347a3c](https://github.com/socketio/socket.io/commit/e347a3c24e773cf59f589110989fd56703a9057c))
* expose type of default engine ([132d05f](https://github.com/socketio/socket.io/commit/132d05fc0b319df7eb1b3010a91adc7d5ae58ef2))
### Dependencies
- [`engine.io@~6.6.0`](https://github.com/socketio/engine.io/releases/tag/6.5.2) ([diff](https://github.com/socketio/engine.io/compare/6.5.2...6.6.0) and [diff](https://github.com/socketio/socket.io/compare/engine.io@6.6.0...engine.io@6.6.1))
- [`ws@~8.17.1`](https://github.com/websockets/ws/releases/tag/8.17.1) ([diff](https://github.com/websockets/ws/compare/8.11.0...8.17.1))
## [4.7.5](https://github.com/socketio/socket.io/compare/4.7.4...4.7.5) (2024-03-14)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "socket.io",
"version": "4.7.5",
"version": "4.8.0",
"description": "node.js realtime framework server",
"keywords": [
"realtime",