A high-performance reverse proxy with advanced load balancing capabilities
A high-performance reverse proxy implementation in Go with advanced load balancing capabilities and YAML-based configuration.
- Configurable load balancing strategies
- Round-robin (implemented)
- Random selection (planned)
- Least connections (planned)
- Health checks for backend servers
- Connection pooling and timeout management
- Extensive metrics collection
- Comprehensive logging system
- YAML-based configuration
reverse-proxy/
βββ main.go # Main proxy implementation
βββ config.yml # Configuration file
βββ README.md # Documentation
reverse-proxy/
βββ cmd/
β βββ proxy/
β βββ main.go # Application entry point
βββ internal/
β βββ config/
β β βββ config.go # Configuration structs and loading
β β βββ validator.go # Configuration validation
β βββ proxy/
β β βββ handler.go # Request handling logic
β β βββ metrics.go # Metrics collection
β β βββ pool.go # Connection pooling
β βββ balancer/
β β βββ round_robin.go # Round-robin implementation
β β βββ random.go # Random selection implementation
β β βββ least_conn.go # Least connections implementation
β βββ health/
β βββ checker.go # Health check implementation
β βββ monitor.go # Health status monitoring
βββ pkg/
β βββ logger/ # Logging package
β βββ middleware/ # Middleware implementations
βββ api/
β βββ admin/ # Admin API endpoints
βββ web/
β βββ dashboard/ # Web dashboard files
βββ tests/
β βββ integration/ # Integration tests
β βββ performance/ # Performance benchmarks
βββ docs/
β βββ api.md # API documentation
β βββ deployment.md # Deployment guide
βββ deployments/
β βββ docker/ # Docker configurations
β βββ kubernetes/ # Kubernetes manifests
βββ scripts/ # Build and maintenance scripts
βββ config.yml # Main configuration file
βββ go.mod # Go module file
βββ go.sum # Go module checksum
βββ README.md # Project documentation
The proxy is configured using config.yml. Example configuration:
servers:
- address: "127.0.0.1:9091"
timeout:
connect: 5s
read: 10s
write: 10s
load_balancer:
strategy: "round-robin"
health_check:
interval: 5s
timeout: 2s
retries: 3- Clone the repository:
git clone https://github.com/Ameriq8/reverse-proxy.git
cd reverse-proxy-
Configure your backend servers in
config.yml -
Run the proxy:
go run main.go- Go 1.16 or higher
- YAML configuration file
- Implement configuration loading from YAML
- Add health check functionality
- Implement connection pooling
- Add metrics collection (Prometheus)
- Add structured logging
- Additional load balancing strategies
- Random selection
- Least connections
- IP hash-based routing
- TLS support
- Request/response middleware
- Rate limiting
- Circuit breaker implementation
- Admin REST API
- Monitoring dashboard
- Service discovery integration
- Caching layer
- WebSocket support
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
We welcome contributions! Please see our Contributing Guidelines for details.
This project follows the Contributor Covenant Code of Conduct.
This project is licensed under the MIT License - see the LICENSE file for details.
- Go standard library for excellent networking primitives
- YAML community for configuration support