tools

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoAuthenticationRequired = 0x00
	Gssapi                   = 0x01
	UserAndPassword          = 0x02
	NoAcceptableMethods      = 0xff

	Succeeded                     = 0x00
	SocksServerFailure            = 0x01
	ConnectionNotAllowedByRuleset = 0x02
	NetworkUnreachable            = 0x03
	HostUnreachable               = 0x04
	ConnectionRefused             = 0x05
	TTLExpired                    = 0x06
	CommandNotSupport             = 0x07
	AddressTypeNotSupport         = 0x08
)
View Source
const (
	Connect CMD = 0x01
	Bind    CMD = 0x02
	Udp     CMD = 0x03

	IPv4   byte = 0x01
	Domain byte = 0x03
	IPv6   byte = 0x04

	// MaxAddrLength  domainMaxLen + 0x03 + domainLen + portLen
	MaxAddrLength = 255 + 1 + 1 + 2
)

Variables

This section is empty.

Functions

func DecodeAddr added in v0.3.7

func DecodeAddr(network string, b []byte) (int, netapi.Address, error)

func EncodeAddr added in v0.3.5

func EncodeAddr(addr netapi.Address, buf []byte) int

func ReadAddr added in v0.3.7

func ReadAddr(network string, br *bufio.Reader) (int, netapi.Address, error)

func WriteAddr added in v0.3.8

func WriteAddr(addr netapi.Address, buf io.Writer)

Types

type Addr added in v0.3.5

type Addr []byte

func ParseAddr

func ParseAddr(addr netapi.Address) Addr

func ResolveAddr

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

func (Addr) Address added in v0.3.5

func (a Addr) Address(network string) netapi.Address

type CMD

type CMD byte

Jump to

Keyboard shortcuts

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