Written by razrlele
17:31 November 12, 2017
在打开Android Studio 项目的总是会卡在
1 |
gradle: resolve dependencies ':classpath' |
在网上找了一下,需要在项目目录下的gradle.properties
添加如下代理设置:
1 2 3 4 |
systemProp.https.proxyHost=127.0.0.1 systemProp.https.proxyPort=1080 systemProp.http.proxyHost=127.0.0.1 systemProp.http.proxyPort=1080 |
其中1080是本机上的Shadowsocks监听端口,但是后来并没有起多大作用,才想起来是Shadowsocks客户端应该是只处理socks5请求,所以想着大概需要把http请求转换成socks5请求,在网上又找了一下,发现果然有现成的工具——Polipo。
安装:
1 |
sudo apt-get install polipo |
编辑配置文件/etc/polipo/config
:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
logSyslog = true logFile = /var/log/polipo/polipo.log proxyAddress = "0.0.0.0" proxyPort = 8123 socksParentProxy = "127.0.0.1:1080" socksProxyType = socks5 chunkHighMark = 50331648 objectHighMark = 16384 serverMaxSlots = 64 serverSlots = 16 serverSlots1 = 32 |
然后重启一下polipo:
1 |
sudo /etc/init.d/polipo restart |
最后更新一下gradle.properties
:
1 2 3 4 |
systemProp.https.proxyHost=127.0.0.1 systemProp.https.proxyPort=8123 systemProp.http.proxyHost=127.0.0.1 systemProp.http.proxyPort=8123 |
就大功告成啦~