Skip to main content

InterceptHandler

Trait InterceptHandler 

Source
pub trait InterceptHandler: Send + Sync {
    // Provided methods
    fn on_request(&self, _dst: &SocketAddr, _sni: &str, data: &[u8]) -> Vec<u8>  { ... }
    fn on_response(&self, _dst: &SocketAddr, _sni: &str, data: &[u8]) -> Vec<u8>  { ... }
}
Expand description

Called by the TLS proxy for each intercepted request’s plaintext bytes.

This is an internal trait, not public API. The secrets layer implements it with the substitution engine.

Provided Methods§

Source

fn on_request(&self, _dst: &SocketAddr, _sni: &str, data: &[u8]) -> Vec<u8>

Inspect/modify outbound plaintext bytes before re-encryption.

Returns the (possibly modified) bytes to send to the real server.

Source

fn on_response(&self, _dst: &SocketAddr, _sni: &str, data: &[u8]) -> Vec<u8>

Inspect/modify inbound plaintext bytes before re-encryption toward guest.

Returns the (possibly modified) bytes to send to the guest.

Implementors§