Versions in this module Expand all Collapse all v0 v0.0.1 Nov 5, 2023 v0.0.0 Nov 5, 2023 Changes in this version + const ATYPDOMAIN + const ATYPV4 + const ATYPV6 + const ChanCap + const CmdASSOC + const CmdBIND + const CmdCONNECT + const MethodCHAP + const MethodCRAM + const MethodGSSAPI + const MethodJRB + const MethodMAF + const MethodNDS + const MethodNoAccepted + const MethodNoAuth + const MethodSSL + const MethodUsrPwd + const PeriodAutoDeny + const PeriodClose + const RSV + const RepAddrTypeNotSupported + const RepCmdNotSupported + const RepConnNotAllowedByRuleset + const RepConnRefused + const RepGeneralFailure + const RepHostUnreachable + const RepNetworkUnreachable + const RepSucceeded + const RepTtlExpired + const SeverityDebug + const SeverityError + const SeverityInfo + const SeverityWarning + const UsrPwdStatSuccess + const VerSOCKS5 + const VerUsrPwd + var ErrAcceptOrDenyFailed = errors.New("request already handled") + var ErrAuthFailed = errors.New("auth failed") + var ErrDuplicatedRequest = errors.New("duplicated request with same parameters") + var ErrMalformed = errors.New("malformed") + func Connect(req *ConnectRequest) error + func Listen(addr string, ml *MidLayer) error + type ATYPNotSupportedError byte + func (e ATYPNotSupportedError) Error() string + func (e ATYPNotSupportedError) Is(target error) bool + func (e ATYPNotSupportedError) Unwrap() error + type AddrPort struct + Addr []byte + Port uint16 + Protocol string + Type byte + func ParseAddrPort(s string) (*AddrPort, error) + func (a *AddrPort) Equal(x *AddrPort) bool + func (a *AddrPort) Host() string + func (a *AddrPort) MarshalBinary() (data []byte, err error) + func (a *AddrPort) Network() string + func (a *AddrPort) String() string + type AssocRequest struct + func (r *AssocRequest) Accept(addr string, notify func(reason error)) (terminate func() error, ok bool) + type Associator struct + Hostname string + func (a *Associator) Handle(req *AssocRequest, addr string) error + type BindRequest struct + func (r *BindRequest) Accept(addr string) (ok bool) + func (r *BindRequest) Bind(conn net.Conn) (ok bool) + func (r *BindRequest) DenyBind(rep byte, addr string) (ok bool) + type Binder struct + Hostname string + func (b *Binder) Handle(req *BindRequest, addr string, timeout time.Duration) error + type Capsulator interface + DecapPacket func(p []byte) ([]byte, error) + EncapPacket func(p []byte) ([]byte, error) + type CmdNotSupportedError byte + func (e CmdNotSupportedError) Error() string + func (e CmdNotSupportedError) Is(target error) bool + func (e CmdNotSupportedError) Unwrap() error + type ConnectRequest struct + func (r *ConnectRequest) Accept(conn net.Conn) (ok bool) + type Handshake struct + func (hs *Handshake) Accept(method byte, neg Subnegotiator) (ok bool) + func (hs *Handshake) Deny() (ok bool) + func (hs *Handshake) LocalAddr() net.Addr + func (hs *Handshake) Methods() []byte + func (hs *Handshake) RemoteAddr() net.Addr + func (hs *Handshake) UUID() uuid.UUID + type LogEntry struct + Err error + Severity string + Time time.Time + Verbosity int + func (e *LogEntry) Error() string + func (e *LogEntry) String() string + func (e *LogEntry) Unwrap() error + type MidLayer struct + func (ml *MidLayer) Close() error + func (ml *MidLayer) HandshakeChan() <-chan *Handshake + func (ml *MidLayer) LogChan() <-chan LogEntry + func (ml *MidLayer) RequestChan() <-chan any + func (ml *MidLayer) ServeClient(conn net.Conn) error + type NoAuthSubneg struct + func (n NoAuthSubneg) Negotiate(rw io.ReadWriter) (Capsulator, error) + func (n NoAuthSubneg) Type() string + type NoCap struct + func (c NoCap) DecapPacket(p []byte) ([]byte, error) + func (c NoCap) EncapPacket(p []byte) ([]byte, error) + func (c NoCap) Read(p []byte) (n int, err error) + func (c NoCap) Write(p []byte) (n int, err error) + type OpError struct + Err error + LocalAddr net.Addr + Op string + RemoteAddr net.Addr + func (e *OpError) Error() string + func (e *OpError) Unwrap() error + type RelayError struct + Client2HostErr error + ClientLocalAddr net.Addr + ClientRemoteAddr net.Addr + Host2ClientErr error + HostLocalAddr net.Addr + HostRemoteAddr net.Addr + func (e *RelayError) Error() string + func (e *RelayError) Unwrap() (errs []error) + type Request struct + func (r *Request) Capsulation() Capsulator + func (r *Request) Deny(rep byte, addr string) (ok bool) + func (r *Request) Dst() *AddrPort + func (r *Request) LocalAddr() net.Addr + func (r *Request) RemoteAddr() net.Addr + func (r *Request) UUID() uuid.UUID + type RequestNotHandledError struct + Timeout bool + Type string + func (e *RequestNotHandledError) Error() string + type RsvViolationError byte + func (e RsvViolationError) Error() string + func (e RsvViolationError) Is(target error) bool + type Subnegotiator interface + Negotiate func(io.ReadWriter) (Capsulator, error) + Type func() string + type UsrPwdSubneg struct + List [][][]byte + func (n UsrPwdSubneg) Negotiate(rw io.ReadWriter) (c Capsulator, err error) + func (n UsrPwdSubneg) Type() string + type UsrPwdVerIncorrectError byte + func (e UsrPwdVerIncorrectError) Error() string + func (e UsrPwdVerIncorrectError) Is(target error) bool + type VerIncorrectError byte + func (e VerIncorrectError) Error() string + func (e VerIncorrectError) Is(target error) bool