Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterEncryptorMaker(name string, f EncryptorMakerFunc)
- type Config
- func (c Config) Get(name string) (interface{}, error)
- func (c Config) GetInt(name string, result *int) error
- func (c Config) GetInt64(name string, result *int64) error
- func (c Config) GetString(name string, str *string) error
- func (c Config) GetSub(name string) (Config, error)
- func (c Config) Has(name string) bool
- type ConfigInvalidType
- type ConfigNotFound
- type Encryptor
- type EncryptorMaker
- type EncryptorMakerFunc
- type IOCopyStat
- type SimpleAuth
- type Socks5ProxyResult
- type SocksAuth
- type Tunnel
- type TunnelSock
Constants ¶
View Source
const ( SocksAddrTypeIPv4 = iota SocksAddrTypeIPv6 SocksAddrTypeDomain )
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 ¶
func RegisterEncryptorMaker ¶
func RegisterEncryptorMaker(name string, f EncryptorMakerFunc)
Types ¶
type ConfigInvalidType ¶
func (*ConfigInvalidType) Error ¶
func (c *ConfigInvalidType) Error() string
type ConfigNotFound ¶
type ConfigNotFound struct {
Item string
}
func (*ConfigNotFound) Error ¶
func (c *ConfigNotFound) Error() string
type EncryptorMaker ¶
func GetEncryptorMaker ¶
func GetEncryptorMaker(name string, cfg Config) (EncryptorMaker, error)
type EncryptorMakerFunc ¶
type EncryptorMakerFunc func(Config) (EncryptorMaker, error)
type IOCopyStat ¶
type IOCopyStat struct {
// contains filtered or unexported fields
}
type SimpleAuth ¶
func NewSimpleAuth ¶
func NewSimpleAuth() SimpleAuth
func (SimpleAuth) Check ¶
func (s SimpleAuth) Check(user, passwd string) bool
type Socks5ProxyResult ¶
func HandleSocks5 ¶
func HandleSocks5(cli net.Conn, tun Tunnel, auth SocksAuth) *Socks5ProxyResult
Click to show internal directories.
Click to hide internal directories.