Documentation ¶
Index ¶
Constants ¶
View Source
const ( TCP = ProxyProtocol("tcp") HTTP = ProxyProtocol("http") )
View Source
const ( TCP_MIN_PORT = 40000 TCP_MAX_PORT = 50000 TYPE_NEWCONN = iota + 1 TYPE_MESSAGE TYPE_IDLE )
View Source
const (
HOOK_TCP_POST_CONNECT = "tcp-post-connect"
)
Variables ¶
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) RunProxy ¶
func (c *Client) RunProxy(opts ProxyOptions) (pc *ProxyConnector, err error)
This is a immediately return function
type ProxyConnector ¶
type ProxyConnector struct {
// contains filtered or unexported fields
}
func (*ProxyConnector) Close ¶
func (p *ProxyConnector) Close() error
func (*ProxyConnector) RemoteAddr ¶
func (p *ProxyConnector) RemoteAddr() string
func (*ProxyConnector) Wait ¶
func (p *ProxyConnector) Wait() error
type ProxyOptions ¶
type ProxyOptions struct { LocalAddr string Proto ProxyProtocol Subdomain string ListenPort int ExtraData string }
type ProxyProtocol ¶
type ProxyProtocol string
type ProxyServer ¶
func NewProxyServer ¶
func NewProxyServer(domain string) *ProxyServer
domain, ex shengxiang.me dns should set *.shengxiang.me
func (*ProxyServer) ServeHTTP ¶
func (p *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ProxyStats ¶
type ProxyStats struct {
// contains filtered or unexported fields
}
A proxy represents a pair of connections and their state
type RequestInfo ¶
Click to show internal directories.
Click to hide internal directories.