[−][src]Struct tokio_socks::tcp::Socks5Listener
A SOCKS5 BIND client.
Once you get an instance of Socks5Listener
, you should send the bind_addr
to the remote process via the primary connection. Then, call the accept
function
and wait for the other end connecting to the rendezvous address.
Methods
impl Socks5Listener
[src]
pub fn bind<'t, P, T>(
proxy: P,
target: T
) -> Result<BindFuture<'static, 't, P::Output>, Error> where
P: ToProxyAddrs,
T: IntoTargetAddr<'t>,
[src]
proxy: P,
target: T
) -> Result<BindFuture<'static, 't, P::Output>, Error> where
P: ToProxyAddrs,
T: IntoTargetAddr<'t>,
Initiates a BIND request to the specified proxy.
The proxy will filter incoming connections based on the value of
target
.
Error
It propagates the error that occurs in the conversion from T
to TargetAddr
.
pub fn bind_with_password<'a, 't, P, T>(
proxy: P,
target: T,
username: &'a str,
password: &'a str
) -> Result<BindFuture<'a, 't, P::Output>, Error> where
P: ToProxyAddrs,
T: IntoTargetAddr<'t>,
[src]
proxy: P,
target: T,
username: &'a str,
password: &'a str
) -> Result<BindFuture<'a, 't, P::Output>, Error> where
P: ToProxyAddrs,
T: IntoTargetAddr<'t>,
Initiates a BIND request to the specified proxy using given username and password.
The proxy will filter incoming connections based on the value of
target
.
Error
It propagates the error that occurs in the conversion from T
to TargetAddr
.
pub fn bind_addr(&self) -> TargetAddr
[src]
Returns the address of the proxy-side TCP listener.
This should be forwarded to the remote process, which should open a connection to it.
pub fn accept(
self
) -> impl Future<Item = Socks5Stream, Error = Error>
[src]
self
) -> impl Future<Item = Socks5Stream, Error = Error>
Consumes this listener, returning a Future
which resolves to the Socks5Stream
connected to the target server through the proxy.
The value of bind_addr
should be forwarded to the remote process
before this method is called.
Auto Trait Implementations
impl Send for Socks5Listener
impl Sync for Socks5Listener
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.