Audi Husen Mustofa
All projects
Backend

Simple Web Server in Java

Understanding HTTP by building a Java socket server with threaded requests, file serving, protected routes, and a desktop interface.

Simple Web Server in Java

The Goal

I built a small web server to understand what happens when a browser requests a page and a server sends a response. This was an independent university course project.

What I Built

Using Java sockets, I implemented a server that accepts client connections and handles each request in a separate thread. It reads HTTP GET requests, serves files with the appropriate content type, and returns responses such as 401, 404, and 405 when needed. The application also supports directory listings, protected routes, access logs, and rendering Markdown files as HTML.

Process and Reflection

I added a Swing interface to load a configuration file, start or stop the server, and display messages. Building these pieces helped me understand the HTTP request and response cycle and what local development tools such as XAMPP handle behind the scenes.

Supporting Materials

View the source code on GitHub

Built with
Java 21GradleSwing
Explore more work