Java HTTP server implementation built without external libraries
Table of Contents
This project aims to implement a basic HTTP server in Java without relying on any external libraries. It follows the HTTP protocol standards and provides features to handle incoming requests, generate responses, and manage concurrency using thread pools.
- Java Socket API
To get a local copy up and running follow these simple example steps.
- Java Development Kit (JDK) installed
- Java 21
-
Clone the repo
git clone https://github.com/ujjwalgarg100204/http-server-using-java.git
-
Run the server
mvnw exec:java
To start the server, run the following command:
mvnw exec:java
Once the server is running, you can use curl or any HTTP client to send requests to the server.
curl -v http://localhost:4221
curl -v http://localhost:4221/abcdefg
curl -v http://localhost:4221/echo/abc
curl -v --header "User-Agent: foobar/1.2.3" http://localhost:4221/user-agent
Server | Client |
---|---|
Your Name - @ujjwalgarg100204 - ujjwalgarg100204@gmail.com
Project Link: https://github.com/ujjwalgarg100204/http-server-using-java
- CodeCrafters for providing the challenge and inspiration to create this project.
- MDN Web Docs for reference to HTTP standards.