Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddrAnfUser ¶
type AddrAnfUser struct {
Username string
// contains filtered or unexported fields
}
type Authentication ¶
Authentication proxy authentication
type AuthenticationFunc ¶
AuthenticationFunc Authentication interface is implemented
type BytesPool ¶ added in v0.2.2
BytesPool is an interface for getting and returning temporary bytes for use by io.CopyBuffer.
type Dialer ¶
type Dialer struct {
// ProxyNetwork network between a proxy server and a client
ProxyNetwork string
// ProxyAddress proxy server address
ProxyAddress string
// ProxyDial specifies the optional dial function for
// establishing the transport connection.
ProxyDial func(ctx context.Context, network string, address string) (net.Conn, error)
// Username use username authentication if not empty
Username string
// IsResolve resolve domain name on locally
IsResolve bool
// Resolver optionally specifies an alternate resolver to use
Resolver *net.Resolver
// Timeout is the maximum amount of time a dial will wait for
// a connect to complete. The default is no timeout
Timeout time.Duration
}
Dialer is a SOCKS4 dialer.
func NewDialer ¶
NewDialer returns a new Dialer that dials through the provided proxy server's network and address.
func (*Dialer) DialContext ¶
DialContext connects to the provided address on the provided network.
type Server ¶
type Server struct {
// Authentication is proxy authentication
Authentication Authentication
// ProxyDial specifies the optional proxyDial function for
// establishing the transport connection.
ProxyDial func(ctx context.Context, network string, address string) (net.Conn, error)
// ProxyListenBind specifies the optional proxyListenBind function for
// establishing the transport connection.
ProxyListenBind func(ctx context.Context, network string, address string) (net.Listener, error)
// ListenBindReuseTimeout is the timeout for reusing bind listener
ListenBindReuseTimeout time.Duration
// ListenBindAcceptTimeout is the timeout for accepting connections on bind listener
ListenBindAcceptTimeout time.Duration
// Logger error log
Logger Logger
// Context is default context
Context context.Context
// BytesPool getting and returning temporary bytes for use by io.CopyBuffer
BytesPool BytesPool
// contains filtered or unexported fields
}
Server is accepting connections and handling the details of the SOCKS4 protocol
func (*Server) ListenAndServe ¶
ListenAndServe is used to create a listener and serve on it
type SimpleServer ¶ added in v0.2.3
type SimpleServer struct {
Server
Listener net.Listener
Network string
Address string
Username string
}
SimpleServer is a simplified server, which can be configured as easily as client.
func NewSimpleServer ¶ added in v0.2.3
func NewSimpleServer(addr string) (*SimpleServer, error)
NewServer creates a new NewSimpleServer
func (*SimpleServer) Close ¶ added in v0.2.3
func (s *SimpleServer) Close() error
Close closes the listener
func (*SimpleServer) ProxyURL ¶ added in v0.2.3
func (s *SimpleServer) ProxyURL() string
ProxyURL returns the URL of the proxy