MacOs下git,maven,port,terminal使用代理
1 git
//全局配置
git config --global http.proxy socks5://127.0.0.1:1087
//编辑全局配置文件
git config --global -e
//取消全局配置
git config --global --unset http.proxy
2 maven
~/.m2/setting.xml
<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>127.0.0。1</host>
<port>1087</port>
<nonProxyHosts>repo.njava.com</nonProxyHosts>
</proxy>
</proxies>
//命令行方式
mvn clean compile -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=1087
3 mac port
/opt/local/etc/macports/macports.conf
proxy_override_env yes
proxy_http 127.0.0.1:1087
4 terminal
//1 命令行
export http_proxy=http://127.0.0.1:1087
//2 配置文件.bashrc或者.zshrc
export http_proxy="http://127.0.0.1:1087"
export https_proxy="http://127.0.0.1:1087"