Skip to main content

send_method_selection

Function send_method_selection 

Source
pub async fn send_method_selection<W: AsyncWrite + Unpin>(
    writer: &mut W,
    methods: &[u8],
    password: Option<&str>,
) -> Result<(), Socks5Error>
Expand description

Send a method selection response to the client.

If the client supports AUTH_NONE and no password is required, selects no auth. If password is Some and the client supports username/password auth, selects that. If password is Some but username/password auth was not offered, sends 0xFF (no acceptable methods) so unauthenticated access is never negotiated. Otherwise, sends 0xFF (no acceptable methods).