Skip to content

http

Structs


firma_sidecar::interceptor::http::HttpInterceptor

Section titled “firma_sidecar::interceptor::http::HttpInterceptor”

Struct

HTTP forward proxy interceptor.

Listens on a configurable TCP port (default 8080) and captures every outbound HTTP request made by the agent. Each request is converted into a [RawRequest] and handled through the [RequestHandler] provided in [Interceptor::run].

Malformed requests that cannot be parsed into a valid RawRequest are rejected with a structured DENY carrying reason MALFORMED_REQUEST (fail-closed).

Methods:

  • fn run_with_listener(self: Self, listener: TcpListener, handler: Arc<RequestHandler>, cancel: CancellationToken) -> Result<(), InterceptorError> - Run the interceptor loop using an already bound listener.
  • fn new(address: SocketAddr) -> Self - Create a new [HttpInterceptor] that listens on the specified address.
  • fn with_https_mitm(self: Self, config: HttpsMitmConfig, ca_dir: PathBuf) -> Self - Attach HTTPS MITM configuration to this interceptor.

Trait Implementations:

  • From
    • fn from(address: SocketAddr) -> Self
  • Interceptor
    • fn run(self: Self, handler: Arc<RequestHandler>, cancel: CancellationToken) -> Result<(), InterceptorError>