A lightweight HTTP server written from scratch in Go — without relying on Go's built-in net/http package.
This project demonstrates a deep understanding of the HTTP protocol, TCP networking, and request/response lifecycles by manually implementing core server logic.
-
🔌 Custom TCP Listener
Built the foundation using Go'snetpackage to accept raw TCP connections. -
📜 Manual HTTP Parsing
- Extracted Request Line (method, path, protocol)
- Parsed Headers by hand
- Supported Request Body parsing
-
🖋 Response Writing
- Implemented logic to construct valid HTTP responses
- Supported sending text and binary content
-
⚙️ Custom Routing & Handlers
- Users can register functions based on routes
- Each handler processes the request and writes back the response
-
🎬 Static File Serving
- Served a video file over HTTP
- Showcased capability to handle large binary payloads
-
✅ Tests Included
- Wrote tests for request parsing, response writing, and routing logic
- Language: Go
- Core Packages Used:
net(for TCP sockets)bufio(for parsing incoming data)strings,bytes(for request parsing)
git clone https://github.com/your-username/go-http.git
cd go-httpgo run cmd/httpserver/main.go