A lightweight HTTP server written in C, built to explore low-level network programming, POSIX sockets and HTTP communication on Linux. It was bulit for educational purposes.
HTTPServerInC is a project focused on understanding how an HTTP server works internally, from accepting client connections to processing HTTP requests and returning responses. Instead of relying on high-level web framework, this project uses C and system-level networking APIs to explore the fundamentals of client-server communication and HTTP protocol handling.
Make sure you have the following installed:
- Linux or compatible POSIX environment;
- GCC or Clang;
- CMake;
- GNU Make or another supported build tool;
git clone https://github.com/AveePB/HTTPServerInC.git
cd HTTPServerInC
Configure the project using CMake:
cmake -S . -B build
Compile the source code:
cmake --build build
Launch the executable generated by the build process. The file is in the build directory.
cd build
./HTTPServer
The repository includes a test script located at assets/run_40_tests.sh.
From the repository root, run:
chmod +x assets/run_40_tests.sh
Execute the script and save both standard output and error output to a results file:
cd assets
./run_40_tests.sh > test_results.txt
After the tests finish, inspect the output:
cat test_results.txt
Special thanks to Beej's Guide to Network Programming for its clear explanations of networking concepts, sockets, and low-level network programming in C.
Additional thanks to Jacob Sorber for his educational videos and tutorials on C programming, operating systems, and systems-level concepts, which helped deepen my understanding throughout this project.
Their educational resources were invaluable in learning and exploring the fundamentals of building an HTTP server from scratch.
This project is licensed under the MIT License. See the LICENSE file for details.