Skip to content

josephclydemar/http-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Server

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.

Requirements

  • POSIX-compatible environment (Linux, macOS, WSL, etc.).
  • make plus a C compiler such as GCC or Clang with pthread support.
  • Optional: bear if you want to regenerate compile_commands.json for clangd.

Build

  • make or make debug (default target) builds with AddressSanitizer/UndefinedBehaviorSanitizer enabled for easier debugging.
  • make release builds an optimized binary (-O3 -s) with NODEBUG defined.
  • make clean removes every artifact under build/.

Run

After compiling, you can start the server. By default it will listen on port 3490:

make run

To run the server on a different port, invoke it directly:

./build/target.out [port]

Linting

Regenerate the compilation database that clangd rely on with:

bear -- make

About

HTTP/1.1 server to explore multi-threading and networking

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors