socks

package
v0.0.0-...-c6c2a2c Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package socks implements essential parts of SOCKS protocol.

Index

Constants

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

SOCKS address types as defined in RFC 1928 section 5.

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

MaxAddrLen is the maximum size of SOCKS address in bytes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr []byte

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

func ParseAddr

func ParseAddr(s string) Addr

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

func ReadAddr

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

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

func (Addr) IPString

func (a Addr) IPString() string

String serializes SOCKS address a to string form.

func (Addr) String

func (a Addr) String() string

String serializes SOCKS address a to string form.

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