[−][src]Struct async_socks5::SocksListener
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]
S: AsyncWriteExt + AsyncReadExt + Send + Unpin,
pub async fn bind<A>(__arg0: S, addr: A, auth: Option<Auth>) -> Result<Self> where
A: Into<AddrKind>,
[src]
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<(S, AddrKind)>
[src]
Trait Implementations
Auto Trait Implementations
impl<S> RefUnwindSafe for SocksListener<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for SocksListener<S> where
S: Send,
S: Send,
impl<S> Sync for SocksListener<S> where
S: Sync,
S: Sync,
impl<S> Unpin for SocksListener<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for SocksListener<S> where
S: UnwindSafe,
S: UnwindSafe,
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>,