socks

package
v0.0.0-...-6f63f7c Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectCommand   = uint8(1)
	BindCommand      = uint8(2)
	AssociateCommand = uint8(3)
	Ipv4Address      = uint8(1)
	FqdnAddress      = uint8(3)
	Ipv6Address      = uint8(4)
)
View Source
const (
	SuccessReply uint8 = iota
	ServerFailure
	RuleFailure
	NetworkUnreachable
	HostUnreachable
	ConnectionRefused
	TTLExpired
	CommandNotSupported
	AddrTypeNotSupported
)
View Source
const (
	NoAuth          = uint8(0)
	NoAcceptable    = uint8(255)
	UserPassAuth    = uint8(2)
	UserAuthVersion = uint8(1)
	AuthSuccess     = uint8(0)
	AuthFailure     = uint8(1)
)
View Source
const (
	BufferSize int = 4 * 1024
)
View Source
const (
	Socks5Version = uint8(5)
)

Variables

This section is empty.

Functions

func GetIface

func GetIface(config Config) (net.IP, *net.Interface)

func RecoverFromPanic

func RecoverFromPanic()

func RunHTTPChallengeServer

func RunHTTPChallengeServer(httpAddr string)

func Start

func Start(config Config)

func TCPConnKeepalive

func TCPConnKeepalive(tcpConn *net.TCPConn, done chan<- bool)

func TLSAKeeplive

func TLSAKeeplive(conn *tls.Conn, done chan<- bool)

Types

type Config

type Config struct {
	LocalAddr   string
	Username    string
	Password    string
	TLSKeyFile  string
	TLSCertFile string
	TLSDomain   string
	TLS         bool
	TLSAuto     bool
	Iface       string
	HttpAddr    string
	Timeout     int
	LdapAuth    bool
	LdapAddr    string
	LdapBaseDN  string
}

func (*Config) SetEnv

func (config *Config) SetEnv()

type Socks5Server

type Socks5Server struct {
	// contains filtered or unexported fields
}

func (*Socks5Server) Start

func (t *Socks5Server) Start()

type UDPRelay

type UDPRelay struct {
	// contains filtered or unexported fields
}

func (*UDPRelay) Start

func (u *UDPRelay) Start() *net.UDPConn

Jump to

Keyboard shortcuts

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