Skip to content

jacksonwuu/a-simple-tcp-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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).

About

A very simple TCP proxy in 100 lines of C++ code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published