File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22DOMAIN = example.com
33EMAIL = you@example.com
44
5- # Proxy credentials (override values in mounted config ).
6- PROXY_USERNAME = user
7- PROXY_PASSWORD = pass
5+ # Proxy credentials (leave empty to disable Basic auth ).
6+ PROXY_USERNAME =
7+ PROXY_PASSWORD =
88
99# Optional: chain through an upstream proxy.
1010# PROXY_UPSTREAM_PROXY=https://user:pass@upstream-proxy:8080
Original file line number Diff line number Diff line change @@ -30,20 +30,22 @@ Download the latest binary from the [Releases](https://github.com/hightemp/https
3030
3131### Docker
3232
33- One-liner (HTTP proxy on port 8080, default user/pass ` user ` / ` pass ` ):
33+ One-liner (HTTP proxy on port 8080, ** no authentication ** ):
3434
3535``` sh
3636docker run -d --name https_proxy -p 8080:8080 hightemp/https_proxy:latest
3737```
3838
39- Override credentials via env vars (no config file needed) :
39+ Enable Basic auth via env vars:
4040
4141``` sh
4242docker run -d --name https_proxy -p 8080:8080 \
4343 -e PROXY_USERNAME=alice -e PROXY_PASSWORD=s3cret \
4444 hightemp/https_proxy:latest
4545```
4646
47+ > If both ` username ` and ` password ` are empty, authentication is disabled.
48+
4749With a custom config:
4850
4951``` sh
Original file line number Diff line number Diff line change 11proxy_addr : 0.0.0.0:8080
2- username : user
3- password : pass
2+ username : " "
3+ password : " "
44proto : http
55cert_path : " "
66key_path : " "
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ services:
99 environment :
1010 PROXY_ADDR : 0.0.0.0:8080
1111 PROXY_PROTO : http
12- PROXY_USERNAME : ${PROXY_USERNAME:-user }
13- PROXY_PASSWORD : ${PROXY_PASSWORD:-pass }
12+ PROXY_USERNAME : ${PROXY_USERNAME:-}
13+ PROXY_PASSWORD : ${PROXY_PASSWORD:-}
1414 PROXY_UPSTREAM_PROXY : ${PROXY_UPSTREAM_PROXY:-}
1515
1616 # HTTPS proxy with Let's Encrypt certificates (read from shared volume)
@@ -23,8 +23,8 @@ services:
2323 environment :
2424 PROXY_ADDR : 0.0.0.0:8443
2525 PROXY_PROTO : https
26- PROXY_USERNAME : ${PROXY_USERNAME:-user }
27- PROXY_PASSWORD : ${PROXY_PASSWORD:-pass }
26+ PROXY_USERNAME : ${PROXY_USERNAME:-}
27+ PROXY_PASSWORD : ${PROXY_PASSWORD:-}
2828 PROXY_CERT_PATH : /etc/letsencrypt/live/${DOMAIN:?DOMAIN must be set in .env}/fullchain.pem
2929 PROXY_KEY_PATH : /etc/letsencrypt/live/${DOMAIN}/privkey.pem
3030 PROXY_UPSTREAM_PROXY : ${PROXY_UPSTREAM_PROXY:-}
Original file line number Diff line number Diff line change @@ -210,6 +210,11 @@ func applyEnvOverrides(c *Config) {
210210}
211211
212212func basicAuth (w http.ResponseWriter , r * http.Request ) bool {
213+ // Authentication disabled when no credentials are configured.
214+ if config .Username == "" && config .Password == "" {
215+ return true
216+ }
217+
213218 auth := r .Header .Get ("Proxy-Authorization" )
214219 if auth == "" {
215220 slog .Debug ("No Proxy-Authorization header" , "remote" , r .RemoteAddr )
You can’t perform that action at this time.
0 commit comments