All work

Team project, 42 school

webserv

A web server written from scratch in C++, the kind of program that delivers web pages to a browser.

Year
Sep to Nov 2025
Role
configuration, responses, CGI and sessions, in a team of 2
Team
ABDE-LKADER and me
The webserv demo home page, served by the server

What I built

  • An nginx-style configuration parser
  • The response layer
  • Static file serving, with path-traversal protection
  • The CGI engine (Python, PHP, Bash), with a timeout
  • Custom error pages
  • DELETE requests and redirects
  • Sessions and cookies

Under the hood

How the server works. My parts are listed above.

Many visitors at once

Non-blocking I/O handles many connections in one event loop (epoll).

Configured like nginx

Server and location blocks in a plain config file.

Runs scripts safely

CGI with its own environment and a timeout, so a stuck script can't freeze the server.

Keeps other files private

Path-traversal protection blocks requests outside the web root.

No shortcuts

HTTP/1.0, C++98 and POSIX sockets only, no external libraries.

2People in the team
3Script languages
125/10042 school evaluation score, bonus included

Built with C++98, POSIX sockets, epoll, fork/execve.

A directory listing generated by the server, with a delete button for each file
Directory listing
The server's custom 404 Not Found page
Custom error page

Have a project in mind?

Tell me about it on WhatsApp or by email. I reply within a day.