servoh_transport/lib.rs
1//! Shared transport primitives for standard HTTP/1 over iroh.
2//!
3//! The ALPN is the only custom wire-level version marker. Every native
4//! bidirectional stream starts with one ordinary HTTP/1 exchange. A successful
5//! RFC 6455 Upgrade then transfers that stream to standard WebSocket frames; this
6//! crate adds no application framing or metadata encoding.
7
8mod bi_stream;
9mod service_name;
10#[cfg(test)]
11mod tests;
12
13pub use bi_stream::BiStream;
14pub use service_name::is_valid_service_name;
15
16/// Versioned ALPN for standard HTTP/1 bytes over one iroh stream per exchange.
17pub const HTTP_ALPN: &[u8] = b"servoh-http-spike/1";
18
19/// Native QUIC application error used when a stream exchange is cancelled.
20pub const CANCELLED: u32 = 1;
21
22/// Native QUIC application error used for an authenticated but denied client.
23pub const ACCESS_DENIED: u32 = 401;
24
25/// Native QUIC application error used when server admission is saturated.
26pub const OVERLOADED: u32 = 503;