SquidGuard and Polipo
SquidGuard is a high-speed URL filtering programme. It accepts URLs on stdin, matches them against a blacklist (of URLs, domains or regular expressions) and produces re-written URLs on stdout. It is designed to be used with the open-source ‘squid’ HTTP proxy. It’s primary purpose is for restricting access to unsavoury websites.
Polipo is a a fairly lightweight HTTP Proxy server designed for personal use. It is particularly designed to reduce the ill-effects of high-latency internet connections on web-browsing – making use of modern HTTP filters such as HTTP persistent connections, pipelining and cache-control headers.
Getting these to work together…
Though Polipo has support for ‘squid-style redirectors’ it does not work with squidGuard redirector out-of-the-box.
Polipo expects to pass just the URL to the redirector on stdin (one on each line) and receive the new URL back from stdout (again one per line). However, squidGuard expects more fields in the input and outputs more fields on stdout. Unsurprisingly, this is the format used by squid: See: http://wiki.squid-cache.org/SquidFaq/SquidRedirectors
Patching squidGuard to support the simpler polipo format redirectors looked easier than patching polipo to support the squid format redirectors – so that is what I did.
Patches for SquidGuard v1.4
The above gzipped tar file contains patches for SquidGuard 1.4. The enclosed install.sh shell script will apply the patches. (It assumes that the squidGuard-1.4 distribution tar.gz has been unpacked in the same directory as the squidGuard-1.4-polipopatch.tar.gz was unpacked.