This problem set guides you through building a basic HTTP server from scratch using Java's standard library, specifically the java.net.ServerSocket and java.net.Socket classes. The goal is to create a server that handles simple GET requests, parses incoming HTTP requests, and sends valid HTTP responses. We'll break it down into "tickets" – small, incremental tasks that build upon each other, simulating a real-world project workflow.
Prerequisites:
- Basic Java knowledge (sockets, I/O streams, file handling, string manipulation).
- No external libraries are allowed; use only Java's standard library (e.g.,
java.net,java.io,java.nio.file). - Test your server using tools like
curl(e.g.,curl http://localhost:8080/) or a web browser.