cardinal-proxy
Pingora integration for Cardinal. CardinalProxy implements ProxyHttp and delegates request/response processing to the rest of the stack.
Key pieces
CardinalContextProvider: resolves anArc<CardinalContext>from aSession. The defaultStaticContextProvideralways returns the same context; more advanced deployments can plug in host-aware providers.RequestContext: per-request cache of the resolved context, destination backend, andPluginRunner.- Middleware execution:
PluginRunner::run_request_filters/run_response_filtersare invoked at the right phases, so both Rust and WASM middleware can observe or mutate traffic.
Lifecycle
- Provider resolves a context.
DestinationContainerselects the backend based on path/host.- Request middleware runs; it can short-circuit with
MiddlewareResult::Responded. - Pingora connects to the upstream origin.
- Response middleware runs; optional logging is performed.
Consumers rarely touch this crate directly—Cardinal handles wiring—but understanding it is useful when implementing custom providers or debugging proxy behaviour.