Skip to main content

HeaderValidator

Trait HeaderValidator 

Source
pub trait HeaderValidator:
    Send
    + Sync
    + 'static {
    // Required method
    fn validate(
        &self,
        header: &ProxyInfo,
        peer_addr: SocketAddr,
    ) -> Result<(), Box<dyn Error + Send + Sync>>;
}
Expand description

Validate a Proxy Protocol header before the connection is passed to the application

Required Methods§

Source

fn validate( &self, header: &ProxyInfo, peer_addr: SocketAddr, ) -> Result<(), Box<dyn Error + Send + Sync>>

Implementors§

Source§

impl<F> HeaderValidator for F
where F: Fn(&ProxyInfo, SocketAddr) -> Result<(), Box<dyn Error + Send + Sync>> + Send + Sync + 'static,

Blanket implementation for closures