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命令參數的含義:
-
-D7070
這里7070是你要轉發的本機sock5端口,可以任意修改 -
-p443
這里443是遠程ssh主機的端口,根據遠程主機的設置進行修改 -
-N
這個參數指的是告訴ssh僅作端口轉發 -
-v
本參數可加可不加,加了提供了詳細的debug信息
注:參考資料地址忘記保存了
socks 轉 http 代理
macOS 安裝 privoxy
brew install privoxy
privoxy 默認監聽 8118 端口
netstat -an | grep 8118
修改配置文件,添加
forward-socks5 / 127.0.0.1:1080 .
參考資料
- http://www.cnblogs.com/another-wheel/archive/2011/11/16/setup-http-proxy-via-socks-and-privoxy.html
- http://blog.devtang.com/blog/2012/12/08/use-privoxy/
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"