Custom C++ Web Server

Tru Bui

A complete HTTP server built from scratch in C/C++.

Overview

This project implements a fully functional HTTP server that can serve static files, execute CGI programs, browse directories, enforce Basic HTTP authentication, track statistics, and support three different concurrency modes (see below). All request parsing, header generation, directory traversal, and process/thread logic were implemented manually.

Core Features Implemented

Concurrency Modes

The server supports three different concurrency models selected via command-line flags:

Directory Browsing

If the requested path is a directory, the server dynamically generates an HTML page containing:

CGI-Bin Support

Requests to /cgi-bin/<script> fork a child process that executes the script with:

GET and POST are both supported — POST implemented as extra credit by parsing the message body.

Statistics & Logging

Technologies & Concepts

Contact me to see source code!