socks5

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AtypIPv4       = 1
	AtypDomainName = 3
	AtypIPv6       = 4
)
View Source
const (
	ErrGeneralFailure       = Error(1)
	ErrConnectionNotAllowed = Error(2)
	ErrNetworkUnreachable   = Error(3)
	ErrHostUnreachable      = Error(4)
	ErrConnectionRefused    = Error(5)
	ErrTTLExpired           = Error(6)
	ErrCommandNotSupported  = Error(7)
	ErrAddressNotSupported  = Error(8)
)

SOCKS errors as defined in RFC 1928 section 6.

View Source
const MaxAddrLen = 1 + 1 + 255 + 2

MaxAddrLen is the maximum size of SOCKS address in bytes.

Variables

This section is empty.

Functions

func EncodeUDPPacket

func EncodeUDPPacket(addr Addr, payload []byte) (packet []byte, err error)

Types

type Addr

type Addr []byte

func ParseAddr

func ParseAddr(s string) Addr

ParseAddr parses the address in string s. Returns nil if failed.

func ParseAddrToSocksAddr

func ParseAddrToSocksAddr(addr net.Addr) Addr

func ReadAddr

func ReadAddr(r io.Reader, b []byte) (Addr, error)

func SplitAddr

func SplitAddr(b []byte) Addr

func (Addr) String

func (a Addr) String() string

func (Addr) UDPAddr

func (a Addr) UDPAddr() *net.UDPAddr

type Error

type Error byte

Error represents a SOCKS error

func (Error) Error

func (err Error) Error() string

Jump to

Keyboard shortcuts

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