From 1f640a2a0f7cd3beba2d1a0ecec6614e7ff6fe4c Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Fri, 16 Jun 2023 11:36:09 +0200 Subject: [PATCH] chore(release): 6.5.0 Diff: https://github.com/socketio/engine.io/compare/6.4.2...6.5.0 --- CHANGELOG.md | 86 +++++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 37 ++++++-------------- package.json | 4 +-- 3 files changed, 98 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60ebdb9d..527cd080 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 2023 +- [6.5.0](#650-2023-06-16) (Jun 2023) - [6.4.2](#642-2023-05-02) (May 2023) - [6.4.1](#641-2023-02-20) (Feb 2023) - [6.4.0](#640-2023-02-06) (Feb 2023) @@ -47,6 +48,91 @@ # Release notes +## [6.5.0](https://github.com/socketio/engine.io/compare/6.4.2...6.5.0) (2023-06-16) + + +### Bug Fixes + +* **uws:** discard any write to an aborted uWS response ([#682](https://github.com/socketio/engine.io/issues/682)) ([3144d27](https://github.com/socketio/engine.io/commit/3144d274584ae3b96cca4e609c66c56d534f1715)) + + +### Features + +#### Support for WebTransport + +The Engine.IO server 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/ + +Until WebTransport support lands [in Node.js](https://github.com/nodejs/node/issues/38478), you can use the `@fails-components/webtransport` package: + +```js +import { readFileSync } from "fs"; +import { createServer } from "https"; +import { Server } from "engine.io"; +import { Http3Server } from "@fails-components/webtransport"; + +// WARNING: the total length of the validity period MUST NOT exceed two weeks (https://w3c.github.io/webtransport/#custom-certificate-requirements) +const cert = readFileSync("/path/to/my/cert.pem"); +const key = readFileSync("/path/to/my/key.pem"); + +const httpsServer = createServer({ + key, + cert +}); + +httpsServer.listen(3000); + +const engine = new Server({ + transports: ["polling", "websocket", "webtransport"] // WebTransport is not enabled by default +}); + +engine.attach(httpsServer); + +const h3Server = new Http3Server({ + port: 3000, + host: "0.0.0.0", + secret: "changeit", + cert, + privKey: key, +}); + +(async () => { + const stream = await h3Server.sessionStream("/engine.io/"); + const sessionReader = stream.getReader(); + + while (true) { + const { done, value } = await sessionReader.read(); + if (done) { + break; + } + engine.onWebTransportSession(value); + } +})(); + +h3Server.startServer(); +``` + +Added in [123b68c](https://github.com/socketio/engine.io/commit/123b68c04f9e971f59b526e0f967a488ee6b0116). + + +### Credits + +Huge thanks to [@OxleyS](https://github.com/OxleyS) for helping! + + +### Dependencies + +- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) (no change) + + + ## [6.4.2](https://github.com/socketio/engine.io/compare/6.4.1...6.4.2) (2023-05-02) :warning: This release contains an important security fix :warning: diff --git a/package-lock.json b/package-lock.json index ecb92181..95421dce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "@fails-components/webtransport": "^0.1.7", "babel-eslint": "^8.0.2", "eiows": "^4.1.2", - "engine.io-client": "6.4.0", + "engine.io-client": "6.5.0", "engine.io-client-v3": "npm:engine.io-client@3.5.2", "expect.js": "^0.3.1", "express-session": "^1.17.3", @@ -729,14 +729,14 @@ } }, "node_modules/engine.io-client": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.4.0.tgz", - "integrity": "sha512-GyKPDyoEha+XZ7iEqam49vz6auPnNJ9ZBfy89f+rMMas8AuiMWOZ9PVzu8xb9ZC6rafUqiGHSCfu22ih66E+1g==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.0.tgz", + "integrity": "sha512-C7eN3OKggSfd5g8IDgUA9guC8TNS6CEganKT7dL6Fp3q+FobcQ/WBn2Qq2XTL1vNTiFZfDzXohvqLuR9dWejdg==", "dev": true, "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1", - "engine.io-parser": "~5.0.3", + "engine.io-parser": "~5.1.0", "ws": "~8.11.0", "xmlhttprequest-ssl": "~2.0.0" } @@ -819,15 +819,6 @@ "node": ">=0.4.0" } }, - "node_modules/engine.io-client/node_modules/engine.io-parser": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.7.tgz", - "integrity": "sha512-P+jDFbvK6lE3n1OL+q9KuzdOFWkkZ/cMV9gol/SbVfpyqfvrfrFTOFJ6fQm2VC3PZHlU3QPhVwmbsCnauHF2MQ==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/engine.io-parser": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.1.0.tgz", @@ -3114,24 +3105,16 @@ } }, "engine.io-client": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.4.0.tgz", - "integrity": "sha512-GyKPDyoEha+XZ7iEqam49vz6auPnNJ9ZBfy89f+rMMas8AuiMWOZ9PVzu8xb9ZC6rafUqiGHSCfu22ih66E+1g==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.0.tgz", + "integrity": "sha512-C7eN3OKggSfd5g8IDgUA9guC8TNS6CEganKT7dL6Fp3q+FobcQ/WBn2Qq2XTL1vNTiFZfDzXohvqLuR9dWejdg==", "dev": true, "requires": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1", - "engine.io-parser": "~5.0.3", + "engine.io-parser": "~5.1.0", "ws": "~8.11.0", "xmlhttprequest-ssl": "~2.0.0" - }, - "dependencies": { - "engine.io-parser": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.7.tgz", - "integrity": "sha512-P+jDFbvK6lE3n1OL+q9KuzdOFWkkZ/cMV9gol/SbVfpyqfvrfrFTOFJ6fQm2VC3PZHlU3QPhVwmbsCnauHF2MQ==", - "dev": true - } } }, "engine.io-client-v3": { @@ -4319,7 +4302,7 @@ "uWebSockets.js": { "version": "git+ssh://git@github.com/uNetworking/uWebSockets.js.git#d39d4181daf5b670d44cbc1b18f8c28c85fd4142", "dev": true, - "from": "uWebSockets.js@uNetworking/uWebSockets.js#v20.30.0" + "from": "uWebSockets.js@github:uNetworking/uWebSockets.js#v20.30.0" }, "vary": { "version": "1.1.2", diff --git a/package.json b/package.json index db3ae718..5eae7112 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "engine.io", - "version": "6.4.2", + "version": "6.5.0", "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", @@ -46,7 +46,7 @@ "@fails-components/webtransport": "^0.1.7", "babel-eslint": "^8.0.2", "eiows": "^4.1.2", - "engine.io-client": "6.4.0", + "engine.io-client": "6.5.0", "engine.io-client-v3": "npm:engine.io-client@3.5.2", "expect.js": "^0.3.1", "express-session": "^1.17.3",