https://github.com/vertyll/multithreaded-web-server
Multithreaded web server written in Rust.
https://github.com/vertyll/multithreaded-web-server
Last synced: 9 months ago
JSON representation
Multithreaded web server written in Rust.
- Host: GitHub
- URL: https://github.com/vertyll/multithreaded-web-server
- Owner: vertyll
- Created: 2024-12-06T21:13:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-27T09:09:26.000Z (about 1 year ago)
- Last Synced: 2025-04-27T10:22:54.679Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multithreaded Web Server
This repository contains an implementation of a multithreaded web server in Rust.
## Overview
The server demonstrates Rust's concurrency capabilities by handling multiple connections simultaneously using a thread pool architecture. This implementation showcases key Rust concepts such as:
- Thread management
- Thread pools
- MPSC (Multiple Producer, Single Consumer) channels
- Safe concurrency patterns
- Error handling
## Features
- Configurable thread pool for handling concurrent connections
- Graceful request handling and response generation
- Basic HTTP request parsing
- Static file serving capabilities
- Clean shutdown mechanism
## Implementation Details
The server uses a thread pool to manage a predefined number of worker threads. When a new connection arrives, it's passed to an available worker thread for processing rather than spawning a new thread for each connection, which provides better resource utilization and performance.
## Usage
To run the server:
```
cargo run
```
The server will start listening on `127.0.0.1:7878` by default.
## Testing
You can test the server by opening a web browser and navigating to:
```
http://127.0.0.1:7878
```