MicroProxy provides a data-plane proxy (microproxy) plus a control-plane API (microproxy-control) so you can route downstream traffic through upstream providers and manage runtime behavior.
microproxy: serves downstream proxy listeners fromconfig.yamland exposes observability/health endpoints.microproxy-control: serves the control-plane HTTP API (default:8081) and usescontrolplane.envfor authentication.
From the repository root:
go build -o bin/microproxy ./cmd/microproxy
go build -o bin/microproxy-control ./cmd/microproxy-controlOptional quick version check:
./bin/microproxy -h
./bin/microproxy-control -hStart from the typed example:
cp deploy/config.example.yaml ./config.yamlImportant fields to review in config.yaml:
listeners[]: downstream interfaces (type,address, auth settings).providers[]: upstream proxies + health checks.routing: default provider and routing rules by tenant/host.policies: allow/deny/header policies.tenants: tenant-to-provider/policy binding.observability.health_endpoints: liveness/readiness/startup ports.
Tip: the example already includes single-provider, failover, and selenium-friendly scenarios as documented snippets.
Create runtime auth config for the control-plane API:
cp deploy/controlplane.env.example ./controlplane.envRecommended production baseline:
MICROPROXY_DEVELOPMENT_MODE=false
MICROPROXY_CONTROLPLANE_API_KEYS=<set-at-least-one-strong-key>
MICROPROXY_CONTROLPLANE_JWTS=Development-only mode (no explicit key set):
- Set
MICROPROXY_DEVELOPMENT_MODE=true - The default key becomes:
microproxy-controlplane-dev-key
Use two terminals.
./bin/microproxy -config ./config.yaml -health-addr :9090set -a
source ./controlplane.env
set +a
./bin/microproxy-control -config ./config.yaml -listen-addr :8081The repository Dockerfile builds microproxy. For microproxy-control, use a small companion Dockerfile.
docker build -t microproxy:local -f Dockerfile .Create Dockerfile.control:
FROM golang:1.24-alpine AS builder
WORKDIR /src
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOARM=${TARGETVARIANT} go build -o /out/microproxy-control ./cmd/microproxy-control
FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=builder /out/microproxy-control /usr/local/bin/microproxy-control
ENTRYPOINT ["/usr/local/bin/microproxy-control"]
CMD ["-config", "/etc/microproxy/config.yaml", "-listen-addr", ":8081"]Build it:
docker build -t microproxy-control:local -f Dockerfile.control .Example docker-compose.yml:
services:
microproxy:
image: microproxy:local
container_name: microproxy
env_file:
- ./controlplane.env
#- ../thecrowler/.env # if you want to share env vars with the CROWler project
ports:
- "8084:8080" # downstream proxy listener
- "8090:8090" # liveness
- "8091:8091" # metrics
- "8092:8092" # readiness
- "8093:8093" # startup
volumes:
- ./config.yaml:/etc/microproxy/config.yaml:ro
command: ["-config", "/etc/microproxy/config.yaml", "-health-addr", ":9090"]
microproxy-control:
image: microproxy-control:local
container_name: microproxy-control
env_file:
- ./controlplane.env
#- ../thecrowler/.env # if you want to share env vars with the CROWler project
ports:
- "8085:8081" # control-plane API
volumes:
- ./config.yaml:/etc/microproxy/config.yaml:ro
command: ["-config", "/etc/microproxy/config.yaml", "-listen-addr", ":8081"]Start:
docker compose up -d# Direct process mode
ps -ef | rg "microproxy|microproxy-control"
# Docker mode
docker compose pscurl -i http://127.0.0.1:8090/healthz # liveness (microproxy)
curl -i http://127.0.0.1:8092/readyz # readiness (microproxy)
curl -i http://127.0.0.1:8093/startupz # startup (microproxy)
curl -i http://127.0.0.1:8091/metrics # prometheus metricsUse one of the API keys in controlplane.env:
export API_KEY='<your-key-from-controlplane.env>'
curl -i -H "X-API-Key: ${API_KEY}" http://127.0.0.1:8085/api/v1/healthIf you are in development mode (MICROPROXY_DEVELOPMENT_MODE=true and no configured keys), test with:
curl -i -H "X-API-Key: microproxy-controlplane-dev-key" http://127.0.0.1:8085/api/v1/health- Clients send proxy traffic to
microproxylistener(s), for examplehttp://<host>:8084. microproxyroutes traffic usingrouting+tenantsinconfig.yaml.microproxy-controlexposes API operations for control/inspection (protected by key/JWT auth).- Operators monitor health/metrics endpoints and adjust configuration as needed.
For a detailed control-plane usage guide (endpoint catalog, auth/roles, and deployment model), see controlplane.md.
We welcome contributions. Please read CONTRIBUTING.md.
Copyright Paolo Fabio Zaino, all rights reserved.
Licensed under MPL 2.0. See LICENSE.