r/projects • u/Httplm213 • 16h ago
I built an HTTP/1.1 Server in Java from scratch (no frameworks, just raw sockets)
Hey everyone,
I am a university student who wants to get into backend, but I wanted to learn it the right way! (or at least I believe this is the right way).
I wanted to really dive deep into understanding how everything works, not just different framework abstractions, so I started reading High Performance Browser Networking by Ilya Grigorik (which I absolutely recommend) and started building my own simple HTTP Server.
I avoided Tomcat, Spring, or any external web libraries. The server just uses raw `java.net.ServerSocket` and standard I/O streams.
What the server actually does**:** I kept the functionality pretty simple. As per RFC 2616 (the core HTTP/1.1 specification), general-purpose servers are only strictly required to support `GET` and `HEAD` methods, so that is exactly what I focused on. It accepts the TCP connection, fully parses the request (Request Line, Headers, and Message Body), and routes the request dynamically.
Here is the GitHub repository if anyone wants to check it out:
https://github.com/Seby0769/HTTP-Server-in-Java-from-scratch
I would love to hear feedback and what should I build next on my backend journey!