作用
加速github推拉代碼的速度。
socks5轉換成http代理
使用Privoxy(http://www.privoxy.org/) 將socks5代理轉成http代理
使用Privoxy轉化SSH到HTTP代理
https://www.cnblogs.com/baizx/p/4249347.html
linux使用privoxy將55轉為http代理
https://www.cnblogs.com/straycats/p/8452354.html
git設置代理
HTTP與HTTPS代理
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
git config --global https.proxy https://proxyuser:proxypwd@proxy.server.com:8080
使用上面的命令配置完之后,會在 ~/.gitconfig 文件中多出幾行:
[http]
proxy = http://proxyuser:proxypwd@proxy.server.com:8080
[https]
proxy = https://proxyuser:proxypwd@proxy.server.com:8080
可以使用下面的命令檢查配置是否生效:
$ git config --global --get http.proxy
$ git config --global --get https.proxy
如果你想取消該設置
$ git config --global --unset http.proxy
$ git config --global --unset https.proxy
TortoiseGit
正確設置代理
右鍵 -> TortoiseGit -> Settings -> Network
Server address : http://127.0.0.1
Port : 1988
Linux在命令行中配置代理
要注意的是使用 git config –global 配置的代理只能供 git 程序使用,如果你希望讓命令行中的其他命令也能自動使用代理,譬如 curl 和 wget 等,可以使用下面的方法:
$ export http_proxy=http://proxyuser:proxypwd@proxy.server.com:8080
$ export https_proxy=https://proxyuser:proxypwd@proxy.server.com:8080
這樣配置完成后,所有命令行中的 HTTP 和 HTTPS 請求都會自動通過代理來訪問了。如果要取消代理設置,可以:
$ unset http_proxy
$ unset https_proxy
proxychains4
安裝
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
./configure
(sudo) make && make install
cp ./src/proxychains.conf /etc/proxychians.conf
cd .. && rm -rf proxychains-ng
或者
brew install proxychains-ng //mac
修改配置
vim /etc/proxychains.conf
推薦配置
strict_chain
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
localnet 127.0.0.0/255.0.0.0
quiet_mode
[ProxyList]
socks5 127.0.0.1 1080
使用例子
proxychains4 curl https://www.twitter.com/
proxychains4 git push origin master
wget https://www.dropbox.com -v -O /dev/null //直接輸入這條語句連接不了
proxychains4 wget https://www.dropbox.com -v -O /dev/null //加入proxychains4之后就可以順利執行