Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = &Direct{dialTimeout: time.Second * 3}
Default dialer
Functions ¶
func RegisterDialer ¶
func RegisterDialer(name string, c DialerCreator)
RegisterDialer is used to register a dialer.
func RegisterServer ¶
func RegisterServer(name string, c ServerCreator)
RegisterServer is used to register a proxy server
Types ¶
type DialerCreator ¶
DialerCreator is a function to create dialers.
type Direct ¶
type Direct struct {
// contains filtered or unexported fields
}
Direct proxy
type Proxy ¶ added in v0.8.1
type Proxy interface { // Dial connects to the given address via the proxy. Dial(network, addr string) (c net.Conn, dialer Dialer, err error) // DialUDP connects to the given address via the proxy. DialUDP(network, addr string) (pc net.PacketConn, writeTo net.Addr, err error) // Get the dialer by dstAddr. NextDialer(dstAddr string) Dialer // Record records result while using the dialer from proxy. Record(dialer Dialer, success bool) }
Proxy is a dialer manager
type Server ¶
type Server interface { // ListenAndServe sets up a listener and serve on it ListenAndServe() // Serve serves a connection Serve(c net.Conn) }
Server interface
type ServerCreator ¶
ServerCreator is a function to create proxy servers
Directories ¶
Path | Synopsis |
---|---|
Package http implements a http proxy.
|
Package http implements a http proxy. |
Package obfs implements simple-obfs of ss
|
Package obfs implements simple-obfs of ss |
Package reject implements a virtual proxy which always reject requests.
|
Package reject implements a virtual proxy which always reject requests. |
Package socks5 implements a socks5 proxy.
|
Package socks5 implements a socks5 proxy. |
Package ws implements a simple websocket client.
|
Package ws implements a simple websocket client. |
Click to show internal directories.
Click to hide internal directories.