socks4

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const VersionCode = 0x04

Variables

View Source
var (
	ErrInvalidVersion = errors.New("invalid version")
)

Functions

This section is empty.

Types

type Command

type Command byte
const (
	CommandConnect Command = 0x01
	CommandBind    Command = 0x02
)

func (Command) MarshalText

func (c Command) MarshalText() ([]byte, error)

func (Command) String

func (c Command) String() string

type Reply

type Reply struct {
	Status   Status
	BindAddr addr.Addr
}

func ReadReply

func ReadReply(r *bufio.Reader) (*Reply, error)

func (*Reply) Write

func (r *Reply) Write(w io.Writer) error

type Request

type Request struct {
	Command  Command
	DstAddr  addr.Addr
	Username string
}

func ReadRequest

func ReadRequest(r *bufio.Reader) (*Request, error)

func (*Request) Write

func (r *Request) Write(w io.Writer) error

type Status

type Status byte
const (
	StatusGranted          Status = 0x5a
	StatusRejectedOrFailed Status = 0x5b
	StatusNoAuthService    Status = 0x5c
	StatusAuthFailed       Status = 0x5d
)

func (Status) MarshalText

func (s Status) MarshalText() ([]byte, error)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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