Skip to content

Latest commit

 

History

History
42 lines (25 loc) · 694 Bytes

README.md

File metadata and controls

42 lines (25 loc) · 694 Bytes

A very simple TCP proxy

The TCP proxy will listen on a port.

The proxy will create a connection to upstream server for every client connection.

When client send something to proxy, the proxy will create a thread to it (forward everything to upstream server).

That's it.

You can learn the basic mechanism of tcp proxy here.

Quick start

build:

make proxy
make server

run:

./server
./proxy

in different terminal windows.

You can use nc to simulate a tcp client.

nc localhost 12345

nc will establish a connection to proxy, and proxy will forward everything to server (it will print all data it received to terminal).