Skip to content
TCP proxy using libevent for self-study purposes
C CMake
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
CMakeLists.txt
README.md
config.h.in
zlog.conf

README.md

event-proxy

A event-based proxy written in C for self-study purposes.

Usage

First, download all sources and dependencies:

$ sudo apt install libevent-dev
$ git clone git@github.com:jimjh/event-proxy.git
$ git clone git@github.com:HardySimpson/zlog.git

Then, build and run

$ mkdir build
$ cd build
$ cmake ..
$ make
$ cd ..; build/main  # starts the proxy

Design/Requirements

  • 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/

Steps

  1. Write proxy that accepts and proxies connections on IPv4 and IPv6 addresses.
  2. Review error handling.
  3. Run valgrind checks.
  4. Create event loop with libevent.
  5. Proxy TCP frames.
  6. Handle concurrent connections.

Developing

I use vim with YCM for writing, and XCode for profiling and debugging.

$ cd build
$ cmake .. # -G Xcode
$ make

Dependencies

cmake probably won't work out of the box because of hardcoded paths to these:

References

You can’t perform that action at this time.