This commit is contained in:
Ilya Ig. Petrov 2015-12-07 08:57:29 +05:00
commit 92dedaf7b5

View File

@ -1,4 +1,4 @@
# Anti-censorship Solution for Russia on PAC-Script # Anti-censorship Solution for Russia on PAC-script
## Censorship in Russia ## Censorship in Russia
@ -6,15 +6,16 @@ Censorship in Russia plagues the Freedoms of
[Information](https://en.wikipedia.org/wiki/Freedom_of_information) and [Speech](https://en.wikipedia.org/wiki/Freedom_of_speech), [Information](https://en.wikipedia.org/wiki/Freedom_of_information) and [Speech](https://en.wikipedia.org/wiki/Freedom_of_speech),
slowly building analogue of [China Golden Shield](https://en.wikipedia.org/wiki/Golden_Shield_Project). slowly building analogue of [China Golden Shield](https://en.wikipedia.org/wiki/Golden_Shield_Project).
For good or bad, it blocks For good or bad, it blocksm
[Main Kampf](https://en.wikipedia.org/wiki/Mein_Kampf), [Main Kampf](https://en.wikipedia.org/wiki/Mein_Kampf) and
[lolicon](https://en.wikipedia.org/wiki/Lolicon) (rearly distinguishing from hentai) and
[critics of Putin](http://www.reuters.com/article/2014/03/13/us-russia-internet-idUSBREA2C21L20140313). [critics of Putin](http://www.reuters.com/article/2014/03/13/us-russia-internet-idUSBREA2C21L20140313).
Looking at how Russian government [distorts TV](https://therussianreader.wordpress.com/2015/11/22/russian-truckers-strike-dagestan/) and blocks Internet, I decided to write an Anti-Censorship extension for Chomium. Looking at how Russian government [distorts TV](https://therussianreader.wordpress.com/2015/11/22/russian-truckers-strike-dagestan/) and blocks Internet, I decided to write an Anti-censorship extension for Chomium before they strike first.
I believe the freedom of information is a virtue and important __information mustn't be blocked based on political or other subjective views__. I believe the freedom of information is a virtue and important __information mustn't be blocked based on political or other subjective views__.
Your freedom ends when it starts to confine the freedom of others.
## Technical Titbits ## Technical Titbits
```javascript ```javascript
@ -27,7 +28,7 @@ This check is executed on each request. You should watch memeory consumption too
The naive solution is to keep array of blocked ips and check if the host resolves to one of the ips. The naive solution is to keep array of blocked ips and check if the host resolves to one of the ips.
You may do it with `indexOf`, binary search, etc. You may do it with `indexOf`, binary search, etc.
The shortcoming of every ip solution is that some providers resolve blocked hosts to wrong ips, so we eventually need list of hosts. The shortcoming of every ip solution is that __some providers resolve blocked hosts to wrong ips__, so we eventually need list of hosts.
I have tested different solutions, and depicted [results](./benchmark/Output.txt) in the following chart: I have tested different solutions, and depicted [results](./benchmark/Output.txt) in the following chart:
@ -37,3 +38,7 @@ I have tested different solutions, and depicted [results](./benchmark/Output.txt
* __IPs binary__ Blocked IP is search by binary search. For some reason miss time slightly increased. * __IPs binary__ Blocked IP is search by binary search. For some reason miss time slightly increased.
* __IPs switch__ Simply `switch(Blocked_IP) { case1: ... caseN: return true }`. Works even better than binary search. Magic. * __IPs switch__ Simply `switch(Blocked_IP) { case1: ... caseN: return true }`. Works even better than binary search. Magic.
* __Hosts switch__ Radix trie built on `switch`. Comparable to __IPs switch__. * __Hosts switch__ Radix trie built on `switch`. Comparable to __IPs switch__.
## Antizapret Proxy
I've decided to use [Antizapret](http://antizapret.prostovpn.org) proxy servers, which proxy ips from the [the register](https://github.com/zapret-info/z-i) only.