pub trait Auth {
    fn as_handshake_method(&self) -> HandshakeMethod;
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        stream: &'life1 mut TcpStream
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }
Expand description

This trait is for defining the socks5 authentication method.

Pre-defined authentication methods can be found in the auth module.

You can also create your own authentication method by implementing this trait.

Required Methods

Returns the code for identifying the authentication method in the socks5 handshake header.

The asynchronous authentication procedure on the given stream.

Since GAT is not stabled yet, async_trait needs to be used.

Note that no matter wheather the authentication is successful or not, you don’t need to close the stream.

Implementors