- Why proxy-router?
- How it works?
- Key features
- Quick start
- Environment variables
- Updating credentials? Just edit one file
- Contribute & customize
If you are working in an environment with multiple proxies, each with its own authentication method, and you are tired of constantly updating credentials across tools, proxy-router is your one-stop solution to simplify management, eliminate hardcoded secrets, and keep your workflows running smoothly from one place.
-
- Broken workflows when proxy passwords rotate (and you forget to update
git,npm,curl, etc.) - Hardcoded credentials in config files (security risk + maintenance nightmare)
- Wasted time manually configuring each tool to use the right proxy
- Broken workflows when proxy passwords rotate (and you forget to update
-
- Centralized credentials – Update passwords in one place instead of every tool
- Automatic routing – Smart hostname pattern matching (e.g.,
*.my-company-domain.com) - Zero downtime – Change credentials without restarting tools
- Docker-friendly – Deploy in seconds, works seamlessly in dev environments
- Intercepts requests from any tool (
git,npm,curl, etc.) - Match the hostname against your routing rules
- Inject the correct proxy credentials (no manual auth setup!)
- Route the request to the right proxy – automatically
- Wildcard host matching – Route
*.internal.comandapi.external.comdifferently - Dynamic auth headers – No more editing
.npmrcor.gitconfigfor password changes - Lightweight & fast – Low-latency forwarding with configurable timeouts
- Docker & CI-ready – Prebuilt image + compose support
Define your credentials, proxies, and routing rules in simple JSON files:
-
Credentials: auth.json
[ { "id": "company-user", "username": "company-username", "password": "company-password" }, { "id": "internet-user", "username": "internet-username", "password": "internet-password" } ] -
Proxies: proxy.json
[ { "id": "company-proxy", "hostname": "pxy-company.my-company-domain.com", "port": 3128, "authenticationId": "company-user" }, { "id": "external-proxy", "hostname": "pxy-external.my-company-domain.com", "port": 3128, "authenticationId": "company-user" }, { "id": "internet-proxy", "hostname": "pxy-internet.my-company-domain.com", "port": 3128, "authenticationId": "internet-user" } ] -
Routing rules: routing.json
[ { "requestHostnamePattern": "*.my-company-domain.com", "proxyId": "company-proxy" }, { "requestHostnamePattern": "*.external-domain.com", "proxyId": "external-proxy" }, { "requestHostnamePattern": "pxy-internet.my-company-domain.com", "proxyId": "internet-proxy" } ]
-
Docker Compose
services: proxy-router: container_name: proxy-router image: danozka/proxy-router ports: - "8888:8888" restart: unless-stopped volumes: - ./secrets/auth.json:/app/auth.json # Update path with your auth config - ./secrets/routing.json:/app/routing.json # Update path with your routing config - ./secrets/proxy.json:/app/proxy.json # Update path with your proxy config
-
Docker CLI
docker run -d \ --name proxy-router \ -p 8888:8888 \ --restart=unless-stopped \ -v ./secrets/auth.json:/app/auth.json \ # Update path with your auth config -v ./secrets/routing.json:/app/routing.json \ # Update path with your routing config -v ./secrets/proxy.json:/app/proxy.json \ # Update path with your proxy config danozka/proxy-router
- git:
git config --global http.proxy http://localhost:8888
- npm:
npm config set proxy http://localhost:8888 - curl:
export http_proxy=http://localhost:8888
| Variable | Default | Description |
|---|---|---|
LOGGING_LEVEL |
INFO | Logging level of the proxy |
AUTH_CONFIG_FILE_PATH |
/app/auth.json | Path to the authentication configuration file |
ROUTING_CONFIG_FILE_PATH |
/app/routing.json | Path to the routing rules configuration file |
PROXY_CONFIG_FILE_PATH |
/app/proxy.json | Path to the proxies configuration file |
PROXY_SERVER_BUFFER_SIZE_BYTES |
4096 | Buffer size in bytes of each streaming request reader |
PROXY_SERVER_HOST |
0.0.0.0 | Hostname that the proxy will be bound to |
PROXY_SERVER_PORT |
8888 | Port that the proxy will listen to |
PROXY_SERVER_TIMEOUT_SECONDS |
60.0 | Time in seconds to shutdown unused connections |
No restarts. No tool reconfigurations.
Change auth.json, and proxy-router handles the rest.
PRs welcome! Licensed under MIT.

