SocksBind

Trait SocksBind 

Source
pub trait SocksBind: Send + Sync {
    // Required methods
    fn bind<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        target_addr: &'life1 str,
        target_port: u16,
    ) -> Pin<Box<dyn Future<Output = Result<(), SocksError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn accept<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<SocksTcpStream, SocksError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_proxy_bind_addr(&mut self) -> Option<SocketAddr>;
}
Expand description

A trait for binding to a target address through a SOCKS proxy.

Required Methods§

Source

fn bind<'life0, 'life1, 'async_trait>( &'life0 mut self, target_addr: &'life1 str, target_port: u16, ) -> Pin<Box<dyn Future<Output = Result<(), SocksError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Binds to the specified target address and port through a SOCKS proxy. If the client is not in possession of DST.ADDR and DST.PORT at the time the UDP ASSOCIATE request is create, it MUST use a port number and address of all zeros.

Source

fn accept<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<SocksTcpStream, SocksError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Accepts a connection from the SOCKS proxy.

Source

fn get_proxy_bind_addr(&mut self) -> Option<SocketAddr>

Gets the bound address from the SOCKS proxy to notify remote sender.

Implementors§