Documentation ¶
Index ¶
- func Listen(name string, port string) (net.Listener, *net.TCPAddr)
- func NormalizePort(port string) string
- func Proxy(port string, dest *net.TCPAddr) *net.TCPAddr
- func ProxyToDestination(listenPort string, destination string) *net.TCPAddr
- func Resolve(host string, port string) *net.TCPAddr
- func ResolveDestination(dest string) *net.TCPAddr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Listen ¶ added in v0.8.0
Listen returns a listener for the port. Port can be a port or a bind address and a port (e.g. "8080" or "[::1]:8080"...). If the port component is 0 a free port will be returned by the system. This logs critical on error and returns nil (is meant for servers that must start).
func NormalizePort ¶
NormalizePort parses port and returns host:port if port is in the form of host:port already or :port if port is only a port (doesn't contain :).
func ProxyToDestination ¶ added in v0.8.0
ProxyToDestination opens a proxy from the listenPort (or addr:port) and forwards all traffic to destination (host:port)
func Resolve ¶ added in v0.8.0
Resolve returns the TCP address of the host,port suitable for net.Dial. nil in case of errors.
func ResolveDestination ¶ added in v0.8.0
ResolveDestination returns the TCP address of the "host:port" suitable for net.Dial. nil in case of errors.
Types ¶
This section is empty.