|
2 | 2 |
|
3 | 3 | ## 2023
|
4 | 4 |
|
| 5 | +- [6.5.0](#650-2023-06-16) (Jun 2023) |
5 | 6 | - [6.4.2](#642-2023-05-02) (May 2023)
|
6 | 7 | - [6.4.1](#641-2023-02-20) (Feb 2023)
|
7 | 8 | - [6.4.0](#640-2023-02-06) (Feb 2023)
|
|
47 | 48 |
|
48 | 49 | # Release notes
|
49 | 50 |
|
| 51 | +## [6.5.0](https://github.com/socketio/engine.io/compare/6.4.2...6.5.0) (2023-06-16) |
| 52 | + |
| 53 | + |
| 54 | +### Bug Fixes |
| 55 | + |
| 56 | +* **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)) |
| 57 | + |
| 58 | + |
| 59 | +### Features |
| 60 | + |
| 61 | +#### Support for WebTransport |
| 62 | + |
| 63 | +The Engine.IO server can now use WebTransport as the underlying transport. |
| 64 | + |
| 65 | +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. |
| 66 | + |
| 67 | +References: |
| 68 | + |
| 69 | +- https://w3c.github.io/webtransport/ |
| 70 | +- https://developer.mozilla.org/en-US/docs/Web/API/WebTransport |
| 71 | +- https://developer.chrome.com/articles/webtransport/ |
| 72 | + |
| 73 | +Until WebTransport support lands [in Node.js](https://github.com/nodejs/node/issues/38478), you can use the `@fails-components/webtransport` package: |
| 74 | + |
| 75 | +```js |
| 76 | +import { readFileSync } from "fs"; |
| 77 | +import { createServer } from "https"; |
| 78 | +import { Server } from "engine.io"; |
| 79 | +import { Http3Server } from "@fails-components/webtransport"; |
| 80 | + |
| 81 | +// WARNING: the total length of the validity period MUST NOT exceed two weeks (https://w3c.github.io/webtransport/#custom-certificate-requirements) |
| 82 | +const cert = readFileSync("/path/to/my/cert.pem"); |
| 83 | +const key = readFileSync("/path/to/my/key.pem"); |
| 84 | + |
| 85 | +const httpsServer = createServer({ |
| 86 | + key, |
| 87 | + cert |
| 88 | +}); |
| 89 | + |
| 90 | +httpsServer.listen(3000); |
| 91 | + |
| 92 | +const engine = new Server({ |
| 93 | + transports: ["polling", "websocket", "webtransport"] // WebTransport is not enabled by default |
| 94 | +}); |
| 95 | + |
| 96 | +engine.attach(httpsServer); |
| 97 | + |
| 98 | +const h3Server = new Http3Server({ |
| 99 | + port: 3000, |
| 100 | + host: "0.0.0.0", |
| 101 | + secret: "changeit", |
| 102 | + cert, |
| 103 | + privKey: key, |
| 104 | +}); |
| 105 | + |
| 106 | +(async () => { |
| 107 | + const stream = await h3Server.sessionStream("/engine.io/"); |
| 108 | + const sessionReader = stream.getReader(); |
| 109 | + |
| 110 | + while (true) { |
| 111 | + const { done, value } = await sessionReader.read(); |
| 112 | + if (done) { |
| 113 | + break; |
| 114 | + } |
| 115 | + engine.onWebTransportSession(value); |
| 116 | + } |
| 117 | +})(); |
| 118 | + |
| 119 | +h3Server.startServer(); |
| 120 | +``` |
| 121 | + |
| 122 | +Added in [123b68c](https://github.com/socketio/engine.io/commit/123b68c04f9e971f59b526e0f967a488ee6b0116). |
| 123 | + |
| 124 | + |
| 125 | +### Credits |
| 126 | + |
| 127 | +Huge thanks to [@OxleyS](https://github.com/OxleyS) for helping! |
| 128 | + |
| 129 | + |
| 130 | +### Dependencies |
| 131 | + |
| 132 | +- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) (no change) |
| 133 | + |
| 134 | + |
| 135 | + |
50 | 136 | ## [6.4.2](https://github.com/socketio/engine.io/compare/6.4.1...6.4.2) (2023-05-02)
|
51 | 137 |
|
52 | 138 | :warning: This release contains an important security fix :warning:
|
|
0 commit comments