Welcome to the Rust Reverse Proxy with Load Balancing project! This is a Rust implementation of a reverse proxy designed to efficiently handle HTTP requests and distribute them among multiple backend servers for load balancing.
-
HTTP Server: Utilizes Rust's
hyper
crate to implement a performant HTTP server, capable of handling incoming requests. -
Request Parsing: Parses incoming HTTP requests, extracting relevant information like method, headers, and target URL.
-
Response Handling: Processes backend server responses and forwards them back to the client.
-
Server Pool Management: Maintains a pool of backend servers and efficiently distributes incoming requests among them.
-
Dynamic Weighting: Allows dynamic adjustment of backend server weights based on configuration, enabling fine-grained control over load balancing.
-
Health Checks: Implements a health-check mechanism to ensure only healthy backend servers receive traffic.
- TOML Configuration: Utilizes a TOML configuration file (
config.toml
) for easy customization of proxy settings, including backend server details and load balancing parameters.
-
Request Logging: Logs detailed information about incoming requests, including method, URL, and response status.
-
Monitoring Endpoints: Exposes monitoring endpoints for metrics retrieval, providing insights into proxy performance and health.
- Rust: Ensure Rust is installed on your system.
-
Clone the repository:
git clone https://github.com/yourusername/reverse-proxy-rust.git cd reverse-proxy-rust
-
Build the project:
cargo build --release
-
Customize the configuration file in
config.toml
to suit your environment and backend servers. -
Run the reverse proxy application:
./target/release/reverse-proxy-rust
Contributions are welcome! If you encounter issues, have suggestions, or want to contribute new features, please open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.