portforward

package module
v0.0.0-...-b5bb934 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

portforward

GoDoc

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

func PortForward(listenHost, forwardHost string) (chan struct{}, error)

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.

Jump to

Keyboard shortcuts

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