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.
- Host: GitHub
- URL: https://github.com/ym496/web-server
- Owner: ym496
- License: mit
- Created: 2024-12-12T15:39:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-13T03:22:29.000Z (over 1 year ago)
- Last Synced: 2025-02-15T23:22:38.491Z (over 1 year ago)
- Topics: java, network-programming, socket-programming, web-server
- Language: Java
- Homepage:
- Size: 554 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
* http method POST example
* 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.