20 releases (8 breaking)

new 0.9.1 Apr 26, 2024
0.9.0 Mar 31, 2024
0.8.0 Mar 22, 2024
0.7.0 Dec 21, 2023
0.4.2 Jul 21, 2023

#1613 in Network programming

Download history 58/week @ 2024-01-07 22/week @ 2024-01-14 18/week @ 2024-01-21 17/week @ 2024-01-28 21/week @ 2024-02-04 31/week @ 2024-02-11 30/week @ 2024-02-18 77/week @ 2024-02-25 57/week @ 2024-03-03 66/week @ 2024-03-10 193/week @ 2024-03-17 34/week @ 2024-03-24 206/week @ 2024-03-31 42/week @ 2024-04-07 60/week @ 2024-04-14 178/week @ 2024-04-21

489 downloads per month

MIT license

115KB
2.5K SLoC

webtransport-quinn

Renamed to web-transport-quinn. Yes I added a hyphen.


lib.rs:

WebTransport is a protocol for client-server communication over QUIC. It's available in the browser as an alternative to HTTP and WebSockets.

WebTransport is layered on top of HTTP/3 which is then layered on top of QUIC. This library hides that detail and tries to expose only the QUIC API, delegating as much as possible to the underlying implementation. See the Quinn documentation for more documentation.

QUIC provides two primary APIs:

Streams

QUIC streams are ordered, reliable, flow-controlled, and optionally bidirectional. Both endpoints can create and close streams (including an error code) with no overhead. You can think of them as TCP connections, but shared over a single QUIC connection.

Datagrams

QUIC datagrams are unordered, unreliable, and not flow-controlled. Both endpoints can send datagrams below the MTU size (~1.2kb minimum) and they might arrive out of order or not at all. They are basically UDP packets, except they are encrypted and congestion controlled.

Limitations

WebTransport is able to be pooled with HTTP/3 and multiple WebTransport sessions. This crate avoids that complexity, doing the bare minimum to support a single WebTransport session that owns the entire QUIC connection. If you want to support HTTP/3 on the same host/port, you should use another crate (ex. h3-webtransport). If you want to support multiple WebTransport sessions over the same QUIC connection... you should just dial a new QUIC connection instead.

Dependencies

~7–19MB
~236K SLoC