pub struct SocksProxyHandshake {
state: State,
socks5_auth: Option<SocksAuth>,
handshake: Option<SocksRequest>,
}
proxy-handshake
only.Expand description
The Proxy (responder) side of an ongoing SOCKS handshake.
Create you have one of these with SocksProxyHandshake::new()
,
and then use Handshake::step
to drive it.
Eventually you will hopefully obtain a SocksRequest
,
on which you should call .reply()
,
and send the resulting data to the peer.
Fields§
§state: State
Current state of the handshake. Each completed message advances the state.
socks5_auth: Option<SocksAuth>
SOCKS5 authentication that has been received (but not yet put in a SocksRequest object.)
handshake: Option<SocksRequest>
Completed SOCKS handshake.
Implementations§
Source§impl SocksProxyHandshake
impl SocksProxyHandshake
Sourcefn s4(&mut self, r: &mut Reader<'_>) -> Result<ImplNextStep>
fn s4(&mut self, r: &mut Reader<'_>) -> Result<ImplNextStep>
Complete a socks4 or socks4a handshake.
Sourcefn s5_initial(&mut self, r: &mut Reader<'_>) -> Result<ImplNextStep>
fn s5_initial(&mut self, r: &mut Reader<'_>) -> Result<ImplNextStep>
Socks5: initial handshake to negotiate authentication method.
Sourcefn s5_uname(&mut self, r: &mut Reader<'_>) -> Result<ImplNextStep>
fn s5_uname(&mut self, r: &mut Reader<'_>) -> Result<ImplNextStep>
Socks5: second step for username/password authentication.
Sourcefn s5(&mut self, r: &mut Reader<'_>) -> Result<ImplNextStep>
fn s5(&mut self, r: &mut Reader<'_>) -> Result<ImplNextStep>
Socks5: final step, to receive client’s request.
Sourcepub fn into_request(self) -> Option<SocksRequest>
pub fn into_request(self) -> Option<SocksRequest>
Consume this handshake’s state; if it finished successfully, return a SocksRequest.
Trait Implementations§
Source§impl Clone for SocksProxyHandshake
impl Clone for SocksProxyHandshake
Source§fn clone(&self) -> SocksProxyHandshake
fn clone(&self) -> SocksProxyHandshake
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SocksProxyHandshake
impl Debug for SocksProxyHandshake
Source§impl Default for SocksProxyHandshake
impl Default for SocksProxyHandshake
Source§impl Handshake for SocksProxyHandshake
impl Handshake for SocksProxyHandshake
Source§type Output = <Option<SocksRequest> as IntoIterator>::Item
type Output = <Option<SocksRequest> as IntoIterator>::Item
proxy-handshake
or client-handshake
only.Source§impl HandshakeImpl for SocksProxyHandshake
impl HandshakeImpl for SocksProxyHandshake
Source§fn handshake_impl(&mut self, input: &mut Reader<'_>) -> Result<ImplNextStep>
fn handshake_impl(&mut self, input: &mut Reader<'_>) -> Result<ImplNextStep>
proxy-handshake
or client-handshake
only.Source§fn call_handshake_impl(&mut self, input: &[u8]) -> (usize, Result<ImplNextStep>)
fn call_handshake_impl(&mut self, input: &[u8]) -> (usize, Result<ImplNextStep>)
proxy-handshake
or client-handshake
only.handshake_impl
. Read moreSource§impl HasHandshakeOutput<<Option<SocksRequest> as IntoIterator>::Item> for SocksProxyHandshake
impl HasHandshakeOutput<<Option<SocksRequest> as IntoIterator>::Item> for SocksProxyHandshake
Source§fn take_output(
&mut self,
) -> Option<<Option<SocksRequest> as IntoIterator>::Item>
fn take_output( &mut self, ) -> Option<<Option<SocksRequest> as IntoIterator>::Item>
proxy-handshake
or client-handshake
only..handshake
Read moreSource§impl HasHandshakeState for SocksProxyHandshake
impl HasHandshakeState for SocksProxyHandshake
Source§fn set_failed(&mut self)
fn set_failed(&mut self)
proxy-handshake
or client-handshake
only.Failed
Auto Trait Implementations§
impl Freeze for SocksProxyHandshake
impl RefUnwindSafe for SocksProxyHandshake
impl Send for SocksProxyHandshake
impl Sync for SocksProxyHandshake
impl Unpin for SocksProxyHandshake
impl UnwindSafe for SocksProxyHandshake
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more