Versions in this module Expand all Collapse all v1 v1.0.10 Oct 18, 2017 Changes in this version + const AUTH_HEADER + const CANNOT_READ_BUF + const DO_HTTP + const DO_SOCKS5 + const HOST_HTTP_CONNECT + const HOST_HTTP_FORWARD + const HOST_IPV6 + const HOST_SOCKS_CONNECT + const IV_LENGTH + const NOT_SOCKS5 + const SOCKS5_VERSION + const SOCKS_TYPE_Dm + const SOCKS_TYPE_IPv4 + const SOCKS_TYPE_IPv6 + const SSL_RECORD_MAX + const STREAM_BUFFER_SIZE + const TCP_TIMEOUT + const UDP_TIMEOUT + const UOT_HEADER + var DUMMY_FIELDS = []string + var OK_HTTP = []byte("HTTP/1.0 200 OK\r\n\r\n") + var OK_SOCKS = []byte + var UDP_REQUEST_HEADER = []byte + var UDP_REQUEST_HEADER6 = []byte + func Base32Decode(text string) []byte + func Base32Encode(buf []byte) string + func DecryptHost(c *GCipher, text string, mark byte) string + func EncryptHost(c *GCipher, text string, mark byte) string + func SafeAddHeader(req *http.Request, k, v string) + func SafeGetHeader(req *http.Request, k string) string + func StartServer(addr string, config *ServerConfig) + func TryDecryptHost(c *GCipher, text string) (h string, m byte) + type ClientConfig struct + DNSCacheSize int + DisableConsole bool + GlobalProxy bool + NoProxy bool + UDPRelayCoconn int + UDPRelayPort int + Upstream string + UserAuth string + type GCipher struct + Block cipher.Block + Key []byte + KeyString string + Partial bool + Rand *rand.Rand + func (gc *GCipher) Bridge(target, source net.Conn, key []byte, options *IOConfig) + func (gc *GCipher) Decrypt(buf []byte) []byte + func (gc *GCipher) DecryptString(text string) string + func (gc *GCipher) Encrypt(buf []byte) []byte + func (gc *GCipher) EncryptString(text string) string + func (gc *GCipher) GenerateIV(s, s2 byte) []byte + func (gc *GCipher) GetCipherStream(key []byte) *InplaceCTR + func (gc *GCipher) New() (err error) + func (gc *GCipher) NewRand() *rand.Rand + func (gc *GCipher) RandomIV() (string, []byte) + func (gc *GCipher) ReverseIV(key string) []byte + func (gc *GCipher) WrapIO(dst io.Writer, src io.Reader, key []byte, options *IOConfig) *IOCopyCipher + type IOConfig struct + Bucket *TokenBucket + type IOCopyCipher struct + Cipher *GCipher + Dst io.Writer + Key []byte + Partial bool + Src io.Reader + Throttling *TokenBucket + func (cc *IOCopyCipher) DoCopy() (written int64, err error) + type IOReaderCipher struct + Cipher *GCipher + Key []byte + Src io.Reader + func (rc *IOReaderCipher) Init() *IOReaderCipher + func (rc *IOReaderCipher) Read(p []byte) (n int, err error) + type InplaceCTR struct + func (x *InplaceCTR) XorBuffer(buf []byte) + type OneBytePool chan []byte + func NewOneBytePool(s int) *OneBytePool + func (p *OneBytePool) Free(buf []byte) + func (p *OneBytePool) Get() []byte + type ProxyClient struct + DNSCache *lru.Cache + Listener *listenerWrapper + Localaddr string + Nickname string + func NewClient(localaddr string, config *ClientConfig) *ProxyClient + func (proxy *ProxyClient) PleaseUnlockMe() + func (proxy *ProxyClient) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (proxy *ProxyClient) Start() error + func (proxy *ProxyClient) UpdateKey(newKey string) + type ProxyUpstream struct + func (proxy *ProxyUpstream) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (proxy *ProxyUpstream) Write(w http.ResponseWriter, r *http.Request, p []byte, code int) (n int, err error) + type ServerConfig struct + ProxyPassAddr string + Throttling int64 + ThrottlingMax int64 + UDPRelayListen int + Users map[string]UserConfig + type TokenBucket struct + Speed int64 + func NewTokenBucket(speed, max int64) *TokenBucket + func (tb *TokenBucket) Consume(n int64) + type UserConfig struct + Auth string + Throttling int64 + ThrottlingMax int64