Simple TCP port forwarder
To build just run go build on after clone the repository.
To install from GitHub run go install github.com/beppler/tcpfwd.
To execute tcpfwd 2 arguments are required:
- Local Address
- It can be specified with the
TCPFWD_LOCAL_ADDRenvironment variable or as the first argument to the program - It uses the default Go address format (
ADDR:PORT), whereADDRis optional
- It can be specified with the
- Remote Address
- It can be specified with the
TCPFWD_REMOTE_ADDRenvironment variable or as the second argument to the program - It uses the default Go address format (
ADDR:PORT)
- It can be specified with the
For example to forward port 1234 on all local interfaces to port 3456 on example.org execute:
tcpfwd ":1234" "example.org:3456- or
TCPFWD_LOCAL_ADDR=:1234 TCPFWD_REMOTE_ADDR=example.org:3456 tcpfwd