Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

C++ Multi-Threaded HTTP Server

A lightweight, high-performance HTTP web server implemented from scratch in modern C++ (C++17).
This project features a custom thread pool architecture to handle concurrent client connections efficiently.

Features

  • Custom Thread Pool: Efficient worker thread management using condition variables and mutexes for parallel request processing.
  • Socket Programming: Low-level network communication utilizing POSIX sockets (IPv4, TCP).
  • Zero External Dependencies: Built purely with standard C++ libraries and POSIX system calls.

Project Structure

cpp-http-server/
├── include/
│   ├── server.hpp
│   └── threadpool.hpp
└── src/
    ├── main.cpp
    ├── server.cpp
    └── threadpool.cpp

Getting Started

Prerequisites

  • A C++17 compatible compiler (like g++ or clang)
  • A Linux or macOS environment (POSIX-compliant system)

Compilation Navigate to the project root directory and run the following command:

g++ -std=c++17 src/main.cpp src/server.cpp src/threadpool.cpp -o server -lpthread

Running the Server Execute the compiled binary:

./server

The server will start listening on port 8080. Open your browser and navigate to http://localhost:8080.

About

A lightweight, multi-threaded HTTP server built from scratch in modern C++ using a custom ThreadPool architecture.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages