[][src]Struct async_socks5::SocksListener

pub struct SocksListener { /* fields omitted */ }

A listener that accepts TCP connections through a proxy.

use tokio::net::TcpStream;
use async_socks5::SocksListener;

let mut stream = TcpStream::connect("my-proxy-server.com:54321").await?;
let (stream, addr) = SocksListener::bind(stream, ("ftp-server.org", 21), None).await?.accept().await?;

Methods

impl SocksListener[src]

pub async fn bind<A>(
    __arg0: TcpStream,
    addr: A,
    auth: Option<Auth>
) -> Result<SocksListener> where
    A: Into<AddrKind>, 
[src]

Creates SocksListener. Performs the BIND command under the hood.

pub fn proxy_addr(&self) -> &AddrKind[src]

pub async fn accept(__arg0: Self) -> Result<(TcpStream, AddrKind)>[src]

Trait Implementations

impl Debug for SocksListener[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.