
15. März 2025
Glass Box is an educational HTTP/1.1 server built to demystify web protocols. It exposes the "hidden" work of a web server by streaming internal metrics to a client-side dashboard, allowing users to watch their requests flow through the parsing, routing, and response pipeline live.
Glass Box is a fully handcrafted HTTP/1.1 server built from the ground up in Java — no frameworks, no magic. The goal was to understand exactly what happens between a browser sending a request and a server sending a response, and to make that invisible process visible.
Rather than treating the server as a black box, Glass Box streams live internal metrics to a browser-based dashboard via Server-Sent Events. You can watch each request move through parsing, routing, and response generation in real time.
Glass Box has shipped 4 releases and 100+ commits. It supports virtual hosts, static file serving, RESTful routing, and real-time server stats — all without a single framework dependency in the core.
HTTP servers are everywhere but their internals are opaque. Most developers use frameworks that hide the protocol layer entirely — making it hard to build intuition for what actually happens during a request/response cycle.
Build the server from scratch in Java, implementing the TCP/HTTP core, request parsing, routing, and response handling manually. Then expose all of that via a live dashboard so the internals are never hidden.
The project separates concerns cleanly across three layers: the TCP/HTTP core handles raw socket I/O and protocol parsing; the routing layer dispatches requests to typed handlers; and the metrics layer collects and streams server statistics without coupling to business logic. Handler registration uses a factory pattern, making it straightforward to add new endpoints without touching existing code.