Versions in this module Expand all Collapse all v0 v0.2.0 Dec 6, 2018 Changes in this version + const AddrDomain + const AddrIPv4 + const AddrIPv6 + const AddrUnsupported + const CmdBind + const CmdConnect + const CmdUdp + const CmdUnsupported + const ConnRefused + const Failure + const HostUnreachable + const MethodGSSAPI + const MethodNoAcceptable + const MethodNoAuth + const MethodUserPass + const NetUnreachable + const NotAllowed + const Succeeded + const TTLExpired + const UserPassVer + const Ver5 + var ErrAuthFailure = errors.New("Auth failure") + var ErrBadAddrType = errors.New("Bad address type") + var ErrBadFormat = errors.New("Bad format") + var ErrBadMethod = errors.New("Bad method") + var ErrBadVersion = errors.New("Bad version") + var ErrShortBuffer = errors.New("Short buffer") + func ReadMethods(r io.Reader) ([]uint8, error) + func WriteMethod(method uint8, w io.Writer) error + type Addr struct + Host string + Port uint16 + Type uint8 + func NewAddr(sa string) (addr *Addr, err error) + func (addr *Addr) Decode(b []byte) error + func (addr *Addr) Encode(b []byte) (int, error) + func (addr *Addr) Length() (n int) + func (addr *Addr) String() string + type Conn struct + func ClientConn(conn net.Conn, selector Selector) *Conn + func ServerConn(conn net.Conn, selector Selector) *Conn + func (conn *Conn) Close() error + func (conn *Conn) Handleshake() error + func (conn *Conn) LocalAddr() net.Addr + func (conn *Conn) Read(b []byte) (n int, err error) + func (conn *Conn) RemoteAddr() net.Addr + func (conn *Conn) SetDeadline(t time.Time) error + func (conn *Conn) SetReadDeadline(t time.Time) error + func (conn *Conn) SetWriteDeadline(t time.Time) error + func (conn *Conn) Write(b []byte) (n int, err error) + type Reply struct + Addr *Addr + Rep uint8 + func NewReply(rep uint8, addr *Addr) *Reply + func ReadReply(r io.Reader) (*Reply, error) + func (r *Reply) String() string + func (r *Reply) Write(w io.Writer) (err error) + type Request struct + Addr *Addr + Cmd uint8 + func NewRequest(cmd uint8, addr *Addr) *Request + func ReadRequest(r io.Reader) (*Request, error) + func (r *Request) String() string + func (r *Request) Write(w io.Writer) (err error) + type Selector interface + Methods func() []uint8 + OnSelected func(method uint8, conn net.Conn) (net.Conn, error) + Select func(methods ...uint8) (method uint8) + type UDPDatagram struct + Data []byte + Header *UDPHeader + func NewUDPDatagram(header *UDPHeader, data []byte) *UDPDatagram + func ReadUDPDatagram(r io.Reader) (*UDPDatagram, error) + func (d *UDPDatagram) Write(w io.Writer) error + type UDPHeader struct + Addr *Addr + Frag uint8 + Rsv uint16 + func NewUDPHeader(rsv uint16, frag uint8, addr *Addr) *UDPHeader + func (h *UDPHeader) String() string + func (h *UDPHeader) Write(w io.Writer) error + type UserPassRequest struct + Password string + Username string + Version byte + func NewUserPassRequest(ver byte, u, p string) *UserPassRequest + func ReadUserPassRequest(r io.Reader) (*UserPassRequest, error) + func (req *UserPassRequest) String() string + func (req *UserPassRequest) Write(w io.Writer) error + type UserPassResponse struct + Status byte + Version byte + func NewUserPassResponse(ver, status byte) *UserPassResponse + func ReadUserPassResponse(r io.Reader) (*UserPassResponse, error) + func (res *UserPassResponse) String() string + func (res *UserPassResponse) Write(w io.Writer) error