A event-based proxy written in C for self-study purposes.
First, download all sources and dependencies:
$ sudo apt install libevent-dev
$ git clone [email protected]:jimjh/event-proxy.git
$ git clone [email protected]:HardySimpson/zlog.git
Then, build and run
$ mkdir build
$ cd build
$ cmake ..
$ make
$ cd ..; build/main # starts the proxy
- bind to and listen on IPv4 or IPv6 address
- run an event loop
- handle concurrent connections
- proxy connections
See https://www.nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/
- Write proxy that accepts and proxies connections on IPv4 and IPv6 addresses.
- Review error handling.
- Run valgrind checks.
- Create event loop with libevent.
- Proxy TCP frames.
- Handle concurrent connections.
I use vim with YCM for writing, and XCode for profiling and debugging.
$ cd build
$ cmake .. # -G Xcode
$ make
cmake probably won't work out of the box because of hardcoded paths to these:
- zlog
- libevent