Error instead of crash on UDP and BIND not supported

This commit is contained in:
Jon Häggblad
2023-09-18 15:41:56 +02:00
parent 63b0658c65
commit 604657c1dc
2 changed files with 8 additions and 2 deletions
@@ -507,8 +507,8 @@ impl SocksClient {
);
}
SocksCommand::Bind => unimplemented!(), // not handled
SocksCommand::UdpAssociate => unimplemented!(), // not handled
SocksCommand::Bind => return Err(SocksProxyError::BindNotSupported), // not handled
SocksCommand::UdpAssociate => return Err(SocksProxyError::UdpNotSupported),
};
Ok(())
@@ -83,6 +83,12 @@ pub enum SocksProxyError {
#[from]
source: Socks5RequestError,
},
#[error("SOCKS5 UDP not (yet) supported")]
UdpNotSupported,
#[error("SOCKS5 BIND not (yet) supported")]
BindNotSupported,
}
/// DST.addr variant types