[−][src]Struct async_socks5::SocksListener
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]
__arg0: TcpStream,
addr: A,
auth: Option<Auth>
) -> Result<SocksListener> where
A: Into<AddrKind>,
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
Auto Trait Implementations
impl !RefUnwindSafe for SocksListener
impl Send for SocksListener
impl Sync for SocksListener
impl Unpin for SocksListener
impl !UnwindSafe for SocksListener
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,