Documentation ¶
Overview ¶
Package portforward listens a port and forward to another port. It also provides a channel that caller can stop forwarding when needed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PortForward ¶
PortForward forwards traffic from listenHost to forwardHost. It returns a stop channel to be used when stopping forwarding, and error if any.
// Forward port 8080 to port 80. stop, err := PortForward(":8080", ":80") if err != nil { return err } // Now port 8080 is forwarded to port 80. // Stop the portforwarding. close(stop)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.