socks5

package
v0.0.0-...-7f29b95 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2014 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const SocksUPCheckVersion = 1
View Source
const SocksVersion = 5

Variables

View Source
var (
	SocksAuthNotRequired         = []byte{SocksVersion, 0}
	SocksAuthUserPasswd          = []byte{SocksVersion, 2}
	SocksAuthMethodNotMatch      = []byte{SocksVersion, 0xFF}
	SocksUPAuthSuccess           = []byte{SocksUPCheckVersion, 0}
	SocksUPAuthFail              = []byte{SocksUPCheckVersion, 1}
	SocksReplySuccess            = []byte{SocksVersion, 0, 0, 1, 0, 0, 0, 0, 0, 0}
	SocksReplyServerFail         = []byte{SocksVersion, 1, 0, 1, 0, 0, 0, 0, 0, 0}
	SocksReplyNotAllowed         = []byte{SocksVersion, 2, 0, 1, 0, 0, 0, 0, 0, 0}
	SocksReplyNetworkUnreachable = []byte{SocksVersion, 3, 0, 1, 0, 0, 0, 0, 0, 0}
	SocksReplyHostUnreachable    = []byte{SocksVersion, 4, 0, 1, 0, 0, 0, 0, 0, 0}
	SocksReplyRefused            = []byte{SocksVersion, 5, 0, 1, 0, 0, 0, 0, 0, 0}
	SocksReplyTTLExpired         = []byte{SocksVersion, 6, 0, 1, 0, 0, 0, 0, 0, 0}
	SocksReplyInvalidCommand     = []byte{SocksVersion, 7, 0, 1, 0, 0, 0, 0, 0, 0}
	SocksReplyInvalidAddrType    = []byte{SocksVersion, 8, 0, 1, 0, 0, 0, 0, 0, 0}
)

Functions

This section is empty.

Types

type SimpleAuth

type SimpleAuth map[string]string

func NewSimpleAuth

func NewSimpleAuth() SimpleAuth

func (SimpleAuth) Check

func (s SimpleAuth) Check(user, passwd string) bool

type Socks5Server

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

func NewSocks5Server

func NewSocks5Server(addr string, t SocksTunnel, auth SocksAuth) (*Socks5Server, error)

func (*Socks5Server) Run

func (ss *Socks5Server) Run()

type SocksAuth

type SocksAuth interface {
	Check(user, passwd string) bool
}

type SocksTunnel

type SocksTunnel interface {
	DoDomainProxy(domain string, port int, rw io.ReadWriteCloser)
	DoIPProxy(addr []byte, port int, rw io.ReadWriteCloser)
}

Jump to

Keyboard shortcuts

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