Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version string
Version that is defined in git tag. There should be a release in GitHub with this tag.
Functions ¶
This section is empty.
Types ¶
type ConnsResponse ¶ added in v1.2.0
type Proxy ¶
type Proxy struct { // enable debug log DebugLog bool // save state in this file to survive restarts StatePath string // listen http on this address for management interface MgmtListenAddr string // seconds to wait before killing open connections on remote address switch GracePeriod time.Duration // time to wait when connecting the server ConnectTimeout time.Duration // tcp keepalive period Keepalive time.Duration // when should we resolve again? ResolvePeriod time.Duration // channel is closed when proxy is ready to accept connections Ready chan struct{} // contains filtered or unexported fields }
Proxy is a TCP proxy that proxies all incoming connections to a remote address.
func (*Proxy) GetRemoteAddress ¶
GetRemoteAddress returns the current remote address.
func (*Proxy) Run ¶
func (p *Proxy) Run()
Run the proxy by listening the address and accepting incoming connections.
func (*Proxy) SetRemoteAddress ¶
SetRemoteAddress sets the remote address. When remote address has been changed, after p.GracePeriod duration, all previous connections are killed if they are still alive.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.