Chromium extension for bypassing censorship in Russia
Go to file
2015-12-21 01:57:22 +05:00
benchmark news pacs, news results 2015-12-07 08:56:12 +05:00
chart larger fonts for chart 2015-11-28 18:04:33 +05:00
extensions/chromium Now you can choose PAC from anticenz or antizapret 2015-12-21 01:28:41 +05:00
pac-generator news pacs, news results 2015-12-07 08:56:12 +05:00
.gitignore did the survey, modified extension 2015-11-28 01:47:27 +05:00
package.json refactored 2015-11-28 14:20:45 +05:00
README.md Update README.md 2015-12-21 01:57:22 +05:00

Anti-censorship Solution for Russia on PAC-scripts

This repo contains my efforts to fight censorhip in Russia.

Chrome Extension

WebStore | Sources

Why I do This

I believe information mustn't be blocked based on political or other subjective views.

My maxim is "Your freedom ends when it starts to confine the freedom of others".

See my arguments against censorship (ru)

Looking at how Russian government distorts TV and blocks critics of Putin, I decided to write an anti-censorship extension for Chromium before they strike me first.

PAC-Script Performance Analysis

if (Is_subdomain_of( host, blocked_hosts ))
  return 'use proxy';

You have to make Is_subdomain_of very fast.
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.
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.

I have tested different solutions, and depicted results in the following chart:

Host Lookup Chart: Time-Memory, Hits-Misses

  • IPs indexOf Blocked IP is searched by indexOf
  • IPs binary Blocked IP is searched 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.
  • Hosts switch Radix trie built on switch. Comparable to IPs switch.