Versions in this module Expand all Collapse all v0 v0.0.9 Dec 1, 2023 v0.0.8 Nov 4, 2023 v0.0.7 Nov 4, 2023 v0.0.6 Nov 1, 2023 Changes in this version + const ATYPDomain + const ATYPIPv4 + const ATYPIPv6 + const AuthFailure + const AuthSuccess + const CommandAssociate + const CommandBind + const CommandConnect + const MethodGSSAPI + const MethodNoAcceptable + const MethodNoAuth + const MethodUserPassAuth + const RepAddrTypeNotSupported + const RepCommandNotSupported + const RepConnectionRefused + const RepHostUnreachable + const RepNetworkUnreachable + const RepRuleFailure + const RepServerFailure + const RepSuccess + const RepTTLExpired + const UserPassAuthVersion + const VersionSocks5 + var ErrNoSupportedAuth = fmt.Errorf("no supported authentication mechanism") + var ErrNotSupportMethod = errors.New("not support method") + var ErrNotSupportVersion = errors.New("not support version") + var ErrUnrecognizedAddrType = errors.New("unrecognized address type") + var ErrUserAuthFailed = fmt.Errorf("user authentication failed") + type AddrSpec struct + AddrType byte + FQDN string + IP net.IP + Port int + func ParseAddrSpec(addr string) (as AddrSpec, err error) + func (sf *AddrSpec) String() string + func (sf AddrSpec) Address() string + type Datagram struct + Data []byte + DstAddr AddrSpec + Frag byte + RSV uint16 + func NewDatagram(destAddr string, data []byte) (p Datagram, err error) + func ParseDatagram(b []byte) (da Datagram, err error) + func (sf *Datagram) Bytes() []byte + func (sf *Datagram) Header() []byte + type MethodReply struct + Method byte + Ver byte + func ParseMethodReply(r io.Reader) (n MethodReply, err error) + type MethodRequest struct + Methods []byte + NMethods byte + Ver byte + func NewMethodRequest(ver byte, medthods []byte) MethodRequest + func ParseMethodRequest(r io.Reader) (mr MethodRequest, err error) + func (sf MethodRequest) Bytes() []byte + type Reply struct + BndAddr AddrSpec + Reserved byte + Response byte + Version byte + func ParseReply(r io.Reader) (rep Reply, err error) + func (sf Reply) Bytes() (b []byte) + type Request struct + Command byte + DstAddr AddrSpec + Reserved byte + Version byte + func ParseRequest(r io.Reader) (req Request, err error) + func (h Request) Bytes() (b []byte) + type UserPassReply struct + Status byte + Ver byte + func ParseUserPassReply(r io.Reader) (upr UserPassReply, err error) + type UserPassRequest struct + Pass []byte + Plen byte + Ulen byte + User []byte + Ver byte + func NewUserPassRequest(ver byte, user, pass []byte) UserPassRequest + func ParseUserPassRequest(r io.Reader) (nup UserPassRequest, err error) + func (sf UserPassRequest) Bytes() []byte