Skip to content

Repository files navigation

📌 Webserv – 42/1337 Project

🎯 Introduction

Webserv is a C++ project from the 42/1337 curriculum where the goal is to implement a fully functional HTTP server from scratch.

This project helps you understand how web servers work internally, including request handling, response generation, and client-server communication.


🧠 Project Objectives

  • Build a custom HTTP server (like Nginx or Apache)
  • Handle HTTP requests and responses
  • Support multiple clients
  • Manage routes and configurations
  • Implement methods such as GET, POST, DELETE
  • Handle errors and HTTP status codes

⚙️ Features

  • HTTP/1.1 protocol support
  • Multiple client handling (non-blocking I/O)
  • Config file parsing
  • Routing system
  • CGI support (optional depending on implementation)
  • Static file serving
  • Error handling (404, 405, etc.)

🖥️ Technologies

  • C++
  • Socket programming
  • I/O multiplexing (select, poll, or epoll)
  • HTTP protocol
  • Unix system calls

📂 Project Structure (Example)

webserv/
├── src/
├── includes/
├── config/
├── server/
├── client/
└── main.cpp


🚀 How to Run

make
./webserv config_file.conf

📡 Example Usage

Open your browser and go to:

http://localhost:8080

🧠 What I Learned
How HTTP works internally
Socket programming in C++
Event-driven programming
Handling multiple clients efficiently
Server architecture and design

⚠️ Notes
This project is complex and requires a good understanding of networking
Proper error handling is essential
Memory leaks must be avoided
Performance and scalability are important

👩‍💻 Author

Somaya-Hassoune – 1337 Student

About

Webserv is a low-level HTTP server implemented in C++ as part of the 42/1337 curriculum. It demonstrates a deep understanding of networking, including socket programming, event-driven I/O, and HTTP protocol handling, while supporting multiple concurrent clients and configurable routing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages