Documentation ¶
Overview ¶
Package proxy provides a TCP reverse proxy. Unlike normal reverse proxy, the upstream is intentionally fixed. A new upstream will be selected if the current upstream is down.
Index ¶
Constants ¶
View Source
const ( DefaultUpstreamProbeInterval = 2 * time.Second DefaultDialTimeout = 3 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
func (*Proxy) Close ¶
func (p *Proxy) Close()
Close stops any running loops and stops the listener. This function is concurrent-safe.
func (*Proxy) HasActiveUpstream ¶
HasActiveUpstream returns whether there is an active upstream.
func (*Proxy) SetUpstreams ¶
SetUpstreams sets the upstream address list. This function is concurrent-safe.
Click to show internal directories.
Click to hide internal directories.