Expand description
HTTP proxy utilities for iroh connections.
This crate provides building blocks for HTTP proxies that bridge TCP traffic over iroh’s peer-to-peer QUIC connections. It supports both forward and reverse proxy modes, with pluggable request routing and authorization.
§Architecture
The proxy operates in two layers:
- Downstream proxy (
downstream::DownstreamProxy): Accepts TCP connections from clients and forwards them over iroh to an upstream proxy. - Upstream proxy (
upstream::UpstreamProxy): Receives proxied streams from iroh and forwards them to origin TCP servers.
§Protocol
Communication between downstream and upstream uses HTTP/1.1 over QUIC bidirectional streams. The protocol supports:
- CONNECT tunneling (RFC 9110 §9.3.6): For opaque TCP tunnels
- Absolute-form requests (RFC 9110 §7.1): For HTTP forward proxying
§Example
See the examples/ directory for complete usage examples.
Modules§
- downstream
- Downstream proxying from TCP clients to iroh endpoints.
- upstream
- Upstream proxying from iroh streams to TCP origins.
Structs§
- Authority
- Host and port extracted from HTTP request targets (RFC 9110 §7.2).
- Http
Proxy Request - HTTP request suitable for proxy routing decisions.
- Http
Request - Parsed HTTP request with method, URI, headers, and version.
- Http
Response - Parsed HTTP response with status line and headers.
Enums§
- Http
Proxy Request Kind - Proxy-specific request target classification (RFC 9110 §7.1).
- Http
Request Kind - Classification of HTTP request target forms (RFC 9110 §7.1).
Constants§
- ALPN
- ALPN protocol identifier for iroh HTTP proxy connections.
- IROH_
DESTINATION_ HEADER - HTTP header for routing requests to specific iroh endpoints.