各种命令行代理技巧

2017-04-28  本文已影响0人  john1king

curl 使用 socks5 代理

curl --socks5-hostname 127.0.0.1:1080 http://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/13.04/x86_64/chef_11.16.0-1_amd64.deb -O

SSH 代理

ssh -D7070 -p443 -N -v user@serveraddress

这时你就已经拥有了一个地址为 127.0.0.1:7070 的sock5代理了!

简单解释一下ssh命令参数的含义:

注:参考资料地址忘记保存了

socks 转 http 代理

macOS 安装 privoxy

brew install privoxy

privoxy 默认监听 8118 端口

 netstat -an | grep 8118

修改配置文件,添加

 forward-socks5 / 127.0.0.1:1080 .

参考资料

apt-get 使用代理

export http_proxy=http://yourproxyaddress:proxyport
apt-get install <pkg>

brew 使用代理

socks5 代理

ALL_PROXY=socks5://127.0.0.1:1080 brew update

http 代理

http_proxy=http://IP:PORT https_proxy=http://IP:PORT brew update

pip 使用代理

pip install mitmproxy --proxy=127.0.0.1:8087

git 设置代理

cat ~/.gitconfig

[http] 
proxy = socks5://127.0.0.1:7777 
[https] 
proxy = socks5://127.0.0.1:7777 

临时用

 export http_proxy="http://IP:PORT"
 export https_proxy="http://IP:PORT"
上一篇 下一篇

猜你喜欢

热点阅读