为Gradle、Git设置代理

585 阅读1分钟

由于一些特殊的原因gradle下载会比较慢,即使我们使用了技术方法可以高速使用github
但是在使用git、gradle时依然步履蹒跚,那么就需要我们进行配置


Git

http代理:

git config --global http.proxy http://127.0.0.1:10800 
git config --global https.proxy https://127.0.0.1:10800

socks5代理:

git config --global http.proxy 'socks5://127.0.0.1:10800'
git config --global https.proxy 'socks5://127.0.0.1:10800'

Gradle

windows在 系统盘/users/$username/.gradle/目录下创建gradle.properties文件

systemProp.https.proxyPort=10809
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=10809

##注意
请替换成自己的代理地址及端口