1. 安装Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. 使用Homebrew安装proxychains-ng
brew install proxychains-ng
3. 修改/usr/local/etc/proxychains.conf
文件
在文件末尾[ProxyList]
后面,
把原来的socks4 127.0.0.1 9050
删掉,添加socks5 127.0.0.1 1080
...
[ProxyList]
socks5 127.0.0.1 1080
4. 使用方法
重新打开一个命令行窗口,
用法就是在常规命令之前加上proxychains4
~ proxychains4 curl google.com
[proxychains] config file found: /usr/local/etc/proxychains.conf
[proxychains] preloading /usr/local/Cellar/proxychains-ng/4.12_1/lib/libproxychains4.dylib
[proxychains] DLL init: proxychains-ng 4.12
[proxychains] Strict chain ... 127.0.0.1:1080 ... google.com:80 ... OK
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
对比一下,不用proxychains4
的情况
~ curl google.com
curl: (7) Failed to connect to google.com port 80: Operation timed out