portforward

package module
v0.0.0-...-1521c1b Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT Imports: 6 Imported by: 0

README

portforward

a port forward util written in go

usage

simply calls

// this will forwards flows from local 80 port to remote 80 port on remote.com.
 f := portforward.NewForward("tcp",":80","remote.com:80")

 // onSigint
ch := make(chan os.Signal, 10)
signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
<-ch
f.Close()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetErrorHandler

func SetErrorHandler(f func(err error))

Types

type Forward

type Forward struct {
	// contains filtered or unexported fields
}

func NewForward

func NewForward(network, bindAddr, dstAddr string) (*Forward, error)

func (*Forward) Bind

func (xf *Forward) Bind(network, bindAddr, dstAddr string) error

func (*Forward) Close

func (xf *Forward) Close()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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