Documentation ¶
Index ¶
- Constants
- type Cipher
- type ClientConfig
- type ClientConfigMarshal
- type DummyConn
- func (d *DummyConn) Close() error
- func (d *DummyConn) Init()
- func (d *DummyConn) LocalAddr() net.Addr
- func (d *DummyConn) Read(b []byte) (n int, err error)
- func (d *DummyConn) RemoteAddr() net.Addr
- func (d *DummyConn) SetDeadline(t time.Time) error
- func (d *DummyConn) SetReadDeadline(t time.Time) error
- func (d *DummyConn) SetWriteDeadline(t time.Time) error
- func (d *DummyConn) Write(b []byte) (n int, err error)
- type DummyConnWrapper
- type IOConfig
- type IOReadCloserCipher
- type KCPConfig
- type Options
- type ProxyClient
- func (proxy *ProxyClient) Bridge(down net.Conn, host string)
- func (proxy *ProxyClient) DialUpstream(conn net.Conn, host string, resp []byte, extra, dialStyle byte) net.Conn
- func (proxy *ProxyClient) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (proxy *ProxyClient) Start() error
- func (proxy *ProxyClient) StartLocalRP(n int)
- type ProxyServer
- type ResponseHook
- type Rule
- type ServerConfig
- type TokenBucket
- type UserConfig
Constants ¶
View Source
const ( PolicyMITM = 1 << iota PolicyGlobal PolicyVPN PolicyWebSocket )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cipher ¶
type Cipher struct { IO io_t Key string Block cipher.Block Rand *rand.Rand Partial bool Alias string // contains filtered or unexported fields }
type ClientConfig ¶
type ClientConfigMarshal ¶
type DummyConn ¶
type DummyConn struct {
// contains filtered or unexported fields
}
func (*DummyConn) RemoteAddr ¶
type DummyConnWrapper ¶
type DummyConnWrapper struct {
*DummyConn
}
type IOReadCloserCipher ¶
type IOReadCloserCipher struct {
// contains filtered or unexported fields
}
func (*IOReadCloserCipher) Close ¶
func (rc *IOReadCloserCipher) Close() error
type ProxyClient ¶
type ProxyClient struct { *ClientConfig Localaddr string Listener *listenerWrapper // contains filtered or unexported fields }
func NewClient ¶
func NewClient(localaddr string, config *ClientConfig) *ProxyClient
func (*ProxyClient) DialUpstream ¶
func (*ProxyClient) ServeHTTP ¶
func (proxy *ProxyClient) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ProxyClient) Start ¶
func (proxy *ProxyClient) Start() error
func (*ProxyClient) StartLocalRP ¶
func (proxy *ProxyClient) StartLocalRP(n int)
type ProxyServer ¶
type ProxyServer struct { Localaddr string Listener net.Listener *ServerConfig // contains filtered or unexported fields }
ProxyServer is the main struct for upstream server
func NewServer ¶
func NewServer(addr string, config *ServerConfig) *ProxyServer
func (*ProxyServer) ServeHTTP ¶
func (proxy *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ProxyServer) Start ¶
func (proxy *ProxyServer) Start() (err error)
func (*ProxyServer) Write ¶
func (proxy *ProxyServer) Write(w http.ResponseWriter, key *[ivLen]byte, p []byte, code int) (n int, err error)
type ResponseHook ¶
type ResponseHook interface {
SetBody(r io.ReadCloser)
}
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 ¶
UserConfig is for multi-users server, not implemented yet
Click to show internal directories.
Click to hide internal directories.