Documentation ¶
Index ¶
- func Dial(addr string, port int) (net.Conn, error)
- func LogFile(file string)
- func LogLevel(lvl string)
- func StartServer(addr string, port int, handler func(net.Conn)) (net.Listener, error)
- type Proxy
- type ProxyOption
- func ProxyEavesdropAddr(addr string) ProxyOption
- func ProxyEavesdropPort(port int) ProxyOption
- func ProxyListenAddr(addr string) ProxyOption
- func ProxyListenPort(port int) ProxyOption
- func ProxyServerAddr(addr string) ProxyOption
- func ProxyServerPort(port int) ProxyOption
- func ProxyTimeout(d time.Duration) ProxyOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy manages the life-cycle of the listening servers of the system and spawns new sessions if new bi-directional clients connect to it.
func NewProxy ¶
func NewProxy(options ...ProxyOption) *Proxy
NewProxy create a new proxy configured with options options.
func (*Proxy) ListenAndServe ¶
ListenAndServe starts the configured proxy p. This method blocks until p is stopped by calling shutdown.
type ProxyOption ¶
type ProxyOption func(*Proxy)
ProxyOption are an encapsulation of configuration options appliable to the proxy.
func ProxyEavesdropAddr ¶
func ProxyEavesdropAddr(addr string) ProxyOption
ProxyEavesdropAddr configures the address the eavesdroppers can connect to.
func ProxyEavesdropPort ¶
func ProxyEavesdropPort(port int) ProxyOption
ProxyEavesdropPort configures the port of eavesdroppers can connect to.
func ProxyListenAddr ¶
func ProxyListenAddr(addr string) ProxyOption
ProxyListenAddr configures the address the bidirectional clients can connect to.
func ProxyListenPort ¶
func ProxyListenPort(port int) ProxyOption
ProxyListenPort configures the port the bidirectional clients can connect to.
func ProxyServerAddr ¶
func ProxyServerAddr(addr string) ProxyOption
ProxyServerAddr configures the address of the remote host to connect to.
func ProxyServerPort ¶
func ProxyServerPort(port int) ProxyOption
ProxyServerPort configures the port of the remote host to connect to.
func ProxyTimeout ¶
func ProxyTimeout(d time.Duration) ProxyOption
ProxyTimeout configures the duration to wait until write to a client fails.