CadvancedbackendAI generated

HTTP/1.0 Web Server from Scratch

A single-threaded then forking HTTP server that parses raw HTTP GET requests over TCP sockets, serves static files with correct headers, and handles basic error codes, built without any HTTP library. Learners practice socket programming, the HTTP protocol, and process-based concurrency with fork().

Estimate
~10.5h
Steps
6
Completed by
0
Proposed by
codeseed.app

sys/socket.h · fork() · sys/stat.h

Project roadmap

  1. 01

    Set up socket, bind, and listen

    ~1h

    Create a TCP socket bound to a configurable port and put it into listening mode.

  2. 02

    Parse incoming HTTP request lines

    ~2h

    Read raw request bytes and parse the method, path, and HTTP version from the request line.

  3. 03

    Serve static files with correct headers

    ~2.5h

    Resolve the request path to a file on disk and send Content-Type, Content-Length, and status headers with the body.

  4. 04

    Add fork-based concurrency

    ~2.5h

    Fork a child process per connection so multiple clients can be served concurrently, reaping zombies with signal handling.

  5. 05

    Implement error responses

    ~1.5h

    Return proper 404 and 400 responses for missing files and malformed requests, plus guard against path traversal.

  6. 06

    Add a simple access log

    ~1h

    Log each request's method, path, status, and client IP to a log file.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~10.5h · 6 steps

Tech stack

sys/socket.hfork()sys/stat.h