A simple HTTP 1.1 server to understand the fundamentals of the HTTP protocol
- C++ 90.6%
- CMake 5.8%
- HTML 2.3%
- CSS 1.3%
| www | ||
| .gitignore | ||
| CMakeLists.txt | ||
| main.cpp | ||
| README.md | ||
| router.cpp | ||
| router.hpp | ||
| socket_wrapper.hpp | ||
| tcp_server.cpp | ||
| tcp_server.hpp | ||
HTTP 1.1 Server
A simple HTTP 1.1 server built from scratch to understand the fundamentals of the HTTP protocol.
What is this?
This project implements a basic HTTP 1.1 server that:
- Handles HTTP requests and responses manually
- Parses HTTP headers and request methods
- Multi threaded client connections
- Serves static content from 'www' directory
Build & run
git clone https://github.com/msh31/http-server.git
cd http-server
mkdir build
cd build
cmake ..
cmake --build .
../http-server.exe
OR
.././http-server
The server will load any files in the www/* directory, given they are HTML/CSS/JS and or PNG/JPEGS
Credits
This implementation follows the tutorial by The Medium (loosely)