fnet

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2018 License: Apache-2.0 Imports: 7 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen added in v0.8.0

func Listen(name string, port string) (net.Listener, *net.TCPAddr)

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

func NormalizePort(port string) string

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 Proxy added in v0.8.0

func Proxy(port string, dest *net.TCPAddr) *net.TCPAddr

Proxy starts a tcp proxy.

func ProxyToDestination added in v0.8.0

func ProxyToDestination(listenPort string, destination string) *net.TCPAddr

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

func Resolve(host string, port string) *net.TCPAddr

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

func ResolveDestination(dest string) *net.TCPAddr

ResolveDestination returns the TCP address of the "host:port" suitable for net.Dial. nil in case of errors.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL