Documentation ¶
Index ¶
- Constants
- type Cipher
- func (gc *Cipher) Decrypt(buf []byte, ss ...byte) []byte
- func (gc *Cipher) DecryptDecompress(str string, rkey ...byte) string
- func (gc *Cipher) DecryptString(text string, rkey ...byte) string
- func (gc *Cipher) Encrypt(buf []byte, ss ...byte) []byte
- func (gc *Cipher) EncryptCompress(str string, rkey ...byte) string
- func (gc *Cipher) EncryptString(text string, rkey ...byte) string
- func (gc *Cipher) Init(key string) (err error)
- func (gc *Cipher) NewIV(o Options, payload []byte, auth string) (string, []byte)
- func (gc *Cipher) ReverseIV(key string) (o Options, iv []byte, auth []byte)
- type ClientConfig
- type IOConfig
- type IOReadCloserCipher
- type OneBytePool
- type Options
- type ProxyClient
- type ProxyUpstream
- type ServerConfig
- type TokenBucket
- type UserConfig
Constants ¶
View Source
const ( PolicyDisabled = 1 << iota PolicyManInTheMiddle PolicyGlobal PolicyTrustClientDNS PolicyAggrClosing PolicyWebSocket )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cipher ¶
type Cipher struct { IO io_t Key []byte KeyString string Block cipher.Block Rand *rand.ConcurrentRand Partial bool Alias string }
func (*Cipher) DecryptDecompress ¶
type ClientConfig ¶
type IOReadCloserCipher ¶
type IOReadCloserCipher struct {
// contains filtered or unexported fields
}
func (*IOReadCloserCipher) Close ¶
func (rc *IOReadCloserCipher) Close() error
type OneBytePool ¶
type OneBytePool chan []byte
func NewOneBytePool ¶
func NewOneBytePool(s int) *OneBytePool
func (*OneBytePool) Free ¶
func (p *OneBytePool) Free(buf []byte)
func (*OneBytePool) Get ¶
func (p *OneBytePool) Get() []byte
type ProxyClient ¶
type ProxyClient struct { *ClientConfig UDP struct { sync.Mutex Conns map[string]*udp_tcp_conn_t Addrs map[net.Addr]bool } Localaddr string Listener *listenerWrapper // contains filtered or unexported fields }
func NewClient ¶
func NewClient(localaddr string, config *ClientConfig) *ProxyClient
func (*ProxyClient) PACFile ¶
func (proxy *ProxyClient) PACFile(w http.ResponseWriter, r *http.Request)
func (*ProxyClient) ServeHTTP ¶
func (proxy *ProxyClient) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ProxyClient) Start ¶
func (proxy *ProxyClient) Start() error
func (*ProxyClient) UpdateKey ¶
func (proxy *ProxyClient) UpdateKey(newKey string)
type ProxyUpstream ¶
type ProxyUpstream struct { Localaddr string *ServerConfig // contains filtered or unexported fields }
func NewServer ¶
func NewServer(addr string, config *ServerConfig) *ProxyUpstream
func (*ProxyUpstream) ServeHTTP ¶
func (proxy *ProxyUpstream) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ProxyUpstream) Start ¶
func (proxy *ProxyUpstream) Start() error
func (*ProxyUpstream) Write ¶
func (proxy *ProxyUpstream) Write(w http.ResponseWriter, key, p []byte, code int) (n int, err error)
type ServerConfig ¶
type TokenBucket ¶
type TokenBucket struct { Speed int64 // bytes per second // contains filtered or unexported fields }
func NewTokenBucket ¶
func NewTokenBucket(speed, max int64) *TokenBucket
func (*TokenBucket) Consume ¶
func (tb *TokenBucket) Consume(n int64)
type UserConfig ¶
for multi-users server, not implemented yet
Click to show internal directories.
Click to hide internal directories.