socks

package
v0.0.0-...-b4cf14d Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AddrTypeIPv4 is ...
	AddrTypeIPv4 = 1
	// AddrTypeDomain is ...
	AddrTypeDomain = 3
	// AddrTypeIPv6 is ...
	AddrTypeIPv6 = 4
)
View Source
const (
	// CmdConnect is ..
	CmdConnect = 1
	// CmdAssociate is ...
	CmdAssociate = 3
	// AuthNone is ...
	AuthNone = 0
	// AuthUserPass is ...
	AuthUserPass = 2
)
View Source
const (
	// ErrSuccess is ...
	ErrSuccess = Error(0)
	// ErrGeneralFailure is ...
	ErrGeneralFailure = Error(1)
	// ErrConnectionNotAllowed is ...
	ErrConnectionNotAllowed = Error(2)
	// ErrNetworkUnreachable is ...
	ErrNetworkUnreachable = Error(3)
	// ErrHostUnreachable is ...
	ErrHostUnreachable = Error(4)
	// ErrConnectionRefused is ...
	ErrConnectionRefused = Error(5)
	// ErrTTLExpired is ...
	ErrTTLExpired = Error(6)
	// ErrCommandNotSupported is ...
	ErrCommandNotSupported = Error(7)
	// ErrAddressNotSupported is ...
	ErrAddressNotSupported = Error(8)
)
View Source
const MaxAddrLen = 1 + 1 + 255 + 2

MaxAddrLen is the maximum length of socks.Addr

Variables

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

Functions

func Handshake

func Handshake(conn net.Conn, tgt string, cmd byte, auth *proxy.Auth) (net.Conn, error)

Handshake (client side) is to talk to server

func ResolveTCPAddr

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

ResolveTCPAddr is ...

func ResolveUDPAddr

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

ResolveUDPAddr is ...

Types

type Addr

type Addr struct {
	Addr []byte
}

Addr is ...

func ParseAddr

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

ParseAddr is ...

func ReadAddr

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

ReadAddr is ....

func ReadAddrBuffer

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

ReadAddrBuffer is ...

func ResolveAddr

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

ResolveAddr is ...

func ResolveAddrBuffer

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

ResolveAddrBuffer is ...

func (*Addr) Network

func (*Addr) Network() string

Network is ...

func (*Addr) String

func (addr *Addr) String() string

String is ...

type Error

type Error byte

Error is ...

func (Error) Error

func (e Error) Error() string

Error is ...

type StringAddr

type StringAddr struct {
	Addr string
}

func (*StringAddr) Network

func (*StringAddr) Network() string

func (*StringAddr) String

func (addr *StringAddr) String() string

Jump to

Keyboard shortcuts

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