async fn connect_raw<T>(
        socks_server: T,
        target_addr: String,
        target_port: u16,
        auth: Option<AuthenticationMethod>,
        config: Config,
    ) -> Result<Self>
    where
        T: ToSocketAddrs,
    {
        let socket = TcpStream::connect(&socks_server).await?;
        info!("Connected @ {}", &socket.peer_addr()?);

        // Specify the target, here domain name, dns will be resolved on the server side
        let target_addr = (target_addr.as_str(), target_port)
            .to_target_addr()
            .context("Can't convert address to TargetAddr format")?;

        // upgrade the TcpStream to Socks5Stream
        let mut socks_stream = Self::use_stream(socket, auth, config).await?;
        socks_stream.request(target_addr).await?;

        Ok(socks_stream)
    }
/// Process clients SOCKS requests
/// This is the entry point where a whole request is processed.
Process clients SOCKS requests
This is the entry point where a whole request is processed.
Process clients SOCKS requests This is the entry point where a whole request is processed .
async fn connect_raw<T>(
        socks_server: T,
        target_addr: String,
        target_port: u16,
        auth: Option<AuthenticationMethod>,
        config: Config,
    ) -> Result<Self>
    where
        T: ToSocketAddrs,
    {
        let socket = TcpStream::connect(&socks_server).await?;
        info!("Connected @ {}", &socket.peer_addr()?);
        // Specify the target, here domain name, dns will be resolved on the server side
        let target_addr = (target_addr.as_str(), target_port)
            .to_target_addr()
            .context("Can't convert address to TargetAddr format")?;
        // upgrade the TcpStream to Socks5Stream
        let mut socks_stream = Self::use_stream(socket, auth, config).await?;
        socks_stream.request(target_addr).await?;
        Ok(socks_stream)
    }
async fn connect_raw < T > ( socks_server : T , target_addr : String , target_port : u16 , auth : Option < AuthenticationMethod > , config : Config , ) -> Result < Self > where T : ToSocketAddrs , { let socket = TcpStream :: connect ( & socks_server ) . await ? ; info ! ( " " socket peer_addr ( ) ) ; // Specify the target, here domain name, dns will be resolved on the server side let target_addr = ( target_addr . as_str ( ) , target_port ) . to_target_addr ( ) . context ( " " ) ? ; // upgrade the TcpStream to Socks5Stream let mut socks_stream = Self :: use_stream ( socket , auth , config ) . await ? ; socks_stream . request ( target_addr ) . await ? ; Ok ( socks_stream ) }
Process clients SOCKS requests
This is the entry point where a whole request is processed.
Process clients SOCKS requests This is the entry point where a whole request is processed .
socks_server
T
target_addr
String
target_port
u16
auth
Option<AuthenticationMethod>
config
Config
socks_server
T
target_addr
String
target_port
u16
auth
Option<AuthenticationMethod>
config
Config