基于proxychains4进行终端加速 wget,curl等

来源:互联网 发布:散打教学软件 编辑:程序博客网 时间:2024/06/07 01:39

基于proxychains4进行终端加速 wget,curl等

@(Macbook使用技巧学习)

电脑上使用ss加速后,往往只是浏览器上可用,但是在终端上并不可行,比如wget,curl等。比如这次想用wget下载文件,但是速度很慢,有一种解决方法是新建一个配置文件~/.wgetrc,写入内容:

use_proxy=yeshttp_proxy=http://127.0.0.1:1086https_proxy=https://127.0.0.1:1086

我本地ss监听端口是1086。

但是这个在我电脑上测试并未起作用,用ss官方的方法得到解决:proxychains4。

参考。

在MacOS上,先安装:

brew install proxychains-ng

新建一个配置文件:

~/.proxychains/proxychains.conf

vim ~/.proxychains/proxychains.conf时,显示Cann't open file for writing, 先新建.proxychains文件夹,再新建文件即可。

写入内容:

strict_chainproxy_dns remote_dns_subnet 224tcp_read_time_out 15000tcp_connect_time_out 8000localnet 127.0.0.0/255.0.0.0quiet_mode[ProxyList]socks5  127.0.0.1 1086

这个配置文件自动读取,但是具体的工具比如wget会优先读取.wgetrc配置文件,我开始先配置的.wgetrc文件,所以,先把这个文件名字改掉。

这样才能读取proxychains4 对应的配置。

应用方法是:

proxychains4 wget url

显示加速效果感人。

或者直接将bash进入proxy代理:

proxychains4 bash,再写命令,就不用再带proxychains4