| 1 | package socks5scip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/ |
| 2 | |
| 3 | const ( |
| 4 | // Ver is socks protocol version |
| 5 | Verscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Ver. byte = 0x05 |
| 6 | |
| 7 | // MethodNone is none method |
| 8 | MethodNonescip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/MethodNone. byte = 0x00 |
| 9 | // MethodGSSAPI is gssapi method |
| 10 | MethodGSSAPIscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/MethodGSSAPI. byte = 0x01 // MUST support // todo |
| 11 | // MethodUsernamePassword is username/assword auth method |
| 12 | MethodUsernamePasswordscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/MethodUsernamePassword. byte = 0x02 // SHOULD support |
| 13 | // MethodUnsupportAll means unsupport all given methods |
| 14 | MethodUnsupportAllscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/MethodUnsupportAll. byte = 0xFF |
| 15 | |
| 16 | // UserPassVer is username/password auth protocol version |
| 17 | UserPassVerscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassVer. byte = 0x01 |
| 18 | // UserPassStatusSuccess is success status of username/password auth |
| 19 | UserPassStatusSuccessscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassStatusSuccess. byte = 0x00 |
| 20 | // UserPassStatusFailure is failure status of username/password auth |
| 21 | UserPassStatusFailurescip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassStatusFailure. byte = 0x01 // just other than 0x00 |
| 22 | |
| 23 | // CmdConnect is connect command |
| 24 | CmdConnectscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/CmdConnect. byte = 0x01 |
| 25 | // CmdBind is bind command |
| 26 | CmdBindscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/CmdBind. byte = 0x02 |
| 27 | // CmdUDP is UDP command |
| 28 | CmdUDPscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/CmdUDP. byte = 0x03 |
| 29 | |
| 30 | // ATYPIPv4 is ipv4 address type |
| 31 | ATYPIPv4scip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/ATYPIPv4. byte = 0x01 // 4 octets |
| 32 | // ATYPDomain is domain address type |
| 33 | ATYPDomainscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/ATYPDomain. byte = 0x03 // The first octet of the address field contains the number of octets of name that follow, there is no terminating NUL octet. |
| 34 | // ATYPIPv6 is ipv6 address type |
| 35 | ATYPIPv6scip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/ATYPIPv6. byte = 0x04 // 16 octets |
| 36 | |
| 37 | // RepSuccess means that success for repling |
| 38 | RepSuccessscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/RepSuccess. byte = 0x00 |
| 39 | // RepServerFailure means the server failure |
| 40 | RepServerFailurescip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/RepServerFailure. byte = 0x01 |
| 41 | // RepNotAllowed means the request not allowed |
| 42 | RepNotAllowedscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/RepNotAllowed. byte = 0x02 |
| 43 | // RepNetworkUnreachable means the network unreachable |
| 44 | RepNetworkUnreachablescip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/RepNetworkUnreachable. byte = 0x03 |
| 45 | // RepHostUnreachable means the host unreachable |
| 46 | RepHostUnreachablescip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/RepHostUnreachable. byte = 0x04 |
| 47 | // RepConnectionRefused means the connection refused |
| 48 | RepConnectionRefusedscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/RepConnectionRefused. byte = 0x05 |
| 49 | // RepTTLExpired means the TTL expired |
| 50 | RepTTLExpiredscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/RepTTLExpired. byte = 0x06 |
| 51 | // RepCommandNotSupported means the request command not supported |
| 52 | RepCommandNotSupportedscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/RepCommandNotSupported. byte = 0x07 |
| 53 | // RepAddressNotSupported means the request address not supported |
| 54 | RepAddressNotSupportedscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/RepAddressNotSupported. byte = 0x08 |
| 55 | ) |
| 56 | |
| 57 | // NegotiationRequest is the negotiation reqeust packet |
| 58 | type NegotiationRequestscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/NegotiationRequest# struct { |
| 59 | Verscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/NegotiationRequest#Ver. byte |
| 60 | NMethodsscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/NegotiationRequest#NMethods. byte |
| 61 | Methodsscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/NegotiationRequest#Methods. []byte // 1-255 bytes |
| 62 | } |
| 63 | |
| 64 | // NegotiationReply is the negotiation reply packet |
| 65 | type NegotiationReplyscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/NegotiationReply# struct { |
| 66 | Verscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/NegotiationReply#Ver. byte |
| 67 | Methodscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/NegotiationReply#Method. byte |
| 68 | } |
| 69 | |
| 70 | // UserPassNegotiationRequest is the negotiation username/password reqeust packet |
| 71 | type UserPassNegotiationRequestscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassNegotiationRequest# struct { |
| 72 | Verscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassNegotiationRequest#Ver. byte |
| 73 | Ulenscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassNegotiationRequest#Ulen. byte |
| 74 | Unamescip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassNegotiationRequest#Uname. []byte // 1-255 bytes |
| 75 | Plenscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassNegotiationRequest#Plen. byte |
| 76 | Passwdscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassNegotiationRequest#Passwd. []byte // 1-255 bytes |
| 77 | } |
| 78 | |
| 79 | // UserPassNegotiationReply is the negotiation username/password reply packet |
| 80 | type UserPassNegotiationReplyscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassNegotiationReply# struct { |
| 81 | Verscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassNegotiationReply#Ver. byte |
| 82 | Statusscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/UserPassNegotiationReply#Status. byte |
| 83 | } |
| 84 | |
| 85 | // Request is the request packet |
| 86 | type Requestscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Request# struct { |
| 87 | Verscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Request#Ver. byte |
| 88 | Cmdscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Request#Cmd. byte |
| 89 | Rsvscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Request#Rsv. byte // 0x00 |
| 90 | Atypscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Request#Atyp. byte |
| 91 | DstAddrscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Request#DstAddr. []byte |
| 92 | DstPortscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Request#DstPort. []byte // 2 bytes |
| 93 | } |
| 94 | |
| 95 | // Reply is the reply packet |
| 96 | type Replyscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Reply# struct { |
| 97 | Verscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Reply#Ver. byte |
| 98 | Repscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Reply#Rep. byte |
| 99 | Rsvscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Reply#Rsv. byte // 0x00 |
| 100 | Atypscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Reply#Atyp. byte |
| 101 | // CONNECT socks server's address which used to connect to dst addr |
| 102 | // BIND ... |
| 103 | // UDP socks server's address which used to connect to dst addr |
| 104 | BndAddrscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Reply#BndAddr. []byte |
| 105 | // CONNECT socks server's port which used to connect to dst addr |
| 106 | // BIND ... |
| 107 | // UDP socks server's port which used to connect to dst addr |
| 108 | BndPortscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Reply#BndPort. []byte // 2 bytes |
| 109 | } |
| 110 | |
| 111 | // Datagram is the UDP packet |
| 112 | type Datagramscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Datagram# struct { |
| 113 | Rsvscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Datagram#Rsv. []byte // 0x00 0x00 |
| 114 | Fragscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Datagram#Frag. byte |
| 115 | Atypscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Datagram#Atyp. byte |
| 116 | DstAddrscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Datagram#DstAddr. []byte |
| 117 | DstPortscip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Datagram#DstPort. []byte // 2 bytes |
| 118 | Datascip-go gomod github.com/txthinking/socks5 . `github.com/txthinking/socks5`/Datagram#Data. []byte |
| 119 | } |