From 4abc2ca3dfc837039b16865796190819704cdd72 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Fri, 16 Jun 2023 11:05:41 +0200 Subject: [PATCH] chore(release): 6.5.0 Diff: https://github.com/socketio/engine.io-client/compare/6.4.0...6.5.0 --- CHANGELOG.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- lib/socket.ts | 9 +++++++-- package.json | 2 +- 4 files changed, 57 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66df6f971..da414d6cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 2023 +- [6.5.0](#650-2023-06-16) (Jun 2023) - [6.4.0](#640-2023-02-06) (Feb 2023) - [6.3.1](#631-2023-02-04) (Feb 2023) - [6.3.0](#63O-2023-01-10) (Jan 2023) @@ -36,6 +37,53 @@ # Release notes +# [6.5.0](https://github.com/socketio/engine.io-client/compare/6.4.0...6.5.0) (2023-06-16) + + +### Features + +#### Support for WebTransport + +The Engine.IO client can now use WebTransport as the underlying transport. + +WebTransport is a web API that uses the HTTP/3 protocol as a bidirectional transport. It's intended for two-way communications between a web client and an HTTP/3 server. + +References: + +- https://w3c.github.io/webtransport/ +- https://developer.mozilla.org/en-US/docs/Web/API/WebTransport +- https://developer.chrome.com/articles/webtransport/ + +**For Node.js clients**: until WebTransport support lands [in Node.js](https://github.com/nodejs/node/issues/38478), you can use the `@fails-components/webtransport` package: + +```js +import { WebTransport } from "@fails-components/webtransport"; + +global.WebTransport = WebTransport; +``` + +Added in [7195c0f](https://github.com/socketio/engine.io-client/commit/7195c0f305b482f7b1ca2ed812030caaf72c0906). + +#### Cookie management for the Node.js client + +When setting the `withCredentials` option to `true`, the Node.js client will now include the cookies in the HTTP requests, making it easier to use it with cookie-based sticky sessions. + +```js +import { Socket } from "engine.io-client"; + +const socket = new Socket("https://example.com", { + withCredentials: true +}); +``` + +Added in [5fc88a6](https://github.com/socketio/engine.io-client/commit/5fc88a62d4017cdc144fa39b9755deadfff2db34). + +### Dependencies + +- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) (no change) + + + ## [6.4.0](https://github.com/socketio/engine.io-client/compare/6.3.1...6.4.0) (2023-02-06) The minor bump is due to changes on the server side. diff --git a/README.md b/README.md index 6af12e3ab..8c14c8506 100644 --- a/README.md +++ b/README.md @@ -234,7 +234,7 @@ Exposed as `eio` in the browser standalone build. - `timestampParam` (`String`): timestamp parameter (`t`) - `path` (`String`): path to connect to, default is `/engine.io` - `transports` (`Array`): a list of transports to try (in order). - Defaults to `['polling', 'websocket']`. `Engine` + Defaults to `['polling', 'websocket', 'webtransport']`. `Engine` always attempts to connect directly with the first one, provided the feature detection test for it passes. - `transportOptions` (`Object`): hash of options, indexed by transport name, overriding the common options for the given transport diff --git a/lib/socket.ts b/lib/socket.ts index 1e0f1d429..f283bbc1b 100644 --- a/lib/socket.ts +++ b/lib/socket.ts @@ -73,7 +73,8 @@ export interface SocketOptions { * A list of transports to try (in order). Engine.io always attempts to * connect directly with the first one, provided the feature detection test * for it passes. - * @default ['polling','websocket'] + * + * @default ['polling','websocket', 'webtransport'] */ transports: string[]; @@ -324,7 +325,11 @@ export class Socket extends Emitter< ? "443" : "80"); - this.transports = opts.transports || ["polling", "websocket"]; + this.transports = opts.transports || [ + "polling", + "websocket", + "webtransport", + ]; this.writeBuffer = []; this.prevBufferLen = 0; diff --git a/package.json b/package.json index a28376593..99bd9f941 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "engine.io-client", "description": "Client for the realtime Engine", "license": "MIT", - "version": "6.4.0", + "version": "6.5.0", "main": "./build/cjs/index.js", "module": "./build/esm/index.js", "exports": {