Versions in this module Expand all Collapse all v0 v0.3.2 May 25, 2022 v0.3.1 Apr 19, 2022 v0.3.0 Apr 19, 2022 v0.2.0 Apr 19, 2022 Changes in this version + const AddrTypeDomain + const AddrTypeIPv4 + const AddrTypeIPv6 + const AuthMethodGSSAPI + const AuthMethodNoAcceptableMethods + const AuthMethodNone + const AuthMethodUserPassword + const CmdBind + const CmdConnect + const CmdUdpAssociate + const StatusSucceeded + const UserPasswordFailure + const UserPasswordSuccess + const UserPasswordVer + const Version + func ClientHandshake(conn net.Conn, hostPort string, cmd byte, auths []AuthMethod) error + func ClientHandshakeTimeout(conn net.Conn, hostPort string, cmd byte, auths []AuthMethod, ...) error + func Dial(network, address, hostPort string, auths []AuthMethod) (net.Conn, error) + func DialTimeout(network, address, hostPort string, auths []AuthMethod, timeout time.Duration) (net.Conn, error) + func ParseHostPort(addrType byte, addr []byte, port []byte) (hostPort string, err error) + func ServerHandshake(conn net.Conn, auths []AuthMethod) (string, error) + func ServerHandshakeTimeout(conn net.Conn, auths []AuthMethod, timeout time.Duration) (string, error) + type AuthMethod interface + Auth func(rw io.ReadWriter) error + Method func() byte + type AuthNone int + func NewAuthNone() *AuthNone + func (a *AuthNone) Auth(io.ReadWriter) error + func (a *AuthNone) Method() byte + type AuthUserPassword struct + Password string + User string + func NewAuthUserPassword(user, password string) *AuthUserPassword + func (a *AuthUserPassword) Auth(rw io.ReadWriter) error + func (a *AuthUserPassword) Method() byte + type AuthUserPasswordServer struct + Map map[string]string + Reply bool + func NewAuthUserPasswordServer(m map[string]string, reply bool) *AuthUserPasswordServer + func (a *AuthUserPasswordServer) Auth(rw io.ReadWriter) error + func (a *AuthUserPasswordServer) Method() byte + type HelloRequest struct + Methods []byte + NMethods byte + Ver byte + func (hr *HelloRequest) FlushTo(w io.Writer) error + func (hr *HelloRequest) ParseFrom(r io.Reader) error + func (hr *HelloRequest) Size() int + type HelloResponse struct + Method byte + Ver byte + func (hr *HelloResponse) FlushTo(w io.Writer) error + func (hr *HelloResponse) ParseFrom(r io.Reader) error + func (hr *HelloResponse) Size() int + type Listener struct + func Listen(network, address string, auths []AuthMethod) (*Listener, error) + func ListenTimeout(network, address string, auths []AuthMethod, timeout time.Duration) (*Listener, error) + func (l *Listener) Accept() (conn net.Conn, hostPort string, err error) + func (l *Listener) AcceptResponse(responseCreate func(localAddress string, err error) *Response) (conn net.Conn, hostPort string, err error) + type ReplyCode int + func (code ReplyCode) String() string + type Request struct + AddrType byte + Cmd byte + DstAddr []byte + DstPort []byte + Rsv byte + Ver byte + func (req *Request) FlushTo(w io.Writer) error + func (req *Request) ParseFrom(r io.Reader) error + func (req *Request) Size() int + type Response struct + AddrType byte + BndAddr []byte + BndPort []byte + Rep byte + Rsv byte + Ver byte + func (res *Response) FlushTo(w io.Writer) error + func (res *Response) ParseFrom(r io.Reader) error + func (res *Response) Size() int