bloominstituteoftechnology/C-Web-Server
FreeA simple webserver written in C
FreeFree tier
About bloominstituteoftechnology/C-Web-Server
C-Web-Server is an educational project from Bloom Institute of Technology (formerly Lambda School) that guides students through implementing a simple HTTP web server in C. The project involves building an HTTP request parser, HTTP response builder, an LRU cache using a doubly linked list, and integrating with existing code for networking, MIME type handling, and file reading. It serves static files from a serverroot directory and includes a special endpoint at /d20 that returns a random number between 1 and 20. Designed for learning purposes, the repository provides skeleton code, a Makefile, and detailed goals to teach low-level networking, data structures, and the HTTP protocol.
Key Features
HTTP request parsing
HTTP response building
LRU cache implementation using a doubly linked list
Hashtable integration for data storage
MIME type determination for file serving
File serving from a serverroot directory
Special /d20 endpoint returning a random number 1-20
Makefile-based build system
Support for static files and simple API endpoint
Pros & Cons
Pros
- Well-structured with existing skeleton code providing clear guidance
- Covers essential web server concepts (HTTP, caching, MIME types)
- Educational value with progressive goals and stretch challenges
- Active community with 814 stars and 603 forks on GitHub
- Commented code aiding understanding of implementation
- Includes practical exercise in implementing data structures
Cons
- Intended solely for educational purposes, not production-ready
- Limited to serving static files and one simple endpoint
- Lacks advanced HTTP features (e.g., HTTPS, POST handling, concurrent connections)
- Requires existing C proficiency and networking background
- Documentation assumes familiarity with lower-level programming concepts
Best For
Educational project for learning C networking and HTTP protocolTeaching resource for data structures (linked lists, hashtables, LRU caches)Practicing low-level socket programming and file I/O in CBuilding a minimal functional web server from scratch
FAQ
What programming language is used?
The web server is written entirely in C.
What is the main goal of the project?
The goal is to implement a simple web server that serves files and a specialized /d20 endpoint, focusing on HTTP request parsing, response building, and an LRU cache.
How do I build and run the server?
Use the provided Makefile: type 'make' to build, then './server' to run the server on port 3490.
What existing code is provided?
The repository includes low-level networking code (net.h/c), MIME type handlers (mime.h/c), file reading utilities (file.h/c), a hashtable implementation, and a doubly linked list (llist.h/c).
Is this project suitable for beginners?
It is designed for students with some prior C experience and understanding of networking concepts; it is an intermediate-level educational project.