Simple tcp proxy package and executable binary in Golang. The executable provides both TCP and TCP/TLS connection.
With a correctly configured Go toolchain:
go get -u github.com/kahlys/tcpproxy/cmd/tcpproxy
By default, the proxy address is localhost:4444 and the target address is localhost:80.
$ tcpproxy
You can specify some options.
$ tcpproxy -h
Usage of tcpproxy:
-laddr string
proxy local address (default ":4444")
-lcert string
proxy certificate x509 file for tls/ssl use
-lkey string
proxy key x509 file for tls/ssl use
-ltls
tls/ssl between client and proxy
-raddr string
proxy remote address (default ":80")
-rtls
tls/ssl between proxy and target
-t int
wait seconds before closing second pipe