webtrans

WebTransport implementation for native and WebAssembly.
Compatibility
The native transport implements the WebTransport over HTTP/3 negotiation and
wire formats used by draft-ietf-webtrans-http3-16, with legacy upgrade-token
acceptance for older peers. Quinn does not yet expose the draft-16
RESET_STREAM_AT extension, so native support is draft-compatible rather than
fully draft-16 compliant. Native applications can inspect
webtrans_quinn::RESET_STREAM_AT_SUPPORTED; it remains false until Quinn
provides the required transport extension.
The WASM transport requires a browser that provides the global WebTransport
API in a secure context. Browser certificate and network policy still apply.
Check the target browsers used by your application because WebTransport
availability can differ by browser and deployment environment.
Installation
[]
= "0.5"
API documentation is available on docs.rs. Depend directly on
webtrans-quinn, webtrans-wasm, webtrans-proto, or webtrans-trait when
transport-specific APIs are required.
Native client
Use system roots for public servers. Pin a certificate or SHA-256 certificate
hash when connecting to a development server with a private certificate.
Disabling verification is intentionally behind dangerous() and should only
be used for controlled local development.
use Duration;
use Url;
use ClientBuilder;
async
Native server and resource limits
Quinn's TransportConfig controls per-connection idle time, stream limits,
flow-control windows, and datagram buffers. Pending handshakes have a separate
endpoint-wide limit.
use ;
use ;
Every accepted Request must be completed with Request::ok or
Request::close. Dropping an unanswered request automatically sends
500 Internal Server Error and emits a tracing event. If the request is
dropped after leaving its Tokio runtime, the response cannot be scheduled and
an error event is emitted instead.
Choose limits from a memory budget and expected bandwidth-delay product. In particular, worst-case receive memory grows with the number of connections, concurrent streams, receive windows, and buffered datagrams. Applications should also bound their own stream payloads and operation durations.
Complete runnable programs, including PEM certificate loading and a local self-signed setup, are in the examples directory:
WebAssembly
The webtrans-wasm-demo crate contains a browser example. Build the facade and
WASM crates with:
Workspace crates
webtrans: target-selecting facade.webtrans-proto: bounded protocol primitives and HTTP/3 field validation.webtrans-quinn: native client/server implementation.webtrans-trait: transport-agnostic session and stream traits.webtrans-wasm: browser bindings.webtrans-wasm-demo: browser demo.
Benchmarking
Criterion benchmarks are available for webtrans-proto: