goproxyreverso is a high-performance reverse proxy solution designed for scalability and reliability. It acts as an intelligent gateway, leveraging Go's concurrency primitives to distribute traffic efficiently across multiple backends while providing real-time health monitoring and protection through rate limiting.
# Request to Proxy
curl -i http://localhost:8080/api/resource
# Backend Response (Headers injected by goproxyreverso)
HTTP/1.1 200 OK
X-Real-IP: 192.168.1.15
X-Forwarded-For: 192.168.1.15
...# Accessing real-time Prometheus metrics
curl http://localhost:8080/metrics| Technology | Role |
|---|---|
| Go 1.24 | Core language and concurrent execution |
| httputil | Low-level reverse proxy implementation |
| Prometheus | Metrics collection and observability |
| Viper | Scalable configuration management (YAML) |
| x/time/rate | Token Bucket implementation for rate limiting |
- Go >= 1.24 (defined in
go.mod) golangci-lint(for development)- Network tools (curl)
go install github.com/ESousa97/goproxyreverso/cmd/proxy@latestgit clone https://github.com/ESousa97/goproxyreverso.git
cd goproxyreverso
# make build
make run| Target | Description |
|---|---|
make build |
Compiles the project binary to dist/ |
make run |
Runs the proxy directly via go run |
make test |
Runs all unit tests in the project |
make lint |
Runs the linter (golangci-lint or go vet) |
make clean |
Removes build artifacts and the dist/ folder |
make help |
Displays all available make targets |
The project adopts a modular architecture focused on separation of concerns:
cmd/proxy: Entry point and application bootstrapping.internal/proxy: Core logic containing load balancing strategies.Least Connections: Dynamic traffic distribution based on active requests.Health Checks: Asynchronous background pinger for server rotation.Rate Limiter: Per-IP protection using the Token Bucket algorithm.
Detailed documentation of the internal packages and structures can be found at pkg.go.dev.
The application uses proxy.yaml for configuration.
| Variable | Description | Type | Default |
|---|---|---|---|
listen_addr |
Port and address the proxy listens on | string | :8080 |
health_check_interval |
Interval between backend health pings | duration | 5s |
backends |
List of upstream server URLs | []string | [] |
rate_limit.rps |
Limit of requests per second per IP | float | 10.0 |
rate_limit.burst |
Maximum burst allowed for rate limiting | int | 10 |
- Phase 1: Core Forwarding Engine
- Phase 2: Atomic Round-Robin Load Balancing
- Phase 3: Active Health Check System
- Phase 4: Least Connections Algorithm & Rate Limiting
- Phase 5: Prometheus Metrics & YAML Configuration
Contributions are welcome! See the full guide at CONTRIBUTING.md.
Distributed under the MIT license. See LICENSE for more details.
