Struct async_socks5::SocksListener
source · pub struct SocksListener<S> { /* private fields */ }
Expand description
A listener that accepts TCP connections through a proxy.
use async_socks5::SocksListener;
use tokio::{io::BufStream, net::TcpStream};
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?;
Implementations§
source§impl<S> SocksListener<S>
impl<S> SocksListener<S>
Trait Implementations§
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more