Documentation ¶
Overview ¶
Package tunnels allows creation of simple forwarding tunnels between address pairs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tunnel ¶
type Tunnel struct { Tunneler // contains filtered or unexported fields }
Tunnel forwards data between source and destination addresses.
func (*Tunnel) Addr ¶
Addr returns address on which it listens for connection.
It should be used to make a connection to the Tunnel.
func (*Tunnel) Close ¶
Close stops listening on the port for new connections and terminates exisiting ones.
func (*Tunnel) Create ¶
Create sets up data forwarding tunnel between src and dest addresses. It will listen on random port on src and forward to dest.
When connection to src is made a corresponding one is created to dest and data is copied between them.
Close should be called to clean up this function and terminate connections.
type Tunneler ¶
type Tunneler interface { // Create sets up a new tunnel. Create(net.IP, net.TCPAddr) error // Close shuts down tunnel. Close() error // Addr returns the address of the tunnel to be used by a user // for a connection to Dryad. Addr() net.Addr }
Tunneler defines API for basic operations on tunnels.