iroh_relay/
http.rs

1//! HTTP-specific constants for the relay server and client.
2
3use http::HeaderName;
4
5#[cfg(feature = "server")]
6pub(crate) const WEBSOCKET_UPGRADE_PROTOCOL: &str = "websocket";
7#[cfg(feature = "server")] // only used in the server for now
8pub(crate) const SUPPORTED_WEBSOCKET_VERSION: &str = "13";
9
10/// The HTTP path under which the relay accepts relaying connections
11/// (over websockets and a custom upgrade protocol).
12pub const RELAY_PATH: &str = "/relay";
13/// The HTTP path under which the relay allows doing latency queries for testing.
14pub const RELAY_PROBE_PATH: &str = "/ping";
15
16/// The websocket sub-protocol version that we currently support.
17///
18/// This is sent as the websocket sub-protocol header `Sec-Websocket-Protocol` from
19/// the client and answered from the server.
20pub const RELAY_PROTOCOL_VERSION: &str = "iroh-relay-v1";
21/// The HTTP header name for relay client authentication
22pub const CLIENT_AUTH_HEADER: HeaderName = HeaderName::from_static("x-iroh-relay-client-auth-v1");