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%
Find a file
2025-10-24 20:46:05 +02:00
www feat: add static file serving 2025-09-04 03:03:11 +02:00
.gitignore feat: add static file serving 2025-09-04 03:03:11 +02:00
CMakeLists.txt feat: implement router with request parsing 2025-08-19 01:45:35 +02:00
main.cpp feat: accept connections & send basic HTML response 2025-08-18 01:40:41 +02:00
README.md Update README.md 2025-10-24 20:46:05 +02:00
router.cpp feat: add static file serving 2025-09-04 03:03:11 +02:00
router.hpp feat: implement router with request parsing 2025-08-19 01:45:35 +02:00
socket_wrapper.hpp feat: accept connections & send basic HTML response 2025-08-18 01:40:41 +02:00
tcp_server.cpp feat: add static file serving 2025-09-04 03:03:11 +02:00
tcp_server.hpp feat: add static file serving 2025-09-04 03:03:11 +02:00

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)