Error instead of crash on UDP and BIND not supported
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user