Expand description
Shared L7 upstream-forwarding pipeline.
Used by both the reverse-proxy path (crate::reverse) and the
TLS-intercept CONNECT path (crate::tls_intercept). The two callers
differ in how they parse the inbound request, look up the route, and
transform/inject credentials, but converge on the same wire-level
upstream operation:
- Establish an upstream byte stream — direct TCP (with optional TLS) or chained CONNECT through an enterprise proxy (then TLS).
- Write the pre-built HTTP/1.1 request bytes + body.
- Stream the response back into the inbound sink.
- Emit one L7 audit event with the response status.
§Why pre-built request bytes
Each caller has its own rules for header filtering, credential injection, and path transformation. Asking this module to handle that would mean smuggling all of that policy through a parameter struct. Instead, the caller hands in finished bytes: a clean separation between “build the request” and “speak it on the wire”.
Structs§
- Audit
Ctx - Audit-emission context.
- Upstream
Spec - Description of the upstream the caller wants to reach.
Enums§
- Upstream
Scheme - Scheme of the upstream connection.
Httpis only legal for loopback targets; the caller is responsible for enforcing that invariant (reverse.rsdoes so viavalidate_http_upstream_target). - Upstream
Strategy - How the upstream byte stream is established.
Functions§
- forward_
request - Connect to the upstream, write
request_bytes + body, stream the response back intoinbound, and emit the L7 audit event.