Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct { Protocol Protocol // Protocol is either HTTP or TCP Hostname string Port uint16 }
Proxy represents either a L4 (TCP/UDP), or an L7 (HTTP) proxy for a particular hostname:port.
func ParseProxySpec ¶
ParseProxySpec takes a string representing a Proxy spec, and returns a Proxy or an error if the spec is invalid. A proxy spec is a string of the form "hostname:port/protocol", where:
- hostname is a DNS hostname or an IP address - port is a port number - protocol is either "http", "https" or "tcp"
type TargetConfig ¶
TargetConfig represents the config that should be set on a target container to get all its traffic proxied through L4/L7 proxies.
func RunNetworkProxies ¶
func RunNetworkProxies(ctx context.Context, cli docker.Client, proxies []Proxy, keepCtrs, debugDNS bool) (_ TargetConfig, _ func(context.Context) error, retErr error)
RunNetworkProxies starts a set of Proxy and returns a TargetConfig that should be applied to a target container to get all its traffic proxied, a cleanup function to remove the network and proxies, and an error if any.