Outstanding Project โข 125/100 @ 42 Beirut | epoll-powered HTTP/1.1 server in C++98
Zero dependencies โข Pure C++98 โข Production-grade
A fully asynchronous HTTP/1.1 server that doesn't just work-it shines. From the reactor-pattern event loop to the stunning web interface, every detail was crafted with precision.
# Build the server
make
# Launch it
./webserv conf/default.conf
# Open your browser
http://localhost:8080That's it. Three commands. One beautiful interface.
We didn't just build a server. We built an experience. A modern, interactive web interface with aurora gradients, glassmorphism effects, and real-time testing capabilities.
- ๐ Aurora Background Effects - Animated gradient meshes that breathe life into the page
- ๐ Glassmorphism UI - Frosted glass effects with blur and transparency
- โจ Animated Shimmer Text - The title and team name glow and shimmer with gradient animations
- ๐ฏ Real-Time Testing - Execute HTTP requests and see responses instantly
- ๐ฅ Interactive Particles - Mouse-reactive particle system with connection lines
- ๐ฑ Fully Responsive - Looks stunning on any device
Our event loop is a symphony of O(1) efficiency:
- epoll_wait() monitors all file descriptors in a single syscall
- ConnectionManager dispatches events to the right handlers
- Handlers process data without ever blocking
- Rinse and repeat - thousands of connections, zero threads
Why This Matters:
select()โ O(n) - scans every descriptorpoll()โ O(n) - same performance, no limitepoll()โ O(1) - kernel maintains the ready list
We chose speed. We chose epoll.
Every HTTP method is a pluggable strategy. Want to add PATCH? Write one class. Zero changes to the core.
Parsing happens in stages. Each state knows its job. Handles partial reads naturally.
All responses flow through one factory. Consistency guaranteed.
Components subscribe to events. Decoupled. Clean. Maintainable.
The heart of everything. Event detection โ dispatch โ handle. Never block.
Most servers block on CGI. We don't.
Our CGI pipeline:
- Fork process (non-blocking)
- Setup pipes (stdin/stdout/stderr)
- Register pipes with epoll
- Stream data asynchronously
- Parse CGI headers
- Clean up gracefully
The result? Your server never freezes. Even if a CGI script takes forever.
Stateful HTTP without the complexity:
- UUID-based session IDs
- Automatic cookie injection
- Server-side key-value storage
- Concurrent session support
- Timeout management
We didn't settle for "good enough." We went for outstanding.
โจ Hero Section
- Massive, shimmer-animated title with glint effects
- Glowing team name with gradient animation
- Diamond separators and animated badges
- Breathing particle system with 100+ interactive nodes
- Multi-layered aurora mesh with floating gradients
๐จ Visual Effects
- 4 animated glow spots (gold, amber, rose, violet)
- Film grain noise texture overlay
- Glass morphism on terminal and cards
- Color-blended particle connection lines
- Mouse-reactive particle glow-up effect
- Radial cursor light
๐ Interactive Elements
- Tab-based HTTP method testing
- Real-time console output
- CGI script gallery with one-click execution
- Session/cookie inspector
- Hover animations on all cards
- Smooth scroll reveal animations
| Feature | Status | Notes |
|---|---|---|
| GET | โ | Static files, directory listing, CGI, query params |
| POST | โ | Form data, JSON, multipart uploads, CGI input |
| PUT | โ | Create/update resources, auto-create directories |
| DELETE | โ | File deletion with safety checks |
| HEAD | โ | Metadata without body content |
| Keep-Alive | โ | Persistent connections |
| Chunked Encoding | โ | Transfer-Encoding: chunked |
| Sessions | โ | Cookie-based with server storage |
| MIME Types | โ | Content negotiation |
| CGI/1.1 | โ | Python, Shell, any executable |
| Custom Errors | โ | Branded 404/500 pages |
| Timeouts | โ | Request timeout protection |
| Security | โ | Path traversal prevention, size limits |
Webserv/
โโโ include/ # Headers organized by layer
โ โโโ app/ # Request handlers (Strategy pattern)
โ โโโ config/ # Configuration parser (Builder)
โ โโโ core/ # Event loop, epoll, connection manager (Reactor)
โ โโโ http/ # HTTP protocol, parser (State pattern)
โ โโโ utils/ # MIME types, sessions, logging
โโโ src/ # Implementation files (mirrors include/)
โโโ www/ # Web root with stunning interface
โ โโโ index.html # God-tier homepage
โ โโโ cgi-bin/ # CGI scripts (Python, Shell)
โ โโโ uploads/ # Upload directory (auto-created)
โโโ conf/ # NGINX-style configurations
โโโ images/ # Screenshots and diagrams
โโโ Makefile # Build system
make && ./webserv conf/default.confThen open http://localhost:8080 and explore:
- Interactive HTTP method testing
- CGI script gallery
- Session/cookie inspector
- Real-time response console
# GET request
curl http://localhost:8080/
# POST with data
curl -X POST -d "key=value" http://localhost:8080/cgi-bin/post_test.py
# Upload file
curl -X POST -F "file=@myfile.txt" http://localhost:8080/uploads
# PUT resource
curl -X PUT -d "content" http://localhost:8080/uploads/test.txt
# DELETE resource
curl -X DELETE http://localhost:8080/uploads/test.txt
# HEAD metadata
curl -I http://localhost:8080/
# CGI with query
curl "http://localhost:8080/cgi-bin/calculator.py?a=5&b=3&op=add"make # Build the server
make debug # Build with verbose logging
make clean # Remove object files
make fclean # Full cleanup (includes www/uploads)
make re # Rebuild from scratchTechnical Excellence:
- Reactor pattern with epoll (O(1) performance)
- Five design patterns working in harmony
- Non-blocking I/O throughout the entire stack
- Zero external dependencies (pure C++98)
Visual Brilliance:
- Production-quality web interface
- Aurora gradients and glassmorphism
- Interactive particle system
- Animated text effects
Production Ready:
- Comprehensive error handling
- Security measures (path traversal, timeouts, size limits)
- NGINX-style configuration
- Full HTTP/1.1 compliance
The Result: 125/100 - Outstanding Project @ 42 Beirut
Cache Me If You Can
- Ali Itawi
- Mohamad Al Mohamad
- Farah El Khatib
Built with precision at 42 Beirut
- 42 School for pushing us to build something exceptional
- epoll for making asynchronous I/O beautiful
- NGINX for configuration inspiration
- The Gang of Four for timeless design patterns
Educational project for 42 School curriculum.
โญ Outstanding Project โญ
When they said "build a web server," we built a masterpiece.





