Ad Blocking Proxy = abloprox

Fri, 20. Jun 2014

Categories: en sysadmin Tags: Adblock Android PAC Proxy raspi Ruby

as an act of digital hygiene, I installed abloprox on a raspi and added this PACΒ file to save some keystrokes when configuring:

 1function FindProxyForURL(url, host) {
 2  if (shExpMatch(host,"*.fritz.box")) return "DIRECT";
 3  if (shExpMatch(host,"*.local")) return "DIRECT";
 4  if (shExpMatch(host,"*.akamaistream.net")) return "DIRECT";
 5  if (shExpMatch(host,"*.m945.mwn.de")) return "DIRECT";
 6  // auto config:
 7  // 1. ensure there's a host 'wpad' in the current network, see
 8  //   - https://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol#Context
 9  //   - http://fritz.box/net/network_user_devices.lua
10  // 2. have a http webserver running on that host
11  // 3. ensure http://wpad/wpad.dat or http://wpad.fritz.box/wpad.dat contains a PAC file like in http://blog.mro.name/2014/06/ad-blocking-proxy-abloprox/
12  // return "PROXY wpad:3126"; // Default return condition is the proxy on host 'wpad'.
13  return "PROXY <hostname_of_the_raspi>:3126"; // Default return condition is the proxy.
14}

Update: I pushed this one step further recently and use the automatic proxy-configuration itself to filterΒ β€” see http://purl.mro.name/wpad.

Update: hu – it took Android until version 5.0 (lollipop) to support PAC.