Append to ~/.zshrc
or ~/.bashrc
export http_proxy="http://<proxy-host>:<proxy-port>/"
export https_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,192.168.1.1,::1,*.local"
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export NO_PROXY=$no_proxy
Ref: https://wiki.archlinux.org/title/Proxy_server#Environment_variables
Append a new proxies
field to ~/.docker/config.json
:
{
...
"proxies": {
"default": {
"httpProxy": "http://<proxy-host>:<proxy-port>/",
"httpsProxy": "http://<proxy-host>:<proxy-port>/",
"noProxy": "localhost,127.0.0.1,192.168.1.1,::1,*.local"
}
}
}
Notes: Docker proxies don't work with hostname (defined in /etc/hosts
)
Ref: https://docs.docker.com/network/proxy/
Append to ~/.ssh/config
Host <vpn-protected-host>
ProxyCommand ssh -q <username>@<proxy-host> nc %h %p
Ref: https://www.systutorials.com/git-through-ssh-tunnel-as-proxy/
Create or append to ~/.config/chrome-flags.conf
--proxy-server=<proxy-host>:<proxy-port>
Ref: https://www.mankier.com/1/google-chrome#--proxy-server
Append to ~/.zshrc
or ~/.bashrc
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
Ref: mitmproxy/mitmproxy#2547 (comment)
There need to be some extra steps to get the machine work with mitmproxy
, because it uses custom CA certificates to decode the requests.
Notes: I haven't figured out a proper way to make WebSocket connections work under mimtproxy
Download mitmproxy-ca-cert.pem
file from mitmproxy:
$ openssl x509 -in mitmproxy-ca-cert.pem -inform PEM -out mitmproxy.crt
$ sudo trust anchor mitmproxy.crt
Ref: https://gist.github.com/franciscocpg/a4f52afcc00d472a9d7c407db16a92ee
Copy mitmproxy.crt
to the project and prepend to Dockerfile
(as root
access):
COPY mitmproxy.crt /usr/local/share/ca-certificates
RUN update-ca-certificates