Add
Acquire::http::proxy "socks5h://server:port";
Acquire::https::proxy "socks5h://server:port";
to a apt.conf.d file (like /etc/apt/apt.conf.d/12proxy)
see https://askubuntu.com/questions/35223/syntax-for-socks-proxy-in-apt-conf/1117259#1117259
reference: https://www.codevoila.com/post/16/convert-socks-proxy-to-http-proxy-using-polipo
Change the configuration:
# Mac: /opt/local/etc/polipo/config
# Ubuntu: /etc/polipo/config
socksParentProxy = "127.0.0.1:1080"
socksProxyType = socks5
proxyAddress = "::0" # both IPv4 and IPv6
# or IPv4 only
# proxyAddress = "0.0.0.0"
proxyPort = 8123
Launch Polipo with the configuration file:
$ polipo -c /opt/local/etc/polipo/config
$ export HTTP_PROXY=http://localhost:8123 HTTPS_PROXY=http://localhost:8123
see https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
and substitute https://***
with socks5://***
For docker >= 23.0, edit daemon.json
as below
{
"proxies": {
"http-proxy": "http://proxy.example.com:3128",
"https-proxy": "https://proxy.example.com:3129",
"no-proxy": "*.test.example.com,.example.org,127.0.0.0/8"
}
}
see https://stackoverflow.com/questions/31099279/running-conda-with-proxy
You can configure a proxy with conda by adding it to the .condarc
, like
proxy_servers:
http: http://user:[email protected]:8080
https: https://user:[email protected]:8080
in ~/.ssh/config, for Windows:
Host AAA
HostName CCC
User BBB
ProxyCommand ncat --proxy-type socks5 --proxy 127.0.0.1:10808 %h %p
for Linux:
Host github.com
HostName github.com
ProxyCommand nc -X 5 -x 127.0.0.1:7890 %h %p
in ~/.gitconfig
[http]
proxy = socks5://127.0.0.1:7890
[https]
proxy = socks5://127.0.0.1:7890
or on the command line:
git config --global http.proxy 'socks5://127.0.0.1:7890'
git config --global https.proxy 'socks5://127.0.0.1:7890'
or
HTTP_PROXY=socks5h://localhost:10808 HTTPS_PROXY=socks5h://localhost:10808 git fetch
run
HTTP_PROXY=socks5h://localhost:10808 HTTPS_PROXY=socks5h://localhost:10808 pip install {packages}
or run pip install {packages} --proxy socks5h://localhost:10808
which may need pysocks to run with socks proxy
run
http_proxy=socks5h://localhost:10808 HTTPS_PROXY=socks5h://localhost:10808 curl -L ${URL}
or run curl -L ${URL} --proxy socks5h://localhost:10808
run HTTP_PROXY=socks5h://localhost:10808 HTTPS_PROXY=socks5h://localhost:10808 cmake ..
,
according to https://stackoverflow.com/a/57489742/3036450
After editing xxx.yaml
with
mixed-port: 7890
run clash-linux-amd64 -d . -f xxx.yaml
The environment names are case sensitive! https://superuser.com/a/1690537/1038955