web_transport_quinn/
lib.rs

1//! WebTransport is a protocol for client-server communication over QUIC.
2//! It's [available in the browser](https://caniuse.com/webtransport) as an alternative to HTTP and WebSockets.
3//!
4//! WebTransport is layered on top of HTTP/3 which is then layered on top of QUIC.
5//! This library hides that detail and tries to expose only the QUIC API, delegating as much as possible to the underlying implementation.
6//! See the [Quinn documentation](https://docs.rs/quinn/latest/quinn/) for more documentation.
7//!
8//! QUIC provides two primary APIs:
9//!
10//! # Streams
11//! QUIC streams are ordered, reliable, flow-controlled, and optionally bidirectional.
12//! Both endpoints can create and close streams (including an error code) with no overhead.
13//! You can think of them as TCP connections, but shared over a single QUIC connection.
14//!
15//! # Datagrams
16//! QUIC datagrams are unordered, unreliable, and not flow-controlled.
17//! Both endpoints can send datagrams below the MTU size (~1.2kb minimum) and they might arrive out of order or not at all.
18//! They are basically UDP packets, except they are encrypted and congestion controlled.
19//!
20//! # Limitations
21//! WebTransport is able to be pooled with HTTP/3 and multiple WebTransport sessions.
22//! This crate avoids that complexity, doing the bare minimum to support a single WebTransport session that owns the entire QUIC connection.
23//! If you want to support HTTP/3 on the same host/port, you should use another crate (ex. `h3-webtransport`).
24//! If you want to support multiple WebTransport sessions over the same QUIC connection... you should just dial a new QUIC connection instead.
25
26// External
27mod client;
28mod error;
29mod recv;
30mod send;
31mod server;
32mod session;
33
34pub use client::*;
35pub use error::*;
36pub use recv::*;
37pub use send::*;
38pub use server::*;
39pub use session::*;
40
41// Internal
42mod connect;
43mod settings;
44
45use connect::*;
46use settings::*;
47
48/// The HTTP/3 ALPN is required when negotiating a QUIC connection.
49pub const ALPN: &str = "h3";
50
51/// Export our simple crypto provider.
52pub mod crypto;
53
54/// Re-export the underlying QUIC implementation.
55pub use quinn;
56
57/// Re-export the http crate because it's in the public API.
58pub use http;
59
60/// Re-export the generic WebTransport implementation.
61pub use web_transport_trait as generic;