Built my own HTTP server in Rust from scratch
Hey everyone!
I’ve been working on a small experimental HTTP server written 100% from scratch in Rust, called HTeaPot.
No tokio, no hyper — just raw Rust.
It’s still a bit chaotic under the hood (currently undergoing a refactor to better separate layers and responsibilities), but it’s already showing solid performance. I ran some quick benchmarks using oha and wrk, and HTeaPot came out faster than Ferron and Apache, though still behind nginx. That said, Ferron currently supports more features.
What it does support so far:
- HTTP/1.1 (keep-alive, chunked encoding, proper parsing)
- Routing and body handling
- Full control over the raw request/response
- No unsafe code
- Streamed responses
- Can be used as a library for building your own frameworks
What’s missing / WIP:
- HTTPS support (coming soon™)
- Compression (gzip, deflate)
- WebSockets
It’s mostly a playground for me to learn and explore systems-level networking in Rust, but it’s shaping up into something pretty fun.
Let me know if you’re curious about anything — happy to share more or get some feedback.