假设你已经有了一个ss,ss通过sock5转http帮助我们翻墙。这篇文章转如何给命令行软件设置http代理。

pip

~/.config/pip/pip.conf

1
2
[global]
proxy=http://localhost:1087

或者用国内镜像

1
2
3
4
5
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

git

clone with ssh

在 文件 ~/.ssh/config 后添加下面两行

1
2
Host github.com
ProxyCommand nc -X 5 -x 127.0.0.1:1080 %h %p

clone with http

1
2
git config --global http.proxy http://127.0.0.1:1087
git config --global https.proxy http://127.0.0.1:1087

curl

~/.curlrc

1
socks5 = "127.0.0.1:1080"

Gradle

~/.gradle/gradle.properties

1
2
3
4
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=1087
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=1087

go get

1
HTTP_PROXY=socks5://localhost:1080 go get

npm

1
2
npm config set proxy http://127.0.0.1:1087
npm config set https-proxy http://127.0.0.1:1087

yarn

1
2
yarn config set proxy http://XX
yarn config set https-proxy http://XX

gem

~/.gemrc

1
2
3
---
# See 'gem help env' for additional options.
http_proxy: http://localhost:1087

brew

1
ALL_PROXY=socks5://localhost:1080 brew ...

wget

~/.wgetrc

1
2
3
use_proxy=yes
http_proxy=127.0.0.1:1087
https_proxy=127.0.0.1:1087

参考:
https://github.com/comwrg/FUCK-GFW