(on Wikipedia)
https://www.irif.fr/~jch/software/polipo/
A small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server).
These are notes from when I tinkered with Ad-blocking with Polipo and adzapper.
--
- 2009-08-12 - 1.0.4 on Unity Linux 0.99-alpha2
- ~2009-08-11 - 1.0.4 on Unity Linux 0.99-alpha1, updated at various times.
- 2009-07-16 - 1.0.4 on Slackware 12.2
-
2009-05-08 - (1.0.4?) on PCLinuxOS 2007, updated 2009-04
Usage ∞
\sudo \killall polipo \sudo \polipo -c /mnt/320-data/polipo.config &
As a local web server ∞
- It can be used as an external web server too!
Uses the variable localDocumentRoot
, which defaults to /usr/share/polipo/www/
polipo.config ∞
I don't know that I made many changes, but here's my polipo.config for reference.
Polipo ramdisk ∞
- I abandoned this, because I couldn't get permissions to work for polipo.
-
Instead, I disable polipo's logging and disk cache.. done in my own polipo.config copied to /etc/polipo/config
-
for polipo
-
run as root
/etc/fstab
(fstab) would need:-
ramfs /tmp/ramdisk ramfs rw,size=100m 0 0
2009-08-12 - 1.0.4 ∞
Firefox's skipscreen extension has issues on rapidshare.com. I regularly get an error message. It'll happen on different files or the same files.. it's on-and-off.
504 Connect to <url>:80 failed: Connection reset by client The following error occurred while trying to access <url>: 504 Connect to url.rapidshare.com:80 failed: Connection reset by client Generated Wed, 12 Aug 2009 01:14:25 PDT by Polipo on polipo:8123. x SkipScreen will download your file as soon as it is available!
~2009-08-11 - 1.0.4 ∞
Tested earlier than 2009-08-12.
Works just fine.
2009-07-16 - 1.0.4 ∞
While it seems to run, I'm having issues getting Firefox to actually use it properly. It needs to be troubleshooted further.
2009-05-08 - (1.0.4?) ∞
Installation ∞
- Download
- Uncompress
make
-
./polipo
Configure your browser:
Firefox 3.0.8:
- Top menu: Edit > Preferences
- Advanced tab > Network sub-tab
- Settings button
-
Manual proxy configuration
- HTTP Proxy: localhost
- Port: 8123
- Change "No proxy for" from
localhost, 127.0.0.1
to be blank. I prefer this for a local server. You do as you wish.
- Save
-
Visit _about:config_
network.http.pipelining true network.http.proxy.pipelining true network.http.pipelining.maxrequests 15 network.http.max-persistent-connections-per-proxy 16 browser.cache.disk.enable false
Check these:
network.http.proxy.version 1.1 network.http.proxy.keep-alive true network.http.use-cache false
Update: I have some websites which do not work in polipo, and so I do keep cache enabled in Firefox for them.
Usage ∞
I start it with:
mkdir -p "/tmp/polipo/" # I'm noticing too many broken websites.. # pmmSize=8192 \ polipo daemonise=true \ censorReferer=maybe \ censoredHeaders="From, Accept-Language" \ pidFile="/tmp/polipo.pid" \ diskCacheRoot="/tmp/polipo/" \ chunkCriticalMark=0 \ chunkLowMark=0 \ disableConfiguration=true \ disableIndexing=false \ disableLocalInterface=true \ cacheIsShared=false # Purge the disk cache: kill -USR1 `cat "/tmp/polipo.pid"` sleep 1 polipo -x diskCacheRoot="/tmp/polipo/" kill -USR2 `cat "/tmp/polipo.pid"`
I added this in my /etc/rc.d/rc.local
(rc.local)
Information:
- http://localhost:8123/polipo/config? - You can also reconfigure it while it's running.
- http://localhost:8123/polipo/status?
- http://localhost:8123/polipo/servers?
- http://localhost:8123/polipo/index?http://www.example.com/
-
The pages starting with http://localhost:8123/polipo/recursive-index? contain recursive indices of various servers.
- This functionality is disabled by default, and can be enabled by setting the variable
disableIndexing
.
- This functionality is disabled by default, and can be enabled by setting the variable
Stop it with:
kill `cat "/tmp/polipo.pid"`
Reload the forbidden URLs file:
- write out all the in-memory data to disk (but won't discard them)
- reopen the log file
-
reload the forbidden URLs file
kill -s SIGUSR1 ``cat "/tmp/polipo.pid"``
Restart:
- write out all the in-memory data to disk
- discard as much of the memory cache as possible
- reopen the log file
-
reload the forbidden URLs file
kill -s SIGUSR2 ``cat "/tmp/polipo.pid"``
Purge the disk cache:
kill -USR1 ``cat "/tmp/polipo.pid"`` sleep 1 polipo -x diskCacheRoot="/tmp/polipo/" kill -USR2 ``cat "/tmp/polipo.pid"``
I added this in my /etc/rc.d/rc.local
(rc.local)
Logging specified by logFacility
, and the logging location is set with logFile
, defaulting to /var/log/polipo
todo ∞
forbiddenFile
(defaults to ~/.polipo-forbidden
or /etc/polipo/forbidden
, whichever exists) specifies the set of URLs that should never be fetched. If forbiddenFile
is a directory, it will be recursively searched for files with forbidden URLs.
Every line in a file listing forbidden URLs can either be:
- a domain name
- a string that doesn't contain any of
/
,*
or\
— -
or a POSIX extended regular expression.
Blank lines are ignored, as are those that start with a hash sign #
.
-
easylist won't work as a forbiddenFile.
- Convert the first character of
!
to#
- Anything without a
/
*
or\
should be ok as-is, but Convert everything else to a proper regular expression.
- Convert the first character of
- Get Firefox's type-and-search feature going again.. it won't work on single words. =/
-
Somewhere in the Polipo website there is a mention of a smarter cache cleaning tool. Get/use it. Otherwise rig a cron job to purge things.
notes ∞
A number of websites incorrectly mark variable resources as cachable; such issues can be worked around in polipo by manually marking given categories of objects as uncachable. If dontCacheCookies is true, all pages carrying HTTP cookies will be treated as uncachable. If dontCacheRedirects is true, all redirects (301 and 302) will be treated as uncachable. Finally, if everything else fails, a list of uncachable URLs can be given in the file specified by uncachableFile, which has the same format as the forbiddenFile (see Internal forbidden list). If not specified, its location defaults to ‘~/.polipo-uncachable’ or ‘/etc/polipo/uncachable’, whichever exists.
sites which won't work with it ∞
-
nonoba.com
- inconsistent issues with the style showing up and with the flash portion of a game page not appearing.
-
groups.google.com
- inconsistent issues with refreshing into a blank page, and with the style not showing up on cached versions.
-
www.linuxquestions.org
- inconsistent failure to load pages. I got an infinite redirect loop.
I found an old rc.local and added extra notes here.