1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("{0}")]
Io(#[from] std::io::Error),
#[error("{0}")]
ParseError(#[from] std::string::ParseError),
#[error("Target address is invalid: {0}")]
InvalidTargetAddress(&'static str),
#[error("Proxy server unreachable")]
ProxyServerUnreachable,
#[error("Invalid response version")]
InvalidResponseVersion,
#[error("No acceptable auth methods")]
NoAcceptableAuthMethods,
#[error("Unknown auth method")]
UnknownAuthMethod,
#[error("General SOCKS server failure")]
GeneralSocksServerFailure,
#[error("Connection not allowed by ruleset")]
ConnectionNotAllowedByRuleset,
#[error("Network unreachable")]
NetworkUnreachable,
#[error("Host unreachable")]
HostUnreachable,
#[error("Connection refused")]
ConnectionRefused,
#[error("TTL expired")]
TtlExpired,
#[error("Command not supported")]
CommandNotSupported,
#[error("Address type not supported")]
AddressTypeNotSupported,
#[error("Unknown error")]
UnknownError,
#[error("Invalid reserved byte")]
InvalidReservedByte,
#[error("Unknown address type")]
UnknownAddressType,
#[error("Invalid auth values: {0}")]
InvalidAuthValues(&'static str),
#[error("Password auth failure, code: {0}")]
PasswordAuthFailure(u8),
}