[][src]Struct async_socks5::SocksListener

pub struct SocksListener<S> { /* fields omitted */ }

A listener that accepts TCP connections through a proxy.

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

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

Methods

impl<S> SocksListener<S> where
    S: AsyncWriteExt + AsyncReadExt + Send + Unpin
[src]

pub async fn bind<A>(__arg0: S, addr: A, auth: Option<Auth>) -> Result<Self> 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<(S, AddrKind)>[src]

Trait Implementations

impl<S: Debug> Debug for SocksListener<S>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for SocksListener<S> where
    S: RefUnwindSafe

impl<S> Send for SocksListener<S> where
    S: Send

impl<S> Sync for SocksListener<S> where
    S: Sync

impl<S> Unpin for SocksListener<S> where
    S: Unpin

impl<S> UnwindSafe for SocksListener<S> where
    S: UnwindSafe

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.