socks

package
v0.0.0-...-a0e9eea Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CMD_CONNECT = iota + 1
	CMD_BIND
	CMD_UDP_ASSOCIATE
)
View Source
const (
	ATYP_IPV4 = iota + 1

	ATYP_DOMAINNAME
	ATYP_IPV6
)
View Source
const (
	REP_SUCC = iota
	REP_GENERAL_SERVER_FAILURE
	REP_CONNECTION_NOT_ALLOWED
	REP_NETWORK_UNREACHABLE
	REP_HOST_UNREACHABLE
	REP_CONNECTION_REFUSED
	REP_TTL_EXPIRED
	REP_COMMAND_NOT_SUPPORTED
	REP_ADDRESS_TYPE_NOT_SUPPORTED
	REP_UNASSIGNED_START
)
View Source
const VER = 5

Variables

This section is empty.

Functions

func ExchangeMetadata

func ExchangeMetadata(rw io.ReadWriter) (err error)

func Handshake

func Handshake(c io.ReadWriter) (addr string, err error)

func SendReply

func SendReply(r Reply, w io.Writer) (err error)

Types

type Reply

type Reply struct {
	VER, REP, ATYP byte
	BND_ADDR       net.IP
	BND_PORT       int
}

type Request

type Request struct {
	VER, CMD, ATYP byte
	DST_ADDR       string
	DST_PORT       int
}

func ReceiveRequest

func ReceiveRequest(r io.Reader) (res Request, err error)

Jump to

Keyboard shortcuts

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