socks

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidVersion = fmt.Errorf("invalid version")

Functions

This section is empty.

Types

type Auth

type Auth byte
const (
	AuthNone Auth = 0x00

	AuthNotAcceptable Auth = 0xff
)

func (Auth) MarshalText

func (a Auth) MarshalText() ([]byte, error)

func (Auth) String

func (a Auth) String() string

type Command

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

func (Command) MarshalText

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

func (Command) String

func (c Command) String() string

type Greeting

type Greeting struct {
	Version Version
	Auth    []Auth
}

func ReadGreeting

func ReadGreeting(r *bufio.Reader) (*Greeting, error)

func (*Greeting) Write

func (g *Greeting) Write(w io.Writer) error

type GreetingReply

type GreetingReply struct {
	Version Version
	Auth    Auth
}

func ReadGreetingReply

func ReadGreetingReply(r *bufio.Reader) (*GreetingReply, error)

func (*GreetingReply) Write

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

type Reply

type Reply struct {
	Version  Version
	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 {
	Version  Version
	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 = 0x00
	StatusGeneralFailure       Status = 0x01
	StatusConnectionNotAllowed Status = 0x02
	StatusNetworkUnreachable   Status = 0x03
	StatusHostUnreachable      Status = 0x04
	StatusConnectionRefused    Status = 0x05
	StatusTTLExpired           Status = 0x06
	StatusCommandNotSupported  Status = 0x07
	StatusAddrTypeNotSupported Status = 0x08

	StatusNoIdentService Status = iota
	StatusIdentAuthFailure
)

func (Status) MarshalText

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

func (Status) String

func (s Status) String() string

type Version

type Version byte
const (
	V4 Version = 0x04
	V5 Version = 0x05
)

func (Version) MarshalText

func (v Version) MarshalText() ([]byte, error)

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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