New Solutions for Cross the Great Firewall
Preparation
As known, the Great Firewall run as a filter which slows down the connection speed extremely between Mainland China and Overseas, in most protocols. Though we can run Shadowsocks as a daemon service to speed up the web access, there are still many applications could not connect through proxy, which caused bad network experience, especially Shell Access(SSH, Git, etc.,) in Terminal.
This is a tutorial here to guide you how to accelerate your Shell Access by connecting through a proxy. I hope this will help.
- A Fast Shadowsocks Server outside Mainland China
- A Shadowsocks Client
- polipo
Why polipo
Polipo is an efficient http proxy which can convert your HTTP connection to a Socks5 proxy in high performance. Though some other softwares, like Proxifier, MacProxy, can be also used for Proxy redirecting, while as I tested, they are all not fast or easy to use. As well, polipo is open-sourced, free software.
Installation
$ brew install polipo
It will automaticlly install polipo and all its dependencies.
How to use?
Run Shadowsocks Client first, config your server IP, ports, password and encryption, then turn it on.
Type
polipo socksParentProxy=localhost:1080
can start the polipo in a session, don’t close it before you finish working.Type
export http_proxy="http://127.0.0.1:8123"
andexport https_proxy="http://127.0.0.1:8123"
.
You are now running your shell across proxy !
Enhancement
Try to open something like the shell config file, like .bashrc
/ .zshrc
etc.,
Add lines below and restart your terminal.1
2
3
4
5
6
7
8
9
10
11
12
13proxyOn() {
polipo socksParentProxy=localhost:1080 daemonise=true logFile=~/Documents/polipo
export http_proxy="http://127.0.0.1:8123"
export https_proxy="http://127.0.0.1:8123"
echo "Proxy ON"
}
proxyOff() {
killall polipo
unset http_proxy
unset https_proxy
echo "Proxy OFF"
}
After doing this ,when you want to proxy your shell terminal, just type
proxyOn
, or type proxyOff
to shut it down.
It really works.