tinysocks

package
v0.22.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: GPL-3.0 Imports: 4 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 (
	ErrGeneralFailure       = Error(1)
	ErrConnectionNotAllowed = Error(2)
	ErrNetworkUnreachable   = Error(3)
	ErrHostUnreachable      = Error(4)
	ErrConnectionRefused    = Error(5)
	ErrTTLExpired           = Error(6)
	ErrCommandNotSupported  = Error(7)
	ErrAddressNotSupported  = Error(8)
	InfoUDPAssociate        = Error(9)
)

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 CompleteRequestTCP added in v0.17.0

func CompleteRequestTCP(errcode byte, conn io.ReadWriteCloser) error

Reply to client abount condition of proxy target

Types

type Addr added in v0.17.0

type Addr []byte

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

func Client added in v0.17.0

func Client(rw io.ReadWriter, ad Addr, conntype int) (error, Addr)

Client outbounds SOCKS5 requests.

func ParseAddr added in v0.17.0

func ParseAddr(s string) Addr

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

func ReadAddr added in v0.17.0

func ReadAddr(r io.Reader) (Addr, error)

ReadAddr reads just enough bytes from r to get a valid Addr.

func ReadRequest

func ReadRequest(rw io.ReadWriter) (byte, Addr, error)

Handshake fast-tracks SOCKS initialization to get target address to connect.

func SplitAddr added in v0.17.0

func SplitAddr(b []byte) Addr

SplitAddr slices a SOCKS address from beginning of b. Returns nil if failed.

func (Addr) String added in v0.17.0

func (a Addr) String() string

String serializes SOCKS address a to string form.

type Error added in v0.17.0

type Error byte

Error represents a SOCKS error

func (Error) Error added in v0.17.0

func (err Error) Error() string

Jump to

Keyboard shortcuts

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