A low-level HTTP/1.1 server and parser built from scratch using pure TCP sockets in Go — no net/http, no frameworks.
This project explores how HTTP actually works under the hood by implementing:
- TCP server using
net.Listen - Byte-level stream processing
- Custom HTTP request parsing
- Basic HTTP response handling
Instead of relying on abstractions, this project treats everything as a stream of bytes, helping you deeply understand networking fundamentals.
- TCP vs UDP: Reliable, ordered data transmission
- Streams: Files and network connections as byte streams
- HTTP Protocol:
- Request line (
GET /path HTTP/1.1) - Headers (key-value pairs)
- Body parsing (Content-Length, etc.)
- Request line (
- Parsing: Converting raw text into structured data
Client (curl/browser)
↓
TCP Connection
↓
Read byte stream
↓
Parse HTTP request
↓
Generate response
↓
Send back over TCPgo run cmd/httpserver/main.goIn another terminal:
curl http://localhost:42069- Read data byte-by-byte from TCP connections
- Line-based stream parsing using Go interfaces
- Custom HTTP request parser (start line, headers, body)
- Works with raw HTTP requests (via
curlor netcat)
- Understand how HTTP is built on TCP
- Learn how data is streamed and parsed
- Build intuition for protocols and system design
- Transition from “library user” → “system builder”
- Minimal HTTP compliance
- No concurrency optimizations
- No TLS / HTTP2 / HTTP3 support
- Designed for learning, not production
- RFC 9110 (HTTP Semantics)
- RFC 9112 (HTTP/1.1)
- Go
netpackage
Inspired by hands-on systems learning approaches focused on building everything from first principles.