socks

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdConnect      = 1
	CmdBind         = 2
	CmdUDPAssociate = 3
)

SOCKS request commands as defined in RFC 1928 section 4

View Source
const (
	AtypIPv4       = 1
	AtypDomainName = 3
	AtypIPv6       = 4
)

SOCKS address types as defined in RFC 1928 section 5.

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

MaxAddrLen is the max size of SOCKS address in bytes: ATYP(1) + DST.ADDR(1 + 253) + DST.PORT(2)

Variables

This section is empty.

Functions

func HandShake

func HandShake(conn net.Conn) (string, int, error)

Types

type Addr

type Addr []byte

Addr represents a SOCKS address as defined in RFC 1928 section 5.

func (Addr) String

func (a Addr) String() string

String serializes SOCKS address a to string form.

type SocksError

type SocksError int
const (
	ErrGeneralFailure SocksError = iota + 1
	ErrConnectionNotAllowed
	ErrNetworkUnreachable
	ErrHostUnreachable
	ErrConnectionRefused
	ErrTTLExpired
	ErrCommandNotSupported
	ErrAddressNotSupported
)

SOCKS errors as defined in RFC 1928 section 6

func (SocksError) Error

func (se SocksError) Error() string

Jump to

Keyboard shortcuts

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