UdpInspector

Trait UdpInspector 

pub trait UdpInspector:
    Send
    + Sync
    + 'static {
    type Error: Into<Box<dyn Error + Send + Sync>> + Send + 'static;

    // Required method
    fn inspect_packet(
        &self,
        direction: RelayDirection,
        server_address: SocketAddress,
        payload: &[u8],
    ) -> Result<UdpInspectAction, Self::Error>;
}
Available on (crate features proxy or haproxy or socks5) and crate feature socks5 only.
Expand description

Inspector of relayed udp packets, handling both north and south traffic.

Required Associated Types§

type Error: Into<Box<dyn Error + Send + Sync>> + Send + 'static

Required Methods§

fn inspect_packet( &self, direction: RelayDirection, server_address: SocketAddress, payload: &[u8], ) -> Result<UdpInspectAction, Self::Error>

Inspect a relayed udp packet respond with a UdpInspectAction.

Implementors§

§

impl<F, E> UdpInspector for F
where F: Fn(RelayDirection, SocketAddress, &[u8]) -> Result<UdpInspectAction, E> + Send + Sync + 'static, E: Into<Box<dyn Error + Send + Sync>> + Send + 'static,

§

type Error = E