# privoxy
# 将 ss 的代理转换成命令行 http 代理
# 安装配置
brew install privoxy # 安装
# 新增配置
vim /usr/local/etc/privoxy/config
# 1080是ss的代理端口, 8118是代理端口
listen-address 0.0.0.0:8118
forward-socks5 / 127.0.0.1:1080 .
# 启动
brew services start privoxy
# 是否开启
netstat -na | grep 8118
# 使用
比如 gist 的代码,默认是在墙外,无法 clone
git clone https://gist.github.com/zlxbuzz/e60c413be3a06911e0d35e6844d52b57
fatal: unable to access 'https://gist.github.com/zlxbuzz/e60c413be3a06911e0d35e6844d52b57/': Failed to connect to gist.github.com port 443: Operation timed out
执行代理之后
export https_proxy='https://localhost:8118' # 可以放在zshrc
Cloning into 'e60c413be3a06911e0d35e6844d52b57'...
remote: Counting objects: 36, done.
remote: Total 36 (delta 0), reused 0 (delta 0), pack-reused 36
Unpacking objects: 100% (36/36), done.
ps: ping使用的是icmp协议,所以无法代理