A proxy server that adds a Basic Authorization header for another proxy.
Alpine-based image built on Squid.
Japanese reference (Qiita): https://qiita.com/Splascope/items/98c6bbcd76ff54a8f723
- Requires only Docker Compose
- No system-wide proxy settings are needed before launch
flowchart LR
subgraph local[Local Network]
app[Proxy Client Application]
subgraph container[Docker Container]
authproxy[Auth Delegation Proxy Server]
end
proxy[Authenticated Proxy Server]
end
internet[Internet]
app -- "No auth header" --> authproxy
authproxy -- "Authorization: Basic header added" --> proxy
proxy --> internet
- Docker
- Docker Compose
- Clone the repository
git clone https://github.com/k-ishigaki/proxy-docker- Move into the project directory
cd proxy-docker- Load the bundled Alpine image
docker load -i ./alpine.tar- Create and edit
.env
cp .env.example .env
vi .envMake sure to set HTTP_PROXY_FOR_PROXY in .env (required).
- Start in the background
docker compose up -d- Test connectivity
curl -x localhost:8080 https://www.google.comIf you changed HOST_BIND_PORT, use that value instead of 8080.
Add direct-access (no proxy) domains to .direct_access_domains.
Squid will access these domains directly.
Example:
example.com
api.example.com
docker compose down --rmi all --volume