pub struct SocksListener<S> { /* private fields */ }
Expand description
A listener that accepts TCP connections through a proxy.
use socks5_impl::client::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> Freeze for SocksListener<S>where
S: Freeze,
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