Proxify is a Layer 7 (application-layer) HTTP load balancer and reverse proxy written in Go that sits between clients and upstream services. It selects an upstream for each incoming HTTP request using round-robin or least-outstanding load balancing, then forwards the request and response.
Proxify operates at the HTTP request level and provides health checks, circuit breaking, rate limiting, request logging, metrics, and graceful shutdown.
- Reverse proxy
- Request forwarding
- Response forwarding
- Configurable upstreams
- Round-robin load balancing
- Least-outstanding load balancing
- Health checks
- Circuit breaker
- Shared HTTP transport
- Rate limiting
- Request ID middleware
- Request logging
- Metrics endpoint
- Graceful shutdown
- Docker support
- YAML-based configuration
- Go
- Docker
- YAML
Start the example upstream services in separate terminals.
Terminal 1:
go run ./examples/upstream \
--name api-1 \
--port 9001Terminal 2:
go run ./examples/upstream \
--name api-2 \
--port 9002Then start Proxify:
go run ./cmd/proxifyor with a specific configuration:
go run ./cmd/proxify --config configs/least-outstanding.yamlStart the entire environment with:
docker compose up --buildDocker Compose starts:
- Proxify
- Upstream API 1
- Upstream API 2
Proxify can also be used as a standalone reverse proxy for your own applications.
Start with one of the example configuration files in the configs/ directory and update the upstreams to point to your own services.
upstreams:
- id: api-1
url: http://api-1:9001
- id: api-2
url: http://api-2:9002Then start Proxify with your configuration:
./proxify --config config.yamlor
go run ./cmd/proxify --config config.yamlIf you're using the Docker image:
docker run \
-p 8080:8080 \
-v $(pwd)/config.yaml:/app/config.yaml \
rahmannugar/proxify \
--config /app/config.yamlAny compatible YAML configuration can be supplied using the --config flag.
The repository includes several example configurations:
configs/round-robin.yamlconfigs/least-outstanding.yamlconfigs/docker.yaml
Metrics are available at:
GET /metrics
Each upstream exposes:
GET /health
The proxy periodically checks upstream health and only routes requests to healthy upstreams.