SOCKS5

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BasicNegotiation byte = 0x01
	SocksV4          byte = 0x04
	SocksV5          byte = 0x05
	NoAuthRequired   byte = 0x00
	UsernamePassword byte = 0x02
	Connect          byte = 0x01
	Bind             byte = 0x02
	UDPAssociate     byte = 0x03
	IPv4             byte = 0x01
	DomainName       byte = 0x03
	IPv6             byte = 0x04
)

Variables

View Source
var (
	// SOCKS requests connection responses
	UsernamePasswordSupported = []byte{SocksV5, UsernamePassword}
	NoAuthRequiredSupported   = []byte{SocksV5, NoAuthRequired}
	NoSupportedMethods        = []byte{SocksV5, 0xFF}
	AuthenticationSucceded    = []byte{BasicNegotiation, 0x00}
	AuthenticationFailed      = []byte{SocksV5, 0xFF}
)

Functions

This section is empty.

Types

type Socks5

type Socks5 struct {
	AuthenticationMethod Types.AuthenticationMethod
	LoggingMethod        Types.LoggingMethod
	OutboundFilter       Types.IOFilter
	Dial                 Types.DialFunc
}

func NewSocks5

func NewSocks5(authenticationMethod Types.AuthenticationMethod, loggingMethod Types.LoggingMethod, outboundFilter Types.IOFilter) *Socks5

func (*Socks5) AuthenticateClient

func (socks5 *Socks5) AuthenticateClient(clientConnection net.Conn) (bool, error)

func (*Socks5) Bind

func (socks5 *Socks5) Bind(clientConnection net.Conn) error

func (*Socks5) Connect

func (socks5 *Socks5) Connect(clientConnection net.Conn) error

func (*Socks5) Handle

func (socks5 *Socks5) Handle(clientConnection net.Conn) error

func (*Socks5) SetAuthenticationMethod

func (socks5 *Socks5) SetAuthenticationMethod(authenticationMethod Types.AuthenticationMethod) error

func (*Socks5) SetDial

func (socks5 *Socks5) SetDial(dialFunc Types.DialFunc)

func (*Socks5) SetLoggingMethod

func (socks5 *Socks5) SetLoggingMethod(loggingMethod Types.LoggingMethod) error

func (*Socks5) SetOutboundFilter

func (socks5 *Socks5) SetOutboundFilter(filter Types.IOFilter) error

func (*Socks5) UDPAssociate

func (socks5 *Socks5) UDPAssociate(clientConnection net.Conn) error

func (*Socks5) UsernamePasswordAuthentication

func (socks5 *Socks5) UsernamePasswordAuthentication(clientConnection net.Conn) (bool, error)

Jump to

Keyboard shortcuts

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