socksx::interface

Trait SocksHandler

Source
pub trait SocksHandler {
    // Required methods
    fn accept_request<'life0, 'life1, 'async_trait>(
        &'life0 self,
        source: &'life1 mut TcpStream,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn refuse_request<'life0, 'life1, 'async_trait>(
        &'life0 self,
        source: &'life1 mut TcpStream,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn setup<'life0, 'life1, 'async_trait>(
        &'life0 self,
        source: &'life1 mut TcpStream,
    ) -> Pin<Box<dyn Future<Output = Result<TcpStream>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

An asynchronous trait defining the core functionalities required for handling SOCKS requests.

Required Methods§

Source

fn accept_request<'life0, 'life1, 'async_trait>( &'life0 self, source: &'life1 mut TcpStream, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Accepts a SOCKS request from a client.

§Parameters
  • source: A mutable reference to the source TcpStream from which the request originates.
§Returns

Returns Result<()> indicating the success or failure of the operation.

Source

fn refuse_request<'life0, 'life1, 'async_trait>( &'life0 self, source: &'life1 mut TcpStream, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Refuses a SOCKS request from a client.

§Parameters
  • source: A reference to the source TcpStream from which the request originates.
§Returns

Returns Result<()> indicating the success or failure of the operation.

Source

fn setup<'life0, 'life1, 'async_trait>( &'life0 self, source: &'life1 mut TcpStream, ) -> Pin<Box<dyn Future<Output = Result<TcpStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sets up the SOCKS connection for a given source.

§Parameters
  • source: A mutable reference to the source TcpStream.
§Returns

Returns a Result<TcpStream> containing the prepared TcpStream or an error.

Implementors§