Struct UsernamePasswordRequest
pub struct UsernamePasswordRequest {
pub version: UsernamePasswordSubnegotiationVersion,
pub basic: Basic,
}Expand description
Initial username-password negotiation starts with the client sending this request.
Once the SOCKS V5 server has started, and the client has selected the Username/Password Authentication protocol, the Username/Password subnegotiation begins. This begins with the client producing a Username/Password request:
+----+------+----------+------+----------+
|VER | ULEN | UNAME | PLEN | PASSWD |
+----+------+----------+------+----------+
| 1 | 1 | 1 to 255 | 1 | 1 to 255 |
+----+------+----------+------+----------+The VER field contains the current version of the subnegotiation, which is X’01’. The ULEN field contains the length of the UNAME field that follows. The UNAME field contains the username as known to the source operating system. The PLEN field contains the length of the PASSWD field that follows. The PASSWD field contains the password association with the given UNAME.
Reference: https://datatracker.ietf.org/doc/html/rfc1929#section-2
§Security Considerations
Since the request carries the password in cleartext, this subnegotiation is not recommended for environments where “sniffing” is possible and practical.
Fields§
§version: UsernamePasswordSubnegotiationVersion§basic: BasicImplementations§
§impl UsernamePasswordRequest
impl UsernamePasswordRequest
pub fn new(basic: Basic) -> UsernamePasswordRequest
pub fn new(basic: Basic) -> UsernamePasswordRequest
Create a new UsernamePasswordRequest.
pub async fn read_from<R>(
r: &mut R,
) -> Result<UsernamePasswordRequest, ProtocolError>where
R: AsyncRead + Unpin,
pub async fn read_from<R>(
r: &mut R,
) -> Result<UsernamePasswordRequest, ProtocolError>where
R: AsyncRead + Unpin,
Read the client UsernamePasswordRequest, decoded from binary format as specified by RFC 1929 from the reader.
Trait Implementations§
§impl Clone for UsernamePasswordRequest
impl Clone for UsernamePasswordRequest
§fn clone(&self) -> UsernamePasswordRequest
fn clone(&self) -> UsernamePasswordRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for UsernamePasswordRequest
impl Debug for UsernamePasswordRequest
§impl PartialEq<UsernamePasswordRequest> for UsernamePasswordRequestRef<'_>
impl PartialEq<UsernamePasswordRequest> for UsernamePasswordRequestRef<'_>
§impl PartialEq<UsernamePasswordRequestRef<'_>> for UsernamePasswordRequest
impl PartialEq<UsernamePasswordRequestRef<'_>> for UsernamePasswordRequest
§impl PartialEq for UsernamePasswordRequest
impl PartialEq for UsernamePasswordRequest
impl Eq for UsernamePasswordRequest
impl StructuralPartialEq for UsernamePasswordRequest
Auto Trait Implementations§
impl Freeze for UsernamePasswordRequest
impl RefUnwindSafe for UsernamePasswordRequest
impl Send for UsernamePasswordRequest
impl Sync for UsernamePasswordRequest
impl Unpin for UsernamePasswordRequest
impl UnwindSafe for UsernamePasswordRequest
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more