美文网首页
Proxy Command Line Tools in ubun

Proxy Command Line Tools in ubun

作者: 林慕空 | 来源:发表于2018-05-09 11:38 被阅读0次

在开发过程中,很多地方需要在命令行下添加各种第三方工具包,限于国内网络环境,经常下载失败,这时我们可以借助 proxychains, 方法如下:

1. 安装 proxychains

在 Debian/Ubuntu系统:

sudo apt-get install proxychains

创建一个文件  ~/.proxychains/proxychains.conf 内容如下:

strict_chain
proxy_dns 
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
localnet 127.0.0.0/255.0.0.0
quiet_mode

[ProxyList]
socks5  127.0.0.1 1080

以后就可以顺利安装各种开发工具包了 proxychains. 例如:

proxychains curl https://www.xxx.com/
proxychains git push origin master

更加棒的是,还可以设置 bash环境:

proxychains bash
curl https://www.xxx.com/
git push origin master

如果是苹果电脑:

# vim /usr/local/etc/proxychains.conf

socks5 127.0.0.1 49881          //把socks5 127.0.0.1 9050改为你自己的端口

相关文章

网友评论

      本文标题:Proxy Command Line Tools in ubun

      本文链接:https://www.haomeiwen.com/subject/yndnrftx.html