socks

package
v0.2.10-2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddrTypeIPv4   = 1
	AddrTypeDomain = 3
	AddrTypeIPv6   = 4
)
View Source
const MaxAddrLen = 1 + 1 + 255 + 2

MaxAddrLen is the maximum length of socks.Addr

Variables

View Source
var (
	ErrInvalidAddrType = errors.New("invalid address type")
	ErrInvalidAddrLen  = errors.New("invalid address length")
)

Functions

func ResolveTCPAddr

func ResolveTCPAddr(addr *Addr) (*net.TCPAddr, error)

func ResolveUDPAddr

func ResolveUDPAddr(addr *Addr) (*net.UDPAddr, error)

Types

type Addr

type Addr struct {
	// contains filtered or unexported fields
}

func ParseAddr

func ParseAddr(addr []byte) (*Addr, error)

func ReadAddr

func ReadAddr(conn io.Reader) (*Addr, error)

func ReadAddrBuffer

func ReadAddrBuffer(conn io.Reader, addr []byte) (*Addr, error)

func ResolveAddr

func ResolveAddr(addr net.Addr) (*Addr, error)

func ResolveAddrBuffer

func ResolveAddrBuffer(addr net.Addr, b []byte) (*Addr, error)

func (*Addr) Append

func (addr *Addr) Append(b []byte) []byte

func (*Addr) AppendTo

func (addr *Addr) AppendTo(b []byte) []byte

func (*Addr) Bytes

func (addr *Addr) Bytes() []byte

func (*Addr) Len

func (addr *Addr) Len() int

func (*Addr) Network

func (*Addr) Network() string

func (*Addr) String

func (addr *Addr) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL