socks5

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package socks5 offers protocol operations.

Index

Constants

View Source
const (
	AUTHNONE     byte = 0
	AUTHPASSWORD byte = 2
)

SOCKS auth type.

View Source
const (
	CmdConnect = 1
	CmdBind    = 2
	CmdUDP     = 3
)

SOCKS address types.

View Source
const (
	ATypeIPv4   = 1
	ATypeDomain = 3
	ATypeIPv6   = 4
)

SOCKS address types.

Variables

This section is empty.

Functions

func Authorize

func Authorize(w io.Writer, rd *bufio.Reader) (err error)

Authorize a client permission to proceed.

Types

type Request

type Request struct {
	Ver         byte
	Cmd         byte
	AddrType    byte
	DestHost    string
	DestPort    string
	PacketData  socks.Packet
	RequestData socks.Packet
	Responsed   bool
}

Request struct.

func ParseRequest

func ParseRequest(rd *bufio.Reader) (req *Request, err error)

ParseRequest parses a request.

func (*Request) Command

func (r *Request) Command() (m string)

Command requested by.

func (*Request) GetRequest

func (r *Request) GetRequest(w io.Writer, rd *bufio.Reader) (err error)

GetRequest requests the ClientHello for sending to a remote server. RCWN (Race Cache With Network) or ads blockers would abort dial-in without sendig ClientHello! Drop it.

func (*Request) Host

func (r *Request) Host() string

Host requested to.

func (*Request) Hostname

func (r *Request) Hostname() string

Hostname only requested to.

func (*Request) Port

func (r *Request) Port() string

Port requested to.

func (*Request) Request

func (r *Request) Request(fw *forwarder.Forwarder, _, seg bool) (restart bool, err error)

Request to a upstream server.

func (*Request) Target

func (r *Request) Target() string

Target URL requested to.

Jump to

Keyboard shortcuts

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