WebTransport
WebTransport is a new transport protocol that allows for low-latency, bidirectional, and multiplexed communication between a client and a server. It is built on top of HTTP/3 and QUIC - which is built on top of UDP instead of TCP.
⚠️
Experimental - This WebTransport implementation hasn’t been battle tested. Please report any issues you may find - WebTransport is still an emerging technology and not widely available yet.
The underlying library is @fails-components/webtransport - a backend implementation of HTTP3/WebTransport.
npm install --save @colyseus/h3-transportUsage
app.config.ts
import { defineServer } from "colyseus";
import { H3Transport } from "@colyseus/h3-transport"
const server = defineServer({
// ...
transport: new H3Transport({
/* H3Transport options */
}),
//
// bind express routes
//
express: (app) => {
app.get("/hello", (req, res) => {
res.json({ hello: "world!" });
});
},
// ...
});Available options
app: The Express app.cert: Certificate contents (cert.pem)key: Private key contents (key.pem)secret: (?)server: Thehttp.Serverinstance to be used.localProxy: (optional) Fallback every URL through the this local proxy.
Last updated on