socks5

package
v0.6.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: GPL-2.0 Imports: 9 Imported by: 23

Documentation

Index

Constants

View Source
const (
	Version byte = 5

	AuthTypeNotRequired       byte = 0x00
	AuthTypeGSSAPI            byte = 0x01
	AuthTypeUsernamePassword  byte = 0x02
	AuthTypeNoAcceptedMethods byte = 0xFF

	UsernamePasswordStatusSuccess byte = 0x00
	UsernamePasswordStatusFailure byte = 0x01

	CommandConnect      byte = 0x01
	CommandBind         byte = 0x02
	CommandUDPAssociate byte = 0x03

	ReplyCodeSuccess                byte = 0
	ReplyCodeFailure                byte = 1
	ReplyCodeNotAllowed             byte = 2
	ReplyCodeNetworkUnreachable     byte = 3
	ReplyCodeHostUnreachable        byte = 4
	ReplyCodeConnectionRefused      byte = 5
	ReplyCodeTTLExpired             byte = 6
	ReplyCodeUnsupported            byte = 7
	ReplyCodeAddressTypeUnsupported byte = 8
)

Variables

This section is empty.

Functions

func ReplyCodeForError

func ReplyCodeForError(err error) byte

func WriteAuthRequest

func WriteAuthRequest(writer io.Writer, request AuthRequest) error

func WriteAuthResponse

func WriteAuthResponse(writer io.Writer, response AuthResponse) error

func WriteRequest

func WriteRequest(writer io.Writer, request Request) error

func WriteResponse

func WriteResponse(writer io.Writer, response Response) error

func WriteUsernamePasswordAuthRequest

func WriteUsernamePasswordAuthRequest(writer io.Writer, request UsernamePasswordAuthRequest) error

func WriteUsernamePasswordAuthResponse

func WriteUsernamePasswordAuthResponse(writer io.Writer, response UsernamePasswordAuthResponse) error

Types

type AuthRequest

type AuthRequest struct {
	Methods []byte
}

func ReadAuthRequest

func ReadAuthRequest(reader varbin.Reader) (request AuthRequest, err error)

func ReadAuthRequest0

func ReadAuthRequest0(reader varbin.Reader) (request AuthRequest, err error)

type AuthResponse

type AuthResponse struct {
	Method byte
}

func ReadAuthResponse

func ReadAuthResponse(reader varbin.Reader) (response AuthResponse, err error)

type Request

type Request struct {
	Command     byte
	Destination M.Socksaddr
}

func ReadRequest

func ReadRequest(reader varbin.Reader) (request Request, err error)

type Response

type Response struct {
	ReplyCode byte
	Bind      M.Socksaddr
}

func ReadResponse

func ReadResponse(reader varbin.Reader) (response Response, err error)

type UsernamePasswordAuthRequest

type UsernamePasswordAuthRequest struct {
	Username string
	Password string
}

func ReadUsernamePasswordAuthRequest

func ReadUsernamePasswordAuthRequest(reader varbin.Reader) (request UsernamePasswordAuthRequest, err error)

type UsernamePasswordAuthResponse

type UsernamePasswordAuthResponse struct {
	Status byte
}

func ReadUsernamePasswordAuthResponse

func ReadUsernamePasswordAuthResponse(reader varbin.Reader) (response UsernamePasswordAuthResponse, err error)

Jump to

Keyboard shortcuts

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