This is a small HTTP/1.1 server I built to explore multithreading and low-level networking. For now, it just sends the client's headers back as JSON response.
- POSIX-compatible environment (Linux, macOS, WSL, etc.).
makeplus a C compiler such as GCC or Clang with pthread support.- Optional:
bearif you want to regeneratecompile_commands.jsonfor clangd.
makeormake debug(default target) builds with AddressSanitizer/UndefinedBehaviorSanitizer enabled for easier debugging.make releasebuilds an optimized binary (-O3 -s) withNODEBUGdefined.make cleanremoves every artifact underbuild/.
After compiling, you can start the server. By default it will listen on port 3490:
make runTo run the server on a different port, invoke it directly:
./build/target.out [port]Regenerate the compilation database that clangd rely on with:
bear -- make