PorxyChains

MacOS系统下使用Proxychains-ng进行命令行下代理

安装

源码安装

1
brew install proxychains-ng

编译安装

1
2
3
4
5
git clone https://github.com/rofl0r/proxychains-ng
cd proxychains-ng
make
make install
sudo make install-config # 安装proxychains.conf配置文件

使用普通用户make install需要改变configure文件再进行编译安装

1
2
3
4
5
6
7
8
cd configure 
vi config.mak
将:
bindir = /usr/bin
libdir = /usr/lib
修改为:
bindir=/usr/local/bin
libdir=/usr/local/lib
分隔符不要忘了!!!!!!!!!

关闭SIP

macOS 10.11 后下由于开启了 SIP(System Integrity Protection) 会导致命令行下 proxychains-ng 代理的模式失效,如果使用 proxychains-ng 这种简单的方法,就需要先关闭 SIP。

配置文件

1
2
cd /usr/local/etc/proxychains.conf
vi proxychains.conf

在[ProxyList]下添加socks5代理

1
2
3
4
5
6
7
8
9
# 代理端口一定要和shadowsocks中的保持一致
# 如果有不明白的可以查看93~110
[ProxyList]
socks5 127.0.0.1 1080
# http 127.0.0.1 1235 (me)
# add proxy here ...
# meanwile
# defaults set to "tor"
# socks4 127.0.0.1 9050

Proxychains-ng使用

测试

1
proxychains4 curl cip.cc

使用

例如,Homebrew更新

1
proxychains4 brew update