An open API service indexing awesome lists of open source software.

https://github.com/ym496/web-server

A minimal multi-threaded http server from scratch in java.
https://github.com/ym496/web-server

java network-programming socket-programming web-server

Last synced: about 1 year ago
JSON representation

A minimal multi-threaded http server from scratch in java.

Awesome Lists containing this project

README

          

# minimal http server in java
This is a lightweight multi-threaded HTTP server built from scratch using Java. It can handle GET, POST, and other HTTP requests asynchronously. It supports HTTP methods and serves files from a specified directory. It can process multiple requests at the same time by leveraging Java’s threading mechanism. I created this to understand how HTTP servers work.

## demo
* serves files with different MIME type from a specified dir


web server demo

* http method POST example


web server demo

* this server uses Java threads to handle client requests concurrently. Each client request is processed in its own thread, ensuring non-blocking, simultaneous processing of multiple requests.
## Installation

1. Clone this repo:
```bash
git clone git@github.com:ym496/web-server.git
cd web-server
```
2. Compile the server:
```bash
javac Server.java
```
3. Run the server:
```bash
java Server
```
## License

This project is licensed under the MIT License.