Transwiki:Bypassing the Great Firewall of China
From Wikibooks, the open-content textbooks collection
The Great Firewall of China, also known as the Golden Shield (Chinese: 金盾; pinyin: jīndùn), is installed on the international Internet gateway of mainland China and censors international communications over the Internet. People in mainland China cannot visit censored websites. This article describes some ways to work around the firewall, so that people can bypass this firewall and visit censored website inside mainland China.
[edit] Windows & Macintosh
Tor is available for Windows and Mac OS X.
However, it is a bit trickier now since Torproject website is now banned in China. Tor Service is not affected, but users need working proxy first to download Tor software package.
[edit] Linux
[edit] Debian GNU/Linux step by step
FIXME: Instructions below point Firefox directly at Tor; this leaks DNS. (Do we care in China scenario if we leak DNS? Yes, you do care, because if you resolve DNS locally, the local government-controlled DNS servers can lie to you.) On http://tor.eff.org they instruct to run Privoxy between Firefox and Tor, in which case we must install Privoxy, then point Firefox at the HTTP proxy of Privoxy, not the SOCKS proxy of Tor. But in my practical, for sites listed in the tuturial, privoxy is not required for performance reason, also, I have a patch for Tor to make it with a better performance (but lower privacy protection, performance is more important than privacy in this case)
- Run "apt-get install tor" as root to install Tor
- If you are using Firefox 1.5, open Preferences in Edit menu, click Connection Settings... button, select Manual proxy configuration, fill SOCKS Host as localhost at port 9050.
And it should work. But this is not perfect, since for uncensored sites, the speed would be really slow via Tor proxy, so we can use a PAC script, so only apply Tor proxy for censored sites.
To use PAC script, create a file called proxy.pac at your home directory, or somewhere else, then write the following in the file:
function FindProxyForURL(url, host)
{
if (dnsDomainIs(host, ".google.com"))
{
return "SOCKS localhost:9050";
}
if (isInNet(host, "66.102.15.101", "255.255.255.255"))
{
return "SOCKS localhost:9050";
}
if (dnsDomainIs(host, "zh.wikipedia.org"))
{
return "PROXY 145.97.39.134:80";
}
if (isInNet(host, "211.115.107.162", "255.255.255.255"))
{
return "PROXY 145.97.39.134:80";
}
return "DIRECT";
}
The first if tells the browser to apply Tor proxy for *.google.com, the second for banned *.blogspot.com, the third for zh.wikipedia.org, DNS servers in mainland China will return a fake IP address, so this is a work around, the fourth if is for general wikimedia sites, including en.wikipedia.org, note the IP 145.97.39.134 can be changed, if .134 doesn't work, try .132, .133, .135 or something like. For other censored sites, add similar if entries to the file.
After the creation of the file, open Preferences -> Connection Settings dialog in Firefox, and select Automatic proxy configuration URL, fill the location to the file, for example, if you put proxy.pac at /home/user/proxy.pac, fill "file://localhost/home/user/proxy.pac" here.