A simple TCP proxy service. It listens on an address (host and port combination) and forwards all TCP traffic to a remote address.
Installation:
$ go get -u github.com/bigg01/tcpproxy
$ go build -o tcpproxy main.go
Usage:
$ tcpproxy -l 0.0.0.0:29418 -r origin.server:29418
$ docker build -t tcpproxy:latest .
$ docker images |grep -i tcpproxy tcpproxy latest 50938d4749ec About a minute ago 3.48MB
$ docker run -it tcpproxy:latest flag needs an argument: -l Usage of ./tcpproxy: -l string local address to listen on -logconn log connections -r string remote address to dial
$ docker run --rm -it -p 8023:8023 -p 8080:8080 tcpproxy:latest tcpproxy -l 0.0.0.0:8023 -r 10.0.0.208:3000 -logconn true INFO[0003] connected: 172.17.0.1:57728
$ curl -v telnet://127.0.0.1:8023
$ curl http://localhost:8080/metrics |grep -i proxy_tcp_connection
proxy_tcp_connection 1
$ docker pull quay.io/bigg01/tcpproxy
$
$ oc run -it gotest1 --rm=true --restart='Never' --image=rhel7/rhel-tools:latest -- /bin/sh If you don't see a command prompt, try pressing enter.
sh-4.2$ curl -v telnet://tcpproxy.tcpproxy.svc:8023
$ echo -n "test out the server" | nc tcpproxy.tcpproxy.svc 8023 Message received.sh-4.2$
$ go run tcpserver.go Listening on 0.0.0.0:3333
Content type
Image
Digest
Size
3.4 MB
Last updated
over 8 years ago
docker pull bigg01/tcpproxy