Skip to main content

Module outbound

Module outbound 

Source
Expand description

Shared outbound HTTP client for plugin callouts and upstream proxying.

One pooled hyper client pair lives in PluginResources for the process lifetime: plugins (forward-auth, opa, loggers, upstream, …) reuse its connection pool instead of constructing a client per node or per request. Supports http and https (rustls, native roots); ssl_verify: false selects a lazily-built client with certificate verification disabled.

Modules§

idle
Body wrappers for streaming upstream responses.
tls
Per-upstream TLS identities — mTLS to upstream backends.

Structs§

NoVerification 🔒
Certificate verifier that accepts everything — only reachable via an explicit ssl_verify: false in plugin config.
OutboundClient
Process-wide pooled HTTP client.
OutboundRequest
A single outbound request. timeout’s meaning depends on which call consumes it: [Client::request] applies it to the whole call — connect, request write, and response body collection. [Client::request_streaming] applies it only to connect, request write, and response headers; once headers are in, the body is unbounded here and left to the caller’s own idle bound (e.g. stream_idle_timeout_ms on the upstream node).
OutboundResponse
A fully-buffered outbound response.
OutboundStreamingResponse
A response whose headers have arrived and whose body is still streaming.

Enums§

OutboundError
Outbound call failure, distinguishing timeouts from transport errors so callers can map them to distinct gateway error codes.

Functions§

build_insecure_client 🔒
client_tls_connector
Builds a client TLS connector for a raw upstream WebSocket (wss) handshake.

Type Aliases§

BoxError
The error type carried by every streaming response body in this crate (ResponseStream, OutboundStreamingResponse::body, the idle module’s wrappers). Deliberately not hyper::Error: that type has no public constructor anywhere in the hyper crate (every one of them is pub(super)), so nothing built on top of it can ever report its own failure (an idle timeout, a future size cap, a shutdown-drain cutoff) — only forward an error hyper already produced from a real connection. A boxed std::error::Error is strictly more permissive than what hyper’s own serve_connection requires of a response body’s error type (Into<Box<dyn StdError + Send + Sync>>), so this costs nothing on the send side while unblocking every synthetic error this crate needs to produce. hyper::Error itself satisfies Into<BoxError> via the standard library’s blanket From<E: Error + Send + Sync> for Box<dyn Error + Send + Sync>, so forwarding a real hyper error through is a no-op conversion, not a loss of information.
PooledClient 🔒