1 Privoxy 3.0.7 User Manual
3 [ Copyright 2001 - 2007 by Privoxy Developers ]
5 $Id: user-manual.sgml,v 2.49 2007/12/06 18:21:55 fabiankeil Exp $
7 The Privoxy User Manual gives users information on how to install, configure
10 Privoxy is a non-caching web proxy with advanced filtering capabilities for
11 enhancing privacy, modifying web page data, managing HTTP cookies, controlling
12 access, and removing ads, banners, pop-ups and other obnoxious Internet junk.
13 Privoxy has a flexible configuration and can be customized to suit individual
14 needs and tastes. Privoxy has application for both stand-alone systems and
17 Privoxy is based on Internet Junkbuster (tm).
19 You can find the latest version of the Privoxy User Manual at http://
20 www.privoxy.org/user-manual/. Please see the Contact section on how to contact
23 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
34 2.1.1. Red Hat and Fedora RPMs
35 2.1.2. Debian and Ubuntu
44 2.2. Building from Source
45 2.3. Keeping your Installation Up-to-Date
47 3. What's New in this Release
49 3.1. Note to Upgraders
51 4. Quickstart to Using Privoxy
53 4.1. Quickstart to Ad Blocking
57 5.1. Red Hat and Fedora
60 5.4. Solaris, NetBSD, FreeBSD, HP-UX and others
65 5.9. Command Line Options
67 6. Privoxy Configuration
69 6.1. Controlling Privoxy with Your Web Browser
70 6.2. Configuration Files Overview
72 7. The Main Configuration File
74 7.1. Local Set-up Documentation
81 7.2. Configuration and Log File Locations
95 7.3.2. single-threaded
97 7.4. Access Control and Security
101 7.4.3. enable-remote-toggle
102 7.4.4. enable-remote-http-toggle
103 7.4.5. enable-edit-actions
104 7.4.6. enforce-blocks
105 7.4.7. ACLs: permit-access and deny-access
111 7.5.2. forward-socks4 and forward-socks4a
112 7.5.3. Advanced Forwarding Examples
113 7.5.4. forwarded-connect-retries
114 7.5.5. accept-intercepted-requests
115 7.5.6. allow-cgi-request-crunching
116 7.5.7. split-large-forms
118 7.6. Windows GUI Options
122 8.1. Finding the Right Mix
124 8.3. How Actions are Applied to Requests
127 8.4.1. The Domain Pattern
128 8.4.2. The Path Pattern
129 8.4.3. The Tag Pattern
135 8.5.3. client-header-filter
136 8.5.4. client-header-tagger
137 8.5.5. content-type-overwrite
138 8.5.6. crunch-client-header
139 8.5.7. crunch-if-none-match
140 8.5.8. crunch-incoming-cookies
141 8.5.9. crunch-server-header
142 8.5.10. crunch-outgoing-cookies
143 8.5.11. deanimate-gifs
144 8.5.12. downgrade-http-version
145 8.5.13. fast-redirects
147 8.5.15. force-text-mode
148 8.5.16. forward-override
149 8.5.17. handle-as-empty-document
150 8.5.18. handle-as-image
151 8.5.19. hide-accept-language
152 8.5.20. hide-content-disposition
153 8.5.21. hide-if-modified-since
154 8.5.22. hide-forwarded-for-headers
155 8.5.23. hide-from-header
156 8.5.24. hide-referrer
157 8.5.25. hide-user-agent
158 8.5.26. inspect-jpegs
160 8.5.28. limit-connect
161 8.5.29. prevent-compression
162 8.5.30. overwrite-last-modified
164 8.5.32. send-vanilla-wafer
166 8.5.34. server-header-filter
167 8.5.35. server-header-tagger
168 8.5.36. session-cookies-only
169 8.5.37. set-image-blocker
170 8.5.38. treat-forbidden-connects-like-blocks
174 8.7. Actions Files Tutorial
176 8.7.1. default.action
181 9.1. Filter File Tutorial
182 9.2. The Pre-defined Filters
184 10. Privoxy's Template Files
185 11. Contacting the Developers, Bug Reporting and Feature Requests
188 11.2. Reporting Problems
190 11.2.1. Reporting Ads or Other Configuration Problems
191 11.2.2. Reporting Bugs
193 11.3. Request New Features
196 12. Privoxy Copyright, License and History
205 14.1. Regular Expressions
206 14.2. Privoxy's Internal Pages
210 14.3. Chain of Events
211 14.4. Troubleshooting: Anatomy of an Action
215 This documentation is included with the current beta version of Privoxy,
216 v.3.0.7, and is mostly complete at this point. The most up to date reference
217 for the time being is still the comments in the source files and in the
218 individual configuration files. Development of a new version is currently
219 nearing completion, and includes significant changes and enhancements over
222 Since this is a beta version, not all new features are well tested. This
223 documentation may be slightly out of sync as a result (especially with CVS
224 sources). And there may be bugs, though hopefully not many!
226 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
230 In addition to the core features of ad blocking and cookie management, Privoxy
231 provides many supplemental features, some of them currently under development,
232 that give the end-user more control, more privacy and more freedom:
234 • Integrated browser based configuration and control utility at http://
235 config.privoxy.org/ (shortcut: http://p.p/). Browser-based tracing of rule
236 and filter effects. Remote toggling.
238 • Web page filtering (text replacements, removes banners based on size,
239 invisible "web-bugs", JavaScript and HTML annoyances, pop-up windows,
240 header manipulation, etc.)
242 • Modularized configuration that allows for standard settings and user
243 settings to reside in separate files, so that installing updated actions
244 files won't overwrite individual user settings.
246 • Support for Perl Compatible Regular Expressions in the configuration files,
247 and generally a more sophisticated and flexible configuration syntax over
250 • Improved cookie management features (e.g. session based cookies).
254 • Bypass many click-tracking scripts (avoids script redirection).
256 • Multi-threaded (POSIX and native threads).
258 • User-customizable HTML templates for all proxy-generated pages (e.g.
261 • Auto-detection and re-reading of config file changes.
263 • Improved signal handling, and a true daemon mode (Unix).
265 • Every feature now controllable on a per-site or per-location basis,
266 configuration more powerful and versatile over-all.
268 • Many smaller new features added, limitations and bugs removed, and security
271 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
275 Privoxy is available both in convenient pre-compiled packages for a wide range
276 of operating systems, and as raw source code. For most users, we recommend
277 using the packages, which can be downloaded from our Privoxy Project Page.
279 Note: On some platforms, the installer may remove previously installed
280 versions, if found. (See below for your platform). In any case be sure to
281 backup your old configuration if it is valuable to you. See the note to
282 upgraders section below.
284 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
288 How to install the binary packages depends on your operating system:
290 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
292 2.1.1. Red Hat and Fedora RPMs
294 RPMs can be installed with rpm -Uvh privoxy-3.0.7-1.rpm, and will use /etc/
295 privoxy for the location of configuration files.
297 Note that on Red Hat, Privoxy will not be automatically started on system boot.
298 You will need to enable that using chkconfig, ntsysv, or similar methods.
300 If you have problems with failed dependencies, try rebuilding the SRC RPM: rpm
301 --rebuild privoxy-3.0.7-1.src.rpm. This will use your locally installed
302 libraries and RPM version.
304 Also note that if you have a Junkbuster RPM installed on your system, you need
305 to remove it first, because the packages conflict. Otherwise, RPM will try to
306 remove Junkbuster automatically if found, before installing Privoxy.
308 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
310 2.1.2. Debian and Ubuntu
312 DEBs can be installed with apt-get install privoxy, and will use /etc/privoxy
313 for the location of configuration files.
315 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
319 Just double-click the installer, which will guide you through the installation
320 process. You will find the configuration files in the same directory as you
321 installed Privoxy in.
323 Version 3.0.5 beta introduced full Windows service functionality. On Windows
324 only, the Privoxy program has two new command line arguments to install and
325 uninstall Privoxy as a service.
329 --install[:service_name]
331 --uninstall[:service_name]
333 After invoking Privoxy with --install, you will need to bring up the Windows
334 service console to assign the user you want Privoxy to run under, and whether
335 or not you want it to run whenever the system starts. You can start the Windows
336 services console with the following command: services.msc. If you do not take
337 the manual step of modifying Privoxy's service settings, it will not start.
338 Note too that you will need to give Privoxy a user account that actually
339 exists, or it will not be permitted to write to its log and configuration
342 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
346 Create a new directory, cd to it, then unzip and untar the archive. For the
347 most part, you'll have to figure out where things go.
349 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
353 First, make sure that no previous installations of Junkbuster and / or Privoxy
354 are left on your system. Check that no Junkbuster or Privoxy objects are in
357 Then, just double-click the WarpIN self-installing archive, which will guide
358 you through the installation process. A shadow of the Privoxy executable will
359 be placed in your startup folder so it will start automatically whenever OS/2
362 The directory you choose to install Privoxy into will contain all of the
365 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
369 Unzip the downloaded file (you can either double-click on the file from the
370 finder, or from the desktop if you downloaded it there). Then, double-click on
371 the package installer icon named Privoxy.pkg and follow the installation
372 process. Privoxy will be installed in the folder /Library/Privoxy. It will
373 start automatically whenever you start up. To prevent it from starting
374 automatically, remove or rename the folder /Library/StartupItems/Privoxy.
376 To start Privoxy by hand, double-click on StartPrivoxy.command in the /Library/
377 Privoxy folder. Or, type this command in the Terminal:
379 /Library/Privoxy/StartPrivoxy.command
383 You will be prompted for the administrator password.
385 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
389 Copy and then unpack the lha archive to a suitable location. All necessary
390 files will be installed into Privoxy directory, including all configuration and
391 log files. To uninstall, just remove this directory.
393 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
397 Privoxy is part of FreeBSD's Ports Collection, you can build and install it
398 with cd /usr/ports/www/privoxy; make install clean.
400 If you don't use the ports, you can fetch and install the package with pkg_add
403 The port skeleton and the package can also be downloaded from the File Release
404 Page, but there's no reason to use them unless you're interested in the beta
405 releases which are only available there.
407 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
411 Gentoo source packages (Ebuilds) for Privoxy are contained in the Gentoo
412 Portage Tree (they are not on the download page, but there is a Gentoo section,
413 where you can see when a new Privoxy Version is added to the Portage Tree).
415 Before installing Privoxy under Gentoo just do first emerge rsync to get the
416 latest changes from the Portage tree. With emerge privoxy you install the
419 Configuration files are in /etc/privoxy, the documentation is in /usr/share/doc
420 /privoxy-3.0.7 and the Log directory is in /var/log/privoxy.
422 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
424 2.2. Building from Source
426 The most convenient way to obtain the Privoxy sources is to download the source
427 tarball from our project download page.
429 If you like to live on the bleeding edge and are not afraid of using possibly
430 unstable development versions, you can check out the up-to-the-minute version
431 directly from the CVS repository.
433 To build Privoxy from source, autoconf, GNU make (gmake), and, of course, a C
434 compiler like gcc are required.
436 When building from a source tarball, first unpack the source:
438 tar xzvf privoxy-3.0.7-beta-src* [.tgz or .tar.gz]
439 cd privoxy-3.0.7-beta
442 For retrieving the current CVS sources, you'll need a CVS client installed.
443 Note that sources from CVS are typically development quality, and may not be
444 stable, or well tested. To download CVS source, check the Sourceforge
445 documentation, which might give commands like:
447 cvs -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa login
448 cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co current
452 This will create a directory named current/, which will contain the source
455 You can also check out any Privoxy "branch", just exchange the current name
456 with the wanted branch name (Example: v_3_0_branch for the 3.0 cvs tree).
458 It is also strongly recommended to not run Privoxy as root. You should
459 configure/install/run Privoxy as an unprivileged user, preferably by creating a
460 "privoxy" user and group just for this purpose. See your local documentation
461 for the correct command line to do add new users and groups (something like
462 adduser, but the command syntax may vary from platform to platform).
464 /etc/passwd might then look like:
466 privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell
469 And then /etc/group, like:
474 Some binary packages may do this for you.
476 Then, to build from either unpacked tarball or CVS source:
480 ./configure # (--help to see options)
481 make # (the make from GNU, sometimes called gmake)
482 su # Possibly required
483 make -n install # (to see where all the files will go)
484 make -s install # (to really install, -s to silence output)
487 Using GNU make, you can have the first four steps automatically done for you by
493 in the freshly downloaded or unpacked source directory.
495 To build an executable with security enhanced features so that users cannot
496 easily bypass the proxy (e.g. "Go There Anyway"), or alter their own
497 configurations, configure like this:
499 ./configure --disable-toggle --disable-editor --disable-force
502 Then build as above. In Privoxy 3.0.7 and later, all of these options can also
503 be disabled through the configuration file.
505 WARNING: If installing as root, the install will fail unless a non-root user or
506 group is specified, or a privoxy user and group already exist on the system. If
507 a non-root user is specified, and no group, then the installation will try to
508 also use a group of the same name as "user". If a group is specified (and no
509 user), then the support files will be installed as writable by that group, and
510 owned by the user running the installation.
512 configure accepts --with-user and --with-group options for setting user and
513 group ownership of the configuration files (which need to be writable by the
514 daemon). The specified user must already exist. When starting Privoxy, it must
515 be run as this same user to insure write access to configuration and log files!
517 Alternately, you can specify user and group on the make command line, but be
518 sure both already exist:
520 make -s install USER=privoxy GROUP=privoxy
523 The default installation path for make install is /usr/local. This may of
524 course be customized with the various ./configure path options. If you are
525 doing an install to anywhere besides /usr/local, be sure to set the appropriate
526 paths with the correct configure options (./configure --help). Non-privileged
527 users must of course have write access permissions to wherever the target
528 installation is going.
530 If you do install to /usr/local, the install will use sysconfdir=$prefix/etc/
531 privoxy by default. All other destinations, and the direct usage of
532 --sysconfdir flag behave like normal, i.e. will not add the extra privoxy
533 directory. This is for a safer install, as there may already exist another
534 program that uses a file with the "config" name, and thus makes /usr/local/etc
537 If installing to /usr/local, the documentation will go by default to $prefix/
538 share/doc. But if this directory doesn't exist, it will then try $prefix/doc
539 and install there before creating a new $prefix/share/doc just for Privoxy.
541 Again, if the installs goes to /usr/local, the localstatedir (ie: var/) will
542 default to /var instead of $prefix/var so the logs will go to /var/log/privoxy
543 /, and the pid file will be created in /var/run/privoxy.pid.
545 make install will attempt to set the correct values in config (main
546 configuration file). You should check this to make sure all values are correct.
547 If appropriate, an init script will be installed, but it is up to the user to
548 determine how and where to start Privoxy. The init script should be checked for
549 correct paths and values, if anything other than a default install is done.
551 If install finds previous versions of local configuration files, most of these
552 will not be overwritten, and the new ones will be installed with a "new"
553 extension. default.action, default.filter, and standard.action will be
554 overwritten. You will then need to manually update the other installed
555 configuration files as needed. The default template files will be overwritten.
556 If you have customized, local templates, these should be stored safely in a
557 separate directory and defined in config by the "templdir" directive. It is of
558 course wise to always back-up any important configuration files "just in case".
559 If a previous version of Privoxy is already running, you will have to restart
562 For more detailed instructions on how to build Redhat RPMs, Windows
563 self-extracting installers, building on platforms with special requirements
564 etc, please consult the developer manual.
566 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
568 2.3. Keeping your Installation Up-to-Date
570 As user feedback comes in and development continues, we will make updated
571 versions of both the main actions file (as a separate package) and the software
572 itself (including the actions file) available for download.
574 If you wish to receive an email notification whenever we release updates of
575 Privoxy or the actions file, subscribe to our announce mailing list,
576 ijbswa-announce@lists.sourceforge.net.
578 In order not to lose your personal changes and adjustments when updating to the
579 latest default.action file we strongly recommend that you use user.action and
580 user.filter for your local customizations of Privoxy. See the Chapter on
581 actions files for details.
583 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
585 3. What's New in this Release
587 There are many improvements and new features since Privoxy 3.0.6, the last
590 • Two new actions server-header-tagger and client-header-tagger that can be
591 used to create arbitrary "tags" based on client and server headers. These
592 "tags" can then subsequently be used to control the other actions used for
593 the current request, greatly increasing Privoxy's flexibility and
594 selectivity. See tag patterns for more information on tags.
596 • Header filtering is done with dedicated header filters now. As a result the
597 actions "filter-client-headers" and "filter-server-headers" that were
598 introduced with Privoxy 3.0.5 to apply content filters to the headers have
599 been removed. See the new actions server-header-filter and
600 client-header-filter for details.
602 • There are four new options for the main config file:
604 □ allow-cgi-request-crunching which allows requests for Privoxy's
605 internal CGI pages to be blocked, redirected or (un)trusted like
608 □ split-large-forms that will work around a browser bug that caused IE6
609 and IE7 to ignore the Submit button on the Privoxy's
610 edit-actions-for-url CGI page.
612 □ accept-intercepted-requests which allows to combine Privoxy with any
613 packet filter to create an intercepting proxy for HTTP/1.1 requests
614 (and for HTTP/1.0 requests with Host header set). This means clients
615 can be forced to use Privoxy even if their proxy settings are
616 configured differently.
618 □ templdir to designate an alternate location for Privoxy's locally
619 customized CGI templates so that these are not overwritten during
622 • A new command line option --pre-chroot-nslookup hostname to initialize the
623 resolver library before chroot'ing. On some systems this reduces the number
624 of files that must be copied into the chroot tree. (Patch provided by
627 • The forward-override action allows changing of the forwarding settings
628 through the actions files. Combined with tags, this allows to choose the
629 forwarder based on client headers like the User-Agent, or the request
632 • The redirect action can now use regular expression substitutions against
635 • zlib support is now available as a compile time option to filter compressed
636 content. Patch provided by Wil Mahan.
638 • Improve various filters, and add new ones.
640 • Include support for RFC 3253 so that Subversion works with Privoxy. Patch
641 provided by Petr Kadlec.
643 • Logging can be completely turned off by not specifying a logfile directive.
645 • A number of improvements to Privoxy's internal CGI pages, including the use
646 of favicons for error and control pages.
648 • Many bugfixes, memory leaks addressed, code improvements, and logging
651 For a more detailed list of changes please have a look at the ChangeLog.
653 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
655 3.1. Note to Upgraders
657 A quick list of things to be aware of before upgrading from earlier versions of
660 • The recommended way to upgrade Privoxy is to backup your old configuration
661 files, install the new ones, verify that Privoxy is working correctly and
662 finally merge back your changes using diff and maybe patch.
664 There are a number of new features in each Privoxy release and most of them
665 have to be explicitly enabled in the configuration files. Old configuration
666 files obviously don't do that and due to syntax changes using old
667 configuration files with a new Privoxy isn't always possible anyway.
669 • Note that some installers remove earlier versions completely, including
670 configuration files, therefore you should really save any important
673 • On the other hand, other installers don't overwrite existing configuration
674 files, thinking you will want to do that yourself.
676 • standard.action now only includes the enabled actions. Not all actions as
679 • Logging is off by default now. If you need logging, it can be turned on in
680 the config file. You may also want to enable logging until you verified
681 that the new Privoxy version is working as expected.
683 • Three other config file settings are now off by default:
684 enable-remote-toggle, enable-remote-http-toggle, and enable-edit-actions.
685 If you use or want these, you will need to explicitly enable them, and be
686 aware of the security issues involved.
688 • The "filter-client-headers" and "filter-server-headers" actions that were
689 introduced with Privoxy 3.0.5 to apply content filters to the headers have
690 been removed and replaced with new actions. See the What's New section
693 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
695 4. Quickstart to Using Privoxy
697 • Install Privoxy. See the Installation Section below for platform specific
700 • Advanced users and those who want to offer Privoxy service to more than
701 just their local machine should check the main config file, especially the
702 security-relevant options. These are off by default.
704 • Start Privoxy, if the installation program has not done this already (may
705 vary according to platform). See the section Starting Privoxy.
707 • Set your browser to use Privoxy as HTTP and HTTPS (SSL) proxy by setting
708 the proxy configuration for address of 127.0.0.1 and port 8118. DO NOT
709 activate proxying for FTP or any protocols besides HTTP and HTTPS (SSL)
710 unless you intend to prevent your browser from using these protocols.
712 • Flush your browser's disk and memory caches, to remove any cached ad
713 images. If using Privoxy to manage cookies, you should remove any currently
716 • A default installation should provide a reasonable starting point for most.
717 There will undoubtedly be occasions where you will want to adjust the
718 configuration, but that can be dealt with as the need arises. Little to no
719 initial configuration is required in most cases, you may want to enable the
720 web-based action editor though. Be sure to read the warnings first.
722 See the Configuration section for more configuration options, and how to
723 customize your installation. You might also want to look at the next
724 section for a quick introduction to how Privoxy blocks ads and banners.
726 • If you experience ads that slip through, innocent images that are blocked,
727 or otherwise feel the need to fine-tune Privoxy's behavior, take a look at
728 the actions files. As a quick start, you might find the richly commented
729 examples helpful. You can also view and edit the actions files through the
730 web-based user interface. The Appendix "Troubleshooting: Anatomy of an
731 Action" has hints on how to understand and debug actions that "misbehave".
733 • Please see the section Contacting the Developers on how to report bugs,
734 problems with websites or to get help.
736 • Now enjoy surfing with enhanced control, comfort and privacy!
738 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
740 4.1. Quickstart to Ad Blocking
742 Ad blocking is but one of Privoxy's array of features. Many of these features
743 are for the technically minded advanced user. But, ad and banner blocking is
744 surely common ground for everybody.
746 This section will provide a quick summary of ad blocking so you can get up to
747 speed quickly without having to read the more extensive information provided
748 below, though this is highly recommended.
750 First a bit of a warning ... blocking ads is much like blocking SPAM: the more
751 aggressive you are about it, the more likely you are to block things that were
752 not intended. And the more likely that some things may not work as intended. So
753 there is a trade off here. If you want extreme ad free browsing, be prepared to
754 deal with more "problem" sites, and to spend more time adjusting the
755 configuration to solve these unintended consequences. In short, there is not an
756 easy way to eliminate all ads. Either take the easy way and settle for most ads
757 blocked with the default configuration, or jump in and tweak it for your
758 personal surfing habits and preferences.
760 Secondly, a brief explanation of Privoxy's "actions". "Actions" in this
761 context, are the directives we use to tell Privoxy to perform some task
762 relating to HTTP transactions (i.e. web browsing). We tell Privoxy to take some
763 "action". Each action has a unique name and function. While there are many
764 potential actions in Privoxy's arsenal, only a few are used for ad blocking.
765 Actions, and action configuration files, are explained in depth below.
767 Actions are specified in Privoxy's configuration, followed by one or more URLs
768 to which the action should apply. URLs can actually be URL type patterns that
769 use wildcards so they can apply potentially to a range of similar URLs. The
770 actions, together with the URL patterns are called a section.
772 When you connect to a website, the full URL will either match one or more of
773 the sections as defined in Privoxy's configuration, or not. If so, then Privoxy
774 will perform the respective actions. If not, then nothing special happens.
775 Furthermore, web pages may contain embedded, secondary URLs that your web
776 browser will use to load additional components of the page, as it parses the
777 original page's HTML content. An ad image for instance, is just an URL embedded
778 in the page somewhere. The image itself may be on the same server, or a server
779 somewhere else on the Internet. Complex web pages will have many such embedded
780 URLs. Privoxy can deal with each URL individually, so, for instance, the main
781 page text is not touched, but images from such-and-such server are blocked.
783 The most important actions for basic ad blocking are: block, handle-as-image,
784 handle-as-empty-document,and set-image-blocker:
786 • block - this is perhaps the single most used action, and is particularly
787 important for ad blocking. This action stops any contact between your
788 browser and any URL patterns that match this action's configuration. It can
789 be used for blocking ads, but also anything that is determined to be
790 unwanted. By itself, it simply stops any communication with the remote
791 server and sends Privoxy's own built-in BLOCKED page instead to let you now
792 what has happened (with some exceptions, see below).
794 • handle-as-image - tells Privoxy to treat this URL as an image. Privoxy's
795 default configuration already does this for all common image types (e.g.
796 GIF), but there are many situations where this is not so easy to determine.
797 So we'll force it in these cases. This is particularly important for ad
798 blocking, since only if we know that it's an image of some kind, can we
799 replace it with an image of our choosing, instead of the Privoxy BLOCKED
800 page (which would only result in a "broken image" icon). There are some
801 limitations to this though. For instance, you can't just brute-force an
802 image substitution for an entire HTML page in most situations.
804 • handle-as-empty-document - sends an empty document instead of Privoxy's
805 normal BLOCKED HTML page. This is useful for file types that are neither
806 HTML nor images, such as blocking JavaScript files.
808 • set-image-blocker - tells Privoxy what to display in place of an ad image
809 that has hit a block rule. For this to come into play, the URL must match a
810 block action somewhere in the configuration, and, it must also match an
811 handle-as-image action.
813 The configuration options on what to display instead of the ad are:
815 pattern - a checkerboard pattern, so that an ad replacement is obvious.
818 blank - A very small empty GIF image is displayed. This is the so-called
819 "invisible" configuration option.
821 http://<URL> - A redirect to any image anywhere of the user's choosing
824 Advanced users will eventually want to explore Privoxy filters as well. Filters
825 are very different from blocks. A "block" blocks a site, page, or unwanted
826 contented. Filters are a way of filtering or modifying what is actually on the
827 page. An example filter usage: a text replacement of "no-no" for "nasty-word".
828 That is a very simple example. This process can be used for ad blocking, but it
829 is more in the realm of advanced usage and has some pitfalls to be wary off.
831 The quickest way to adjust any of these settings is with your browser through
832 the special Privoxy editor at http://config.privoxy.org/show-status (shortcut:
833 http://p.p/show-status). This is an internal page, and does not require
836 Note that as of Privoxy 3.0.7 beta the action editor is disabled by default.
837 Check the enable-edit-actions section in the configuration file to learn why
838 and in which cases it's safe to enable again.
840 If you decided to enable the action editor, select the appropriate "actions"
841 file, and click "Edit". It is best to put personal or local preferences in
842 user.action since this is not meant to be overwritten during upgrades, and will
843 over-ride the settings in other files. Here you can insert new "actions", and
844 URLs for ad blocking or other purposes, and make other adjustments to the
845 configuration. Privoxy will detect these changes automatically.
847 A quick and simple step by step example:
849 • Right click on the ad image to be blocked, then select "Copy Link Location"
850 from the pop-up menu.
852 • Set your browser to http://config.privoxy.org/show-status
854 • Find user.action in the top section, and click on "Edit":
856 Figure 1. Actions Files in Use
860 • You should have a section with only block listed under "Actions:". If not,
861 click a "Insert new section below" button, and in the new section that just
862 appeared, click the Edit button right under the word "Actions:". This will
863 bring up a list of all actions. Find block near the top, and click in the
864 "Enabled" column, then "Submit" just below the list.
866 • Now, in the block actions section, click the "Add" button, and paste the
867 URL the browser got from "Copy Link Location". Remove the http:// at the
868 beginning of the URL. Then, click "Submit" (or "OK" if in a pop-up window).
870 • Now go back to the original page, and press SHIFT-Reload (or flush all
871 browser caches). The image should be gone now.
873 This is a very crude and simple example. There might be good reasons to use a
874 wildcard pattern match to include potentially similar images from the same
875 site. For a more extensive explanation of "patterns", and the entire actions
876 concept, see the Actions section.
878 For advanced users who want to hand edit their config files, you might want to
879 now go to the Actions Files Tutorial. The ideas explained therein also apply to
880 the web-based editor.
882 There are also various filters that can be used for ad blocking (filters are a
883 special subset of actions). These fall into the "advanced" usage category, and
884 are explained in depth in later sections.
886 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
890 Before launching Privoxy for the first time, you will want to configure your
891 browser(s) to use Privoxy as a HTTP and HTTPS (SSL) proxy. The default is
892 127.0.0.1 (or localhost) for the proxy address, and port 8118 (earlier versions
893 used port 8000). This is the one configuration step that must be done!
895 Please note that Privoxy can only proxy HTTP and HTTPS traffic. It will not
896 work with FTP or other protocols.
898 Figure 2. Proxy Configuration Showing Mozilla/Netscape HTTP and HTTPS (SSL)
903 With Firefox, this is typically set under:
905 Tools -> Options -> General -> Connection Settings -> Manual Proxy
909 Or optionally on some platforms:
911 Edit -> Preferences -> General -> Connection Settings -> Manual Proxy
915 With Netscape (and Mozilla), this can be set under:
917 Edit -> Preferences -> Advanced -> Proxies -> HTTP Proxy
920 For Internet Explorer v.5-6:
922 Tools -> Internet Options -> Connections -> LAN Settings
924 Then, check "Use Proxy" and fill in the appropriate info (Address: 127.0.0.1,
925 Port: 8118). Include HTTPS (SSL), if you want HTTPS proxy support too
926 (sometimes labeled "Secure"). Make sure any checkboxes like "Use the same proxy
927 server for all protocols" is UNCHECKED. You want only HTTP and HTTPS (SSL)!
929 Figure 3. Proxy Configuration Showing Internet Explorer HTTP and HTTPS (Secure)
934 After doing this, flush your browser's disk and memory caches to force a
935 re-reading of all pages and to get rid of any ads that may be cached. Remove
936 any cookies, if you want Privoxy to manage that. You are now ready to start
937 enjoying the benefits of using Privoxy!
939 Privoxy itself is typically started by specifying the main configuration file
940 to be used on the command line. If no configuration file is specified on the
941 command line, Privoxy will look for a file named config in the current
942 directory. Except on Win32 where it will try config.txt.
944 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
946 5.1. Red Hat and Fedora
948 A default Red Hat installation may not start Privoxy upon boot. It will use the
949 file /etc/privoxy/config as its main configuration file.
951 # /etc/rc.d/init.d/privoxy start
956 # service privoxy start
959 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
963 We use a script. Note that Debian typically starts Privoxy upon booting per
964 default. It will use the file /etc/privoxy/config as its main configuration
967 # /etc/init.d/privoxy start
970 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
974 Click on the Privoxy Icon to start Privoxy. If no configuration file is
975 specified on the command line, Privoxy will look for a file named config.txt.
976 Note that Windows will automatically start Privoxy when the system starts if
977 you chose that option when installing.
979 Privoxy can run with full Windows service functionality. On Windows only, the
980 Privoxy program has two new command line arguments to install and uninstall
981 Privoxy as a service. See the Windows Installation instructions for details.
983 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
985 5.4. Solaris, NetBSD, FreeBSD, HP-UX and others
987 Example Unix startup command:
989 # /usr/sbin/privoxy /etc/privoxy/config
992 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
996 During installation, Privoxy is configured to start automatically when the
997 system restarts. You can start it manually by double-clicking on the Privoxy
998 icon in the Privoxy folder.
1000 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1004 During installation, Privoxy is configured to start automatically when the
1005 system restarts. To start Privoxy manually, double-click on the
1006 StartPrivoxy.command icon in the /Library/Privoxy folder. Or, type this command
1009 /Library/Privoxy/StartPrivoxy.command
1013 You will be prompted for the administrator password.
1015 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1019 Start Privoxy (with RUN <>NIL:) in your startnet script (AmiTCP), in
1020 s:user-startup (RoadShow), as startup program in your startup script (Genesis),
1021 or as startup action (Miami and MiamiDx). Privoxy will automatically quit when
1022 you quit your TCP/IP stack (just ignore the harmless warning your TCP/IP stack
1023 may display that Privoxy is still running).
1025 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1029 A script is again used. It will use the file /etc/privoxy/config as its main
1032 /etc/init.d/privoxy start
1036 Note that Privoxy is not automatically started at boot time by default. You can
1037 change this with the rc-update command.
1039 rc-update add privoxy default
1043 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1045 5.9. Command Line Options
1047 Privoxy may be invoked with the following command-line options:
1051 Print version info and exit. Unix only.
1055 Print short usage info and exit. Unix only.
1059 Don't become a daemon, i.e. don't fork and become process group leader, and
1060 don't detach from controlling tty. Unix only.
1064 On startup, write the process ID to FILE. Delete the FILE on exit. Failure
1065 to create or delete the FILE is non-fatal. If no FILE option is given, no
1066 PID file will be used. Unix only.
1068 • --user USER[.GROUP]
1070 After (optionally) writing the PID file, assume the user ID of USER, and if
1071 included the GID of GROUP. Exit if the privileges are not sufficient to do
1076 Before changing to the user ID given in the --user option, chroot to that
1077 user's home directory, i.e. make the kernel pretend to the Privoxy process
1078 that the directory tree starts there. If set up carefully, this can limit
1079 the impact of possible vulnerabilities in Privoxy to the files contained in
1080 that hierarchy. Unix only.
1082 • --pre-chroot-nslookup hostname
1084 Specifies a hostname to look up before doing a chroot. On some systems,
1085 initializing the resolver library involves reading config files from /etc
1086 and/or loading additional shared libraries from /lib. On these systems,
1087 doing a hostname lookup before the chroot reduces the number of files that
1088 must be copied into the chroot tree.
1090 For fastest startup speed, a good value is a hostname that is not in /etc/
1091 hosts but that your local name server (listed in /etc/resolv.conf) can
1092 resolve without recursion (that is, without having to ask any other name
1093 servers). The hostname need not exist, but if it doesn't, an error message
1094 (which can be ignored) will be output.
1098 If no configfile is included on the command line, Privoxy will look for a
1099 file named "config" in the current directory (except on Win32 where it will
1100 look for "config.txt" instead). Specify full path to avoid confusion. If no
1101 config file is found, Privoxy will fail to start.
1103 On MS Windows only there are two additional command-line options to allow
1104 Privoxy to install and run as a service. See the Window Installation section
1107 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1109 6. Privoxy Configuration
1111 All Privoxy configuration is stored in text files. These files can be edited
1112 with a text editor. Many important aspects of Privoxy can also be controlled
1113 easily with a web browser.
1115 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1117 6.1. Controlling Privoxy with Your Web Browser
1119 Privoxy's user interface can be reached through the special URL http://
1120 config.privoxy.org/ (shortcut: http://p.p/), which is a built-in page and works
1121 without Internet access. You will see the following section:
1124 ▪ View & change the current configuration
1125 ▪ View the source code version numbers
1126 ▪ View the request headers.
1127 ▪ Look up which actions apply to a URL and why
1128 ▪ Toggle Privoxy on or off
1132 This should be self-explanatory. Note the first item leads to an editor for the
1133 actions files, which is where the ad, banner, cookie, and URL blocking magic is
1134 configured as well as other advanced features of Privoxy. This is an easy way
1135 to adjust various aspects of Privoxy configuration. The actions file, and other
1136 configuration files, are explained in detail below.
1138 "Toggle Privoxy On or Off" is handy for sites that might have problems with
1139 your current actions and filters. You can in fact use it as a test to see
1140 whether it is Privoxy causing the problem or not. Privoxy continues to run as a
1141 proxy in this case, but all manipulation is disabled, i.e. Privoxy acts like a
1142 normal forwarding proxy. There is even a toggle Bookmarklet offered, so that
1143 you can toggle Privoxy with one click from your browser.
1145 Note that several of the features described above are disabled by default in
1146 Privoxy 3.0.7 beta and later. Check the configuration file to learn why and in
1147 which cases it's safe to enable them again.
1149 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1151 6.2. Configuration Files Overview
1153 For Unix, *BSD and Linux, all configuration files are located in /etc/privoxy/
1154 by default. For MS Windows, OS/2, and AmigaOS these are all in the same
1155 directory as the Privoxy executable. The name and number of configuration files
1156 has changed from previous versions, and is subject to change as development
1159 The installed defaults provide a reasonable starting point, though some
1160 settings may be aggressive by some standards. For the time being, the principle
1161 configuration files are:
1163 • The main configuration file is named config on Linux, Unix, BSD, OS/2, and
1164 AmigaOS and config.txt on Windows. This is a required file.
1166 • default.action (the main actions file) is used to define which "actions"
1167 relating to banner-blocking, images, pop-ups, content modification, cookie
1168 handling etc should be applied by default. It also defines many exceptions
1169 (both positive and negative) from this default set of actions that enable
1170 Privoxy to selectively eliminate the junk, and only the junk, on as many
1171 websites as possible.
1173 Multiple actions files may be defined in config. These are processed in the
1174 order they are defined. Local customizations and locally preferred
1175 exceptions to the default policies as defined in default.action (which you
1176 will most probably want to define sooner or later) are probably best
1177 applied in user.action, where you can preserve them across upgrades.
1178 standard.action is only for Privoxy's internal use.
1180 There is also a web based editor that can be accessed from http://
1181 config.privoxy.org/show-status (Shortcut: http://p.p/show-status) for the
1182 various actions files.
1184 • "Filter files" (the filter file) can be used to re-write the raw page
1185 content, including viewable text as well as embedded HTML and JavaScript,
1186 and whatever else lurks on any given web page. The filtering jobs are only
1187 pre-defined here; whether to apply them or not is up to the actions files.
1188 default.filter includes various filters made available for use by the
1189 developers. Some are much more intrusive than others, and all should be
1190 used with caution. You may define additional filter files in config as you
1191 can with actions files. We suggest user.filter for any locally defined
1192 filters or customizations.
1194 The syntax of the configuration and filter files may change between different
1195 Privoxy versions, unfortunately some enhancements cost backwards compatibility.
1197 All files use the "#" character to denote a comment (the rest of the line will
1198 be ignored) and understand line continuation through placing a backslash ("\")
1199 as the very last character in a line. If the # is preceded by a backslash, it
1200 looses its special function. Placing a # in front of an otherwise valid
1201 configuration line to prevent it from being interpreted is called "commenting
1202 out" that line. Blank lines are ignored.
1204 The actions files and filter files can use Perl style regular expressions for
1205 maximum flexibility.
1207 After making any changes, there is no need to restart Privoxy in order for the
1208 changes to take effect. Privoxy detects such changes automatically. Note,
1209 however, that it may take one or two additional requests for the change to take
1210 effect. When changing the listening address of Privoxy, these "wake up"
1211 requests must obviously be sent to the old listening address.
1213 While under development, the configuration content is subject to change. The
1214 below documentation may not be accurate by the time you read this. Also, what
1215 constitutes a "default" setting, may change, so please check all your
1216 configuration files on important issues.
1218 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1220 7. The Main Configuration File
1222 Again, the main configuration file is named config on Linux/Unix/BSD and OS/2,
1223 and config.txt on Windows. Configuration lines consist of an initial keyword
1224 followed by a list of values, all separated by whitespace (any number of spaces
1225 or tabs). For example:
1227 confdir /etc/privoxy
1229 Assigns the value /etc/privoxy to the option confdir and thus indicates that
1230 the configuration directory is named "/etc/privoxy/".
1232 All options in the config file except for confdir and logdir are optional.
1233 Watch out in the below description for what happens if you leave them unset.
1235 The main config file controls all aspects of Privoxy's operation that are not
1236 location dependent (i.e. they apply universally, no matter where you may be
1239 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1241 7.1. Local Set-up Documentation
1243 If you intend to operate Privoxy for more users than just yourself, it might be
1244 a good idea to let them know how to reach you, what you block and why you do
1245 that, your policies, etc.
1247 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1253 Location of the Privoxy User Manual.
1257 A fully qualified URI
1265 http://www.privoxy.org/version/user-manual/ will be used, where version is
1266 the Privoxy version.
1270 The User Manual URI is the single best source of information on Privoxy,
1271 and is used for help links from some of the internal CGI pages. The manual
1272 itself is normally packaged with the binary distributions, so you probably
1273 want to set this to a locally installed copy.
1277 The best all purpose solution is simply to put the full local PATH to where
1278 the User Manual is located:
1280 user-manual /usr/share/doc/privoxy/user-manual
1283 The User Manual is then available to anyone with access to Privoxy, by
1284 following the built-in URL: http://config.privoxy.org/user-manual/ (or the
1285 shortcut: http://p.p/user-manual/).
1287 If the documentation is not on the local system, it can be accessed from a
1290 user-manual http://example.com/privoxy/user-manual/
1293 ┌─────────────────────────────────────────────────────────────────┐
1295 ├─────────────────────────────────────────────────────────────────┤
1296 │If set, this option should be the first option in the config │
1297 │file, because it is used while the config file is being read on │
1299 └─────────────────────────────────────────────────────────────────┘
1301 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1303 7.1.2. trust-info-url
1307 A URL to be displayed in the error page that users will see if access to an
1308 untrusted page is denied.
1316 Two example URLs are provided
1320 No links are displayed on the "untrusted" error page.
1324 The value of this option only matters if the experimental trust mechanism
1325 has been activated. (See trustfile below.)
1327 If you use the trust mechanism, it is a good idea to write up some on-line
1328 documentation about your trust policy and to specify the URL(s) here. Use
1329 multiple times for multiple URLs.
1331 The URL(s) should be added to the trustfile as well, so users don't end up
1332 locked out from the information on why they were locked out in the first
1335 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1337 7.1.3. admin-address
1341 An email address to reach the Privoxy administrator.
1353 No email address is displayed on error pages and the CGI user interface.
1357 If both admin-address and proxy-info-url are unset, the whole "Local
1358 Privoxy Support" box on all generated pages will not be shown.
1360 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1362 7.1.4. proxy-info-url
1366 A URL to documentation about the local Privoxy setup, configuration or
1379 No link to local documentation is displayed on error pages and the CGI user
1384 If both admin-address and proxy-info-url are unset, the whole "Local
1385 Privoxy Support" box on all generated pages will not be shown.
1387 This URL shouldn't be blocked ;-)
1389 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1391 7.2. Configuration and Log File Locations
1393 Privoxy can (and normally does) use a number of other files for additional
1394 configuration, help and logging. This section of the configuration file tells
1395 Privoxy where to find those other files.
1397 The user running Privoxy, must have read permission for all configuration
1398 files, and write permission to any files that would be modified, such as log
1399 files and actions files.
1401 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1407 The directory where the other configuration files are located.
1415 /etc/privoxy (Unix) or Privoxy installation dir (Windows)
1423 No trailing "/", please.
1425 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1431 An alternative directory where the templates are loaded from.
1443 The templates are assumed to be located in confdir/template.
1447 Privoxy's original templates are usually overwritten with each update. Use
1448 this option to relocate customized templates that should be kept. As
1449 template variables might change between updates, you shouldn't expect
1450 templates to work with Privoxy releases other than the one they were part
1453 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1459 The directory where all logging takes place (i.e. where logfile and jarfile
1468 /var/log/privoxy (Unix) or Privoxy installation dir (Windows)
1476 No trailing "/", please.
1478 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1484 The actions file(s) to use
1488 Complete file name, relative to confdir
1492 standard.action # Internal purposes, no editing recommended
1494 default.action # Main actions file
1496 user.action # User customizations
1500 No actions are taken at all. More or less neutral proxying.
1504 Multiple actionsfile lines are permitted, and are in fact recommended!
1506 The default values include standard.action, which is used for internal
1507 purposes and should be loaded, default.action, which is the "main" actions
1508 file maintained by the developers, and user.action, where you can make your
1511 Actions files contain all the per site and per URL configuration for ad
1512 blocking, cookie management, privacy considerations, etc. There is no point
1513 in using Privoxy without at least one actions file.
1515 Note that since Privoxy 3.0.7, the complete filename, including the
1516 ".action" extension has to be specified. The syntax change was necessary to
1517 be consistent with the other file options and to allow previously forbidden
1520 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1526 The filter file(s) to use
1530 File name, relative to confdir
1534 default.filter (Unix) or default.filter.txt (Windows)
1538 No textual content filtering takes place, i.e. all +filter{name} actions in
1539 the actions files are turned neutral.
1543 Multiple filterfile lines are permitted.
1545 The filter files contain content modification rules that use regular
1546 expressions. These rules permit powerful changes on the content of Web
1547 pages, and optionally the headers as well, e.g., you could try to disable
1548 your favorite JavaScript annoyances, re-write the actual displayed text, or
1549 just have some fun playing buzzword bingo with web pages.
1551 The +filter{name} actions rely on the relevant filter (name) to be defined
1554 A pre-defined filter file called default.filter that contains a number of
1555 useful filters for common problems is included in the distribution. See the
1556 section on the filter action for a list.
1558 It is recommended to place any locally adapted filters into a separate
1559 file, such as user.filter.
1561 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1571 File name, relative to logdir
1575 Unset (commented out). When activated: logfile (Unix) or privoxy.log
1580 Logging is disabled unless --no-daemon mode is used.
1584 The logfile is where all logging and error messages are written. The level
1585 of detail and number of messages are set with the debug option (see below).
1586 The logfile can be useful for tracking down a problem with Privoxy (e.g.,
1587 it's not blocking an ad you think it should block) and it can help you to
1588 monitor what your browser is doing.
1590 Many users will never look at it, however, and it's a privacy risk if third
1591 parties can get access to it. It is therefore disabled by default in
1592 Privoxy 3.0.7 and later.
1594 For troubleshooting purposes, you will have to explicitly enable it. Please
1595 don't file any support requests without trying to reproduce the problem
1596 with logging enabled first. Once you read the log messages, you may even be
1597 able to solve the problem on your own.
1599 Your logfile will grow indefinitely, and you will probably want to
1600 periodically remove it. On Unix systems, you can do this with a cron job
1601 (see "man cron"). For Red Hat based Linux distributions, a logrotate script
1604 Any log files must be writable by whatever user Privoxy is being run as (on
1605 Unix, default user id is "privoxy").
1607 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1613 The file to store intercepted cookies in
1617 File name, relative to logdir
1621 Unset (commented out). When activated: jarfile (Unix) or privoxy.jar
1626 Intercepted cookies are not stored in a dedicated log file.
1630 The jarfile may grow to ridiculous sizes over time.
1632 If debug 8 (show header parsing) is enabled, cookies are also written to
1633 the logfile with the rest of the headers. Therefore this option isn't very
1634 useful and may be removed in future releases. Please report to the
1635 developers if you are still using it.
1637 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1643 The name of the trust file to use
1647 File name, relative to confdir
1651 Unset (commented out). When activated: trust (Unix) or trust.txt (Windows)
1655 The entire trust mechanism is disabled.
1659 The trust mechanism is an experimental feature for building white-lists and
1660 should be used with care. It is NOT recommended for the casual user.
1662 If you specify a trust file, Privoxy will only allow access to sites that
1663 are specified in the trustfile. Sites can be listed in one of two ways:
1665 Prepending a ~ character limits access to this site only (and any sub-paths
1666 within this site), e.g. ~www.example.com allows access to ~www.example.com/
1667 features/news.html, etc.
1669 Or, you can designate sites as trusted referrers, by prepending the name
1670 with a + character. The effect is that access to untrusted sites will be
1671 granted -- but only if a link from this trusted referrer was used to get
1672 there. The link target will then be added to the "trustfile" so that
1673 future, direct accesses will be granted. Sites added via this mechanism do
1674 not become trusted referrers themselves (i.e. they are added with a ~
1675 designation). There is a limit of 512 such entries, after which new entries
1678 If you use the + operator in the trust file, it may grow considerably over
1681 It is recommended that Privoxy be compiled with the --disable-force,
1682 --disable-toggle and --disable-editor options, if this feature is to be
1685 Possible applications include limiting Internet access for children.
1687 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1691 These options are mainly useful when tracing a problem. Note that you might
1692 also want to invoke Privoxy with the --no-daemon command line option when
1695 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1701 Key values that determine what information gets logged to the logfile.
1709 12289 (i.e.: URLs plus informational and warning messages)
1713 Nothing gets logged.
1717 The available debug levels are:
1719 debug 1 # show each GET/POST/CONNECT request
1720 debug 2 # show each connection status
1721 debug 4 # show I/O status
1722 debug 8 # show header parsing
1723 debug 16 # log all data written to the network into the logfile
1724 debug 32 # debug force feature
1725 debug 64 # debug regular expression filters
1726 debug 128 # debug redirects
1727 debug 256 # debug GIF de-animation
1728 debug 512 # Common Log Format
1729 debug 1024 # debug kill pop-ups
1730 debug 2048 # CGI user interface
1731 debug 4096 # Startup banner and warnings.
1732 debug 8192 # Non-fatal errors
1735 To select multiple debug levels, you can either add them or use multiple
1738 A debug level of 1 is informative because it will show you each request as
1739 it happens. 1, 4096 and 8192 are highly recommended so that you will notice
1740 when things go wrong. The other levels are probably only of interest if you
1741 are hunting down a specific problem. They can produce a hell of an output
1744 If you want to use CLF (Common Log Format), you should set "debug 512" ONLY
1745 and not enable anything else.
1747 Privoxy has a hard-coded limit for the length of log messages. If it's
1748 reached, messages are logged truncated and marked with "... [too long,
1751 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1753 7.3.2. single-threaded
1757 Whether to run only one server thread.
1769 Multi-threaded (or, where unavailable: forked) operation, i.e. the ability
1770 to serve multiple requests simultaneously.
1774 This option is only there for debugging purposes. It will drastically
1777 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1779 7.4. Access Control and Security
1781 This section of the config file controls the security-relevant aspects of
1782 Privoxy's configuration.
1784 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1786 7.4.1. listen-address
1790 The IP address and TCP port on which Privoxy will listen for client
1803 Bind to 127.0.0.1 (localhost), port 8118. This is suitable and recommended
1804 for home users who run Privoxy on the same machine as their browser.
1808 You will need to configure your browser(s) to this proxy address and port.
1810 If you already have another service running on port 8118, or if you want to
1811 serve requests from other machines (e.g. on your local network) as well,
1812 you will need to override the default.
1814 If you leave out the IP address, Privoxy will bind to all interfaces
1815 (addresses) on your machine and may become reachable from the Internet. In
1816 that case, consider using access control lists (ACL's, see below), and/or a
1819 If you open Privoxy to untrusted users, you will also want to make sure
1820 that the following actions are disabled: enable-edit-actions and
1821 enable-remote-toggle
1825 Suppose you are running Privoxy on a machine which has the address
1826 192.168.0.1 on your local private network (192.168.0.0) and has another
1827 outside connection with a different address. You want it to serve requests
1830 listen-address 192.168.0.1:8118
1833 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1839 Initial state of "toggle" status
1851 Act as if toggled on
1855 If set to 0, Privoxy will start in "toggled off" mode, i.e. mostly behave
1856 like a normal, content-neutral proxy with both ad blocking and content
1857 filtering disabled. See enable-remote-toggle below.
1859 The windows version will only display the toggle icon in the system tray if
1860 this option is present.
1862 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1864 7.4.3. enable-remote-toggle
1868 Whether or not the web-based toggle feature may be used
1880 The web-based toggle feature is disabled.
1884 When toggled off, Privoxy mostly acts like a normal, content-neutral proxy,
1885 i.e. doesn't block ads or filter content.
1887 Access to the toggle feature can not be controlled separately by "ACLs" or
1888 HTTP authentication, so that everybody who can access Privoxy (see "ACLs"
1889 and listen-address above) can toggle it for all users. So this option is
1890 not recommended for multi-user environments with untrusted users.
1892 Note that malicious client side code (e.g Java) is also capable of using
1895 As a lot of Privoxy users don't read documentation, this feature is
1896 disabled by default.
1898 Note that you must have compiled Privoxy with support for this feature,
1899 otherwise this option has no effect.
1901 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1903 7.4.4. enable-remote-http-toggle
1907 Whether or not Privoxy recognizes special HTTP headers to change its
1920 Privoxy ignores special HTTP headers.
1924 When toggled on, the client can change Privoxy's behaviour by setting
1925 special HTTP headers. Currently the only supported special header is
1926 "X-Filter: No", to disable filtering for the ongoing request, even if it is
1927 enabled in one of the action files.
1929 This feature is disabled by default. If you are using Privoxy in a
1930 environment with trusted clients, you may enable this feature at your
1931 discretion. Note that malicious client side code (e.g Java) is also capable
1932 of using this feature.
1934 This option will be removed in future releases as it has been obsoleted by
1935 the more general header taggers.
1937 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1939 7.4.5. enable-edit-actions
1943 Whether or not the web-based actions file editor may be used
1955 The web-based actions file editor is disabled.
1959 Access to the editor can not be controlled separately by "ACLs" or HTTP
1960 authentication, so that everybody who can access Privoxy (see "ACLs" and
1961 listen-address above) can modify its configuration for all users.
1963 This option is not recommended for environments with untrusted users and as
1964 a lot of Privoxy users don't read documentation, this feature is disabled
1967 Note that malicious client side code (e.g Java) is also capable of using
1968 the actions editor and you shouldn't enable this options unless you
1969 understand the consequences and are sure your browser is configured
1972 Note that you must have compiled Privoxy with support for this feature,
1973 otherwise this option has no effect.
1975 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1977 7.4.6. enforce-blocks
1981 Whether the user is allowed to ignore blocks and can "go there anyway".
1993 Blocks are not enforced.
1997 Privoxy is mainly used to block and filter requests as a service to the
1998 user, for example to block ads and other junk that clogs the pipes.
1999 Privoxy's configuration isn't perfect and sometimes innocent pages are
2000 blocked. In this situation it makes sense to allow the user to enforce the
2001 request and have Privoxy ignore the block.
2003 In the default configuration Privoxy's "Blocked" page contains a "go there
2004 anyway" link to adds a special string (the force prefix) to the request
2005 URL. If that link is used, Privoxy will detect the force prefix, remove it
2006 again and let the request pass.
2008 Of course Privoxy can also be used to enforce a network policy. In that
2009 case the user obviously should not be able to bypass any blocks, and that's
2010 what the "enforce-blocks" option is for. If it's enabled, Privoxy hides the
2011 "go there anyway" link. If the user adds the force prefix by hand, it will
2012 not be accepted and the circumvention attempt is logged.
2018 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2020 7.4.7. ACLs: permit-access and deny-access
2024 Who can access what.
2028 src_addr[/src_masklen] [dst_addr[/dst_masklen]]
2030 Where src_addr and dst_addr are IP addresses in dotted decimal notation or
2031 valid DNS names, and src_masklen and dst_masklen are subnet masks in CIDR
2032 notation, i.e. integer values from 2 to 30 representing the length (in
2033 bits) of the network address. The masks and the whole destination part are
2042 Don't restrict access further than implied by listen-address
2046 Access controls are included at the request of ISPs and systems
2047 administrators, and are not usually needed by individual users. For a
2048 typical home user, it will normally suffice to ensure that Privoxy only
2049 listens on the localhost (127.0.0.1) or internal (home) network address by
2050 means of the listen-address option.
2052 Please see the warnings in the FAQ that Privoxy is not intended to be a
2053 substitute for a firewall or to encourage anyone to defer addressing basic
2054 security weaknesses.
2056 Multiple ACL lines are OK. If any ACLs are specified, Privoxy only talks to
2057 IP addresses that match at least one permit-access line and don't match any
2058 subsequent deny-access line. In other words, the last match wins, with the
2059 default being deny-access.
2061 If Privoxy is using a forwarder (see forward below) for a particular
2062 destination URL, the dst_addr that is examined is the address of the
2063 forwarder and NOT the address of the ultimate target. This is necessary
2064 because it may be impossible for the local Privoxy to determine the IP
2065 address of the ultimate target (that's often what gateways are used for).
2067 You should prefer using IP addresses over DNS names, because the address
2068 lookups take time. All DNS names must resolve! You can not use domain
2069 patterns like "*.org" or partial domain names. If a DNS name resolves to
2070 multiple IP addresses, only the first one is used.
2072 Denying access to particular sites by ACL may have undesired side effects
2073 if the site in question is hosted on a machine which also hosts other sites
2078 Explicitly define the default behavior if no ACL and listen-address are
2079 set: "localhost" is OK. The absence of a dst_addr implies that all
2080 destination addresses are OK:
2082 permit-access localhost
2085 Allow any host on the same class C subnet as www.privoxy.org access to
2086 nothing but www.example.com (or other domains hosted on the same system):
2088 permit-access www.privoxy.org/24 www.example.com/32
2091 Allow access from any host on the 26-bit subnet 192.168.45.64 to anywhere,
2092 with the exception that 192.168.45.73 may not access the IP address behind
2093 www.dirty-stuff.example.com:
2095 permit-access 192.168.45.64/26
2096 deny-access 192.168.45.73 www.dirty-stuff.example.com
2099 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2105 Maximum size of the buffer for content filtering.
2117 Use a 4MB (4096 KB) limit.
2121 For content filtering, i.e. the +filter and +deanimate-gif actions, it is
2122 necessary that Privoxy buffers the entire document body. This can be
2123 potentially dangerous, since a server could just keep sending data
2124 indefinitely and wait for your RAM to exhaust -- with nasty consequences.
2127 When a document buffer size reaches the buffer-limit, it is flushed to the
2128 client unfiltered and no further attempt to filter the rest of the document
2129 is made. Remember that there may be multiple threads running, which might
2130 require up to buffer-limit Kbytes each, unless you have enabled
2131 "single-threaded" above.
2133 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2137 This feature allows routing of HTTP requests through a chain of multiple
2140 Forwarding can be used to chain Privoxy with a caching proxy to speed up
2141 browsing. Using a parent proxy may also be necessary if the machine that
2142 Privoxy runs on has no direct Internet access.
2144 Note that parent proxies can severely decrease your privacy level. For example
2145 a parent proxy could add your IP address to the request headers and if it's a
2146 caching proxy it may add the "Etag" header to revalidation requests again, even
2147 though you configured Privoxy to remove it. It may also ignore Privoxy's header
2148 time randomization and use the original values which could be used by the
2149 server as cookie replacement to track your steps between visits.
2151 Also specified here are SOCKS proxies. Privoxy supports the SOCKS 4 and SOCKS
2154 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2160 To which parent HTTP proxy specific requests should be routed.
2164 target_pattern http_parent[:port]
2166 where target_pattern is a URL pattern that specifies to which requests
2167 (i.e. URLs) this forward rule shall apply. Use / to denote "all URLs".
2168 http_parent[:port] is the DNS name or IP address of the parent HTTP proxy
2169 through which the requests should be forwarded, optionally followed by its
2170 listening port (default: 8080). Use a single dot (.) to denote "no
2179 Don't use parent HTTP proxies.
2183 If http_parent is ".", then requests are not forwarded to another HTTP
2184 proxy but are made directly to the web servers.
2186 Multiple lines are OK, they are checked in sequence, and the last match
2191 Everything goes to an example parent proxy, except SSL on port 443 (which
2194 forward / parent-proxy.example.org:8080
2198 Everything goes to our example ISP's caching proxy, except for requests to
2201 forward / caching-proxy.isp.example.net:8000
2202 forward .isp.example.net .
2205 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2207 7.5.2. forward-socks4 and forward-socks4a
2211 Through which SOCKS proxy (and optionally to which parent HTTP proxy)
2212 specific requests should be routed.
2216 target_pattern socks_proxy[:port] http_parent[:port]
2218 where target_pattern is a URL pattern that specifies to which requests
2219 (i.e. URLs) this forward rule shall apply. Use / to denote "all URLs".
2220 http_parent and socks_proxy are IP addresses in dotted decimal notation or
2221 valid DNS names (http_parent may be "." to denote "no HTTP forwarding"),
2222 and the optional port parameters are TCP ports, i.e. integer values from 1
2231 Don't use SOCKS proxies.
2235 Multiple lines are OK, they are checked in sequence, and the last match
2238 The difference between forward-socks4 and forward-socks4a is that in the
2239 SOCKS 4A protocol, the DNS resolution of the target hostname happens on the
2240 SOCKS server, while in SOCKS 4 it happens locally.
2242 If http_parent is ".", then requests are not forwarded to another HTTP
2243 proxy but are made (HTTP-wise) directly to the web servers, albeit through
2248 From the company example.com, direct connections are made to all "internal"
2249 domains, but everything outbound goes through their ISP's proxy by way of
2250 example.com's corporate SOCKS 4A gateway to the Internet.
2252 forward-socks4a / socks-gw.example.com:1080 www-cache.isp.example.net:8080
2253 forward .example.com .
2256 A rule that uses a SOCKS 4 gateway for all destinations but no HTTP parent
2259 forward-socks4 / socks-gw.example.com:1080 .
2262 To chain Privoxy and Tor, both running on the same system, you would use
2265 forward-socks4a / 127.0.0.1:9050 .
2268 The public Tor network can't be used to reach your local network, if you
2269 need to access local servers you therefore might want to make some
2272 forward 192.168.*.*/ .
2274 forward 127.*.*.*/ .
2277 Unencrypted connections to systems in these address ranges will be as (un)
2278 secure as the local network is, but the alternative is that you can't reach
2279 the local network through Privoxy at all. Of course this may actually be
2280 desired and there is no reason to make these exceptions if you aren't sure
2283 If you also want to be able to reach servers in your local network by using
2284 their names, you will need additional exceptions that look like this:
2286 forward localhost/ .
2289 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2291 7.5.3. Advanced Forwarding Examples
2293 If you have links to multiple ISPs that provide various special content only to
2294 their subscribers, you can configure multiple Privoxies which have connections
2295 to the respective ISPs to act as forwarders to each other, so that your users
2296 can see the internal content of all ISPs.
2298 Assume that host-a has a PPP connection to isp-a.example.net. And host-b has a
2299 PPP connection to isp-b.example.org. Both run Privoxy. Their forwarding
2300 configuration can look like this:
2305 forward .isp-b.example.net host-b:8118
2311 forward .isp-a.example.org host-a:8118
2314 Now, your users can set their browser's proxy to use either host-a or host-b
2315 and be able to browse the internal content of both isp-a and isp-b.
2317 If you intend to chain Privoxy and squid locally, then chaining as browser ->
2318 squid -> privoxy is the recommended way.
2320 Assuming that Privoxy and squid run on the same box, your squid configuration
2321 could then look like this:
2323 # Define Privoxy as parent proxy (without ICP)
2324 cache_peer 127.0.0.1 parent 8118 7 no-query
2326 # Define ACL for protocol FTP
2329 # Do not forward FTP requests to Privoxy
2330 always_direct allow ftp
2332 # Forward all the rest to Privoxy
2333 never_direct allow all
2336 You would then need to change your browser's proxy settings to squid's address
2337 and port. Squid normally uses port 3128. If unsure consult http_port in
2340 You could just as well decide to only forward requests you suspect of leading
2341 to Windows executables through a virus-scanning parent proxy, say, on
2342 antivir.example.com, port 8010:
2345 forward /.*\.(exe|com|dll|zip)$ antivir.example.com:8010
2348 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2350 7.5.4. forwarded-connect-retries
2354 How often Privoxy retries if a forwarded connection request fails.
2366 Connections forwarded through other proxies are treated like direct
2367 connections and no retry attempts are made.
2371 forwarded-connect-retries is mainly interesting for socks4a connections,
2372 where Privoxy can't detect why the connections failed. The connection might
2373 have failed because of a DNS timeout in which case a retry makes sense, but
2374 it might also have failed because the server doesn't exist or isn't
2375 reachable. In this case the retry will just delay the appearance of
2376 Privoxy's error message.
2378 Note that in the context of this option, "forwarded connections" includes
2379 all connections that Privoxy forwards through other proxies. This option is
2380 not limited to the HTTP CONNECT method.
2382 Only use this option, if you are getting lots of forwarding-related error
2383 messages that go away when you try again manually. Start with a small value
2384 and check Privoxy's logfile from time to time, to see how many retries are
2389 forwarded-connect-retries 1
2391 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2393 7.5.5. accept-intercepted-requests
2397 Whether intercepted requests should be treated as valid.
2409 Only proxy requests are accepted, intercepted requests are treated as
2414 If you don't trust your clients and want to force them to use Privoxy,
2415 enable this option and configure your packet filter to redirect outgoing
2416 HTTP connections into Privoxy.
2418 Make sure that Privoxy's own requests aren't redirected as well.
2419 Additionally take care that Privoxy can't intentionally connect to itself,
2420 otherwise you could run into redirection loops if Privoxy's listening port
2421 is reachable by the outside or an attacker has access to the pages you
2426 accept-intercepted-requests 1
2428 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2430 7.5.6. allow-cgi-request-crunching
2434 Whether requests to Privoxy's CGI pages can be blocked or redirected.
2446 Privoxy ignores block and redirect actions for its CGI pages.
2450 By default Privoxy ignores block or redirect actions for its CGI pages.
2451 Intercepting these requests can be useful in multi-user setups to implement
2452 fine-grained access control, but it can also render the complete web
2453 interface useless and make debugging problems painful if done without care.
2455 Don't enable this option unless you're sure that you really need it.
2459 allow-cgi-request-crunching 1
2461 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2463 7.5.7. split-large-forms
2467 Whether the CGI interface should stay compatible with broken HTTP clients.
2479 The CGI form generate long GET URLs.
2483 Privoxy's CGI forms can lead to rather long URLs. This isn't a problem as
2484 far as the HTTP standard is concerned, but it can confuse clients with
2485 arbitrary URL length limitations.
2487 Enabling split-large-forms causes Privoxy to divide big forms into smaller
2488 ones to keep the URL length down. It makes editing a lot less convenient
2489 and you can no longer submit all changes at once, but at least it works
2490 around this browser bug.
2492 If you don't notice any editing problems, there is no reason to enable this
2493 option, but if one of the submit buttons appears to be broken, you should
2500 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2502 7.6. Windows GUI Options
2504 Privoxy has a number of options specific to the Windows GUI interface:
2506 If "activity-animation" is set to 1, the Privoxy icon will animate when
2507 "Privoxy" is active. To turn off, set to 0.
2509 activity-animation 1
2512 If "log-messages" is set to 1, Privoxy will log messages to the console window:
2517 If "log-buffer-size" is set to 1, the size of the log buffer, i.e. the amount
2518 of memory used for the log messages displayed in the console window, will be
2519 limited to "log-max-lines" (see below).
2521 Warning: Setting this to 0 will result in the buffer to grow infinitely and eat
2527 log-max-lines is the maximum number of lines held in the log buffer. See above.
2532 If "log-highlight-messages" is set to 1, Privoxy will highlight portions of the
2533 log messages with a bold-faced font:
2535 log-highlight-messages 1
2538 The font used in the console window:
2540 log-font-name Comic Sans MS
2543 Font size used in the console window:
2548 "show-on-task-bar" controls whether or not Privoxy will appear as a button on
2549 the Task bar when minimized:
2554 If "close-button-minimizes" is set to 1, the Windows close button will minimize
2555 Privoxy instead of closing the program (close with the exit option on the File
2558 close-button-minimizes 1
2561 The "hide-console" option is specific to the MS-Win console version of Privoxy.
2562 If this option is used, Privoxy will disconnect from and hide the command
2568 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2572 The actions files are used to define what actions Privoxy takes for which URLs,
2573 and thus determines how ad images, cookies and various other aspects of HTTP
2574 content and transactions are handled, and on which sites (or even parts
2575 thereof). There are a number of such actions, with a wide range of
2576 functionality. Each action does something a little different. These actions
2577 give us a veritable arsenal of tools with which to exert our control,
2578 preferences and independence. Actions can be combined so that their effects are
2579 aggregated when applied against a given set of URLs.
2581 There are three action files included with Privoxy with differing purposes:
2583 • default.action - is the primary action file that sets the initial values
2584 for all actions. It is intended to provide a base level of functionality
2585 for Privoxy's array of features. So it is a set of broad rules that should
2586 work reasonably well as-is for most users. This is the file that the
2587 developers are keeping updated, and making available to users. The user's
2588 preferences as set in standard.action, e.g. either Cautious (the default),
2589 Medium, or Advanced (see below).
2591 • user.action - is intended to be for local site preferences and exceptions.
2592 As an example, if your ISP or your bank has specific requirements, and need
2593 special handling, this kind of thing should go here. This file will not be
2596 • standard.action - is used only by the web based editor at http://
2597 config.privoxy.org/edit-actions-list?f=default, to set various pre-defined
2598 sets of rules for the default actions section in default.action.
2600 Edit Set to Cautious Set to Medium Set to Advanced
2602 These have increasing levels of aggressiveness and have no influence on
2603 your browsing unless you select them explicitly in the editor. A default
2604 installation should be pre-set to Cautious (versions prior to 3.0.5 were
2605 set to Medium). New users should try this for a while before adjusting the
2606 settings to more aggressive levels. The more aggressive the settings, then
2607 the more likelihood there is of problems such as sites not working as they
2610 The Edit button allows you to turn each action on/off individually for
2611 fine-tuning. The Cautious button changes the actions list to low/safe
2612 settings which will activate ad blocking and a minimal set of Privoxy's
2613 features, and subsequently there will be less of a chance for accidental
2614 problems. The Medium button sets the list to a medium level of other
2615 features and a low level set of privacy features. The Advanced button sets
2616 the list to a high level of ad blocking and medium level of privacy. See
2617 the chart below. The latter three buttons over-ride any changes via with
2618 the Edit button. More fine-tuning can be done in the lower sections of this
2621 It is not recommend to edit the standard.action file itself.
2623 The default profiles, and their associated actions, as pre-defined in
2624 standard.action are:
2626 Table 1. Default Configurations
2628 ┌──────────────────────────┬───────────┬────────────┬───────────┐
2629 │ Feature │ Cautious │ Medium │ Advanced │
2630 ├──────────────────────────┼───────────┼────────────┼───────────┤
2631 │Ad-blocking Aggressiveness│medium │high │high │
2632 ├──────────────────────────┼───────────┼────────────┼───────────┤
2633 │Ad-filtering by size │no │yes │yes │
2634 ├──────────────────────────┼───────────┼────────────┼───────────┤
2635 │Ad-filtering by link │no │no │yes │
2636 ├──────────────────────────┼───────────┼────────────┼───────────┤
2637 │Pop-up killing │blocks only│blocks only │blocks only│
2638 ├──────────────────────────┼───────────┼────────────┼───────────┤
2639 │Privacy Features │low │medium │medium/high│
2640 ├──────────────────────────┼───────────┼────────────┼───────────┤
2641 │Cookie handling │none │session-only│kill │
2642 ├──────────────────────────┼───────────┼────────────┼───────────┤
2643 │Referer forging │no │yes │yes │
2644 ├──────────────────────────┼───────────┼────────────┼───────────┤
2645 │GIF de-animation │no │yes │yes │
2646 ├──────────────────────────┼───────────┼────────────┼───────────┤
2647 │Fast redirects │no │no │yes │
2648 ├──────────────────────────┼───────────┼────────────┼───────────┤
2649 │HTML taming │no │no │yes │
2650 ├──────────────────────────┼───────────┼────────────┼───────────┤
2651 │JavaScript taming │no │no │yes │
2652 ├──────────────────────────┼───────────┼────────────┼───────────┤
2653 │Web-bug killing │no │yes │yes │
2654 ├──────────────────────────┼───────────┼────────────┼───────────┤
2655 │Image tag reordering │no │no │yes │
2656 └──────────────────────────┴───────────┴────────────┴───────────┘
2658 The list of actions files to be used are defined in the main configuration
2659 file, and are processed in the order they are defined (e.g. default.action is
2660 typically processed before user.action). The content of these can all be viewed
2661 and edited from http://config.privoxy.org/show-status. The over-riding
2662 principle when applying actions, is that the last action that matches a given
2663 URL wins. The broadest, most general rules go first (defined in
2664 default.action), followed by any exceptions (typically also in default.action),
2665 which are then followed lastly by any local preferences (typically in
2666 user.action). Generally, user.action has the last word.
2668 An actions file typically has multiple sections. If you want to use "aliases"
2669 in an actions file, you have to place the (optional) alias section at the top
2670 of that file. Then comes the default set of rules which will apply universally
2671 to all sites and pages (be very careful with using such a universal set in
2672 user.action or any other actions file after default.action, because it will
2673 override the result from consulting any previous file). And then below that,
2674 exceptions to the defined universal policies. You can regard user.action as an
2675 appendix to default.action, with the advantage that it is a separate file,
2676 which makes preserving your personal settings across Privoxy upgrades easier.
2678 Actions can be used to block anything you want, including ads, banners, or just
2679 some obnoxious URL whose content you would rather not see. Cookies can be
2680 accepted or rejected, or accepted only during the current browser session (i.e.
2681 not written to disk), content can be modified, some JavaScripts tamed,
2682 user-tracking fooled, and much more. See below for a complete list of actions.
2684 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2686 8.1. Finding the Right Mix
2688 Note that some actions, like cookie suppression or script disabling, may render
2689 some sites unusable that rely on these techniques to work properly. Finding the
2690 right mix of actions is not always easy and certainly a matter of personal
2691 taste. And, things can always change, requiring refinements in the
2692 configuration. In general, it can be said that the more "aggressive" your
2693 default settings (in the top section of the actions file) are, the more
2694 exceptions for "trusted" sites you will have to make later. If, for example,
2695 you want to crunch all cookies per default, you'll have to make exceptions from
2696 that rule for sites that you regularly use and that require cookies for
2697 actually useful purposes, like maybe your bank, favorite shop, or newspaper.
2699 We have tried to provide you with reasonable rules to start from in the
2700 distribution actions files. But there is no general rule of thumb on these
2701 things. There just are too many variables, and sites are constantly changing.
2702 Sooner or later you will want to change the rules (and read this chapter again
2705 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2709 The easiest way to edit the actions files is with a browser by using our
2710 browser-based editor, which can be reached from http://config.privoxy.org/
2711 show-status. Note: the config file option enable-edit-actions must be enabled
2712 for this to work. The editor allows both fine-grained control over every single
2713 feature on a per-URL basis, and easy choosing from wholesale sets of defaults
2714 like "Cautious", "Medium" or "Advanced". Warning: the "Advanced" setting is
2715 more aggressive, and will be more likely to cause problems for some sites.
2716 Experienced users only!
2718 If you prefer plain text editing to GUIs, you can of course also directly edit
2719 the the actions files with your favorite text editor. Look at default.action
2720 which is richly commented with many good examples.
2722 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2724 8.3. How Actions are Applied to Requests
2726 Actions files are divided into sections. There are special sections, like the "
2727 alias" sections which will be discussed later. For now let's concentrate on
2728 regular sections: They have a heading line (often split up to multiple lines
2729 for readability) which consist of a list of actions, separated by whitespace
2730 and enclosed in curly braces. Below that, there is a list of URL and tag
2731 patterns, each on a separate line.
2733 To determine which actions apply to a request, the URL of the request is
2734 compared to all URL patterns in each "action file". Every time it matches, the
2735 list of applicable actions for the request is incrementally updated, using the
2736 heading of the section in which the pattern is located. The same is done again
2737 for tags and tag patterns later on.
2739 If multiple applying sections set the same action differently, the last match
2740 wins. If not, the effects are aggregated. E.g. a URL might match a regular
2741 section with a heading line of { +handle-as-image }, then later another one
2742 with just { +block }, resulting in both actions to apply. And there may well be
2743 cases where you will want to combine actions together. Such a section then
2746 { +handle-as-image +block }
2747 # Block these as if they were images. Send no block page.
2749 media.example.com/.*banners
2750 .example.com/images/ads/
2753 You can trace this process for URL patterns and any given URL by visiting http:
2754 //config.privoxy.org/show-url-info.
2756 Examples and more detail on this is provided in the Appendix, Troubleshooting:
2757 Anatomy of an Action section.
2759 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2763 As mentioned, Privoxy uses "patterns" to determine what actions might apply to
2764 which sites and pages your browser attempts to access. These "patterns" use
2765 wild card type pattern matching to achieve a high degree of flexibility. This
2766 allows one expression to be expanded and potentially match against many similar
2769 Generally, an URL pattern has the form <domain>/<path>, where both the <domain>
2770 and <path> are optional. (This is why the special / pattern matches all URLs).
2771 Note that the protocol portion of the URL pattern (e.g. http://) should not be
2772 included in the pattern. This is assumed already!
2774 The pattern matching syntax is different for the domain and path parts of the
2775 URL. The domain part uses a simple globbing type matching technique, while the
2776 path part uses a more flexible "Regular Expressions (PCRE)" based syntax.
2780 is a domain-only pattern and will match any request to www.example.com,
2781 regardless of which document on that server is requested. So ALL pages in
2782 this domain would be covered by the scope of this action. Note that a
2783 simple example.com is different and would NOT match.
2787 means exactly the same. For domain-only patterns, the trailing / may be
2790 www.example.com/index.html$
2792 matches all the documents on www.example.com whose name starts with /
2795 www.example.com/index.html$
2797 matches only the single document /index.html on www.example.com.
2801 matches the document /index.html, regardless of the domain, i.e. on any web
2806 matches nothing, since it would be interpreted as a domain name and there
2807 is no top-level domain called .html. So its a mistake.
2809 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2811 8.4.1. The Domain Pattern
2813 The matching of the domain part offers some flexible options: if the domain
2814 starts or ends with a dot, it becomes unanchored at that end. For example:
2818 matches any domain that ENDS in .example.com
2822 matches any domain that STARTS with www.
2826 matches any domain that CONTAINS .example.. And, by the way, also included
2827 would be any files or documents that exist within that domain since no path
2828 limitations are specified. (Correctly speaking: It matches any FQDN that
2829 contains example as a domain.) This might be www.example.com,
2830 news.example.de, or www.example.net/cgi/testing.pl for instance. All these
2833 Additionally, there are wild-cards that you can use in the domain names
2834 themselves. These work similarly to shell globbing type wild-cards: "*"
2835 represents zero or more arbitrary characters (this is equivalent to the
2836 "Regular Expression" based syntax of ".*"), "?" represents any single character
2837 (this is equivalent to the regular expression syntax of a simple "."), and you
2838 can define "character classes" in square brackets which is similar to the same
2839 regular expression technique. All of this can be freely mixed:
2843 matches "adserver.example.com", "ads.example.com", etc but not
2848 matches all of the above, and then some.
2852 matches www.ipix.com, pictures.epix.com, a.b.c.d.e.upix.com etc.
2854 www[1-9a-ez].example.c*
2856 matches www1.example.com, www4.example.cc, wwwd.example.cy,
2857 wwwz.example.com etc., but not wwww.example.com.
2859 While flexible, this is not the sophistication of full regular expression based
2862 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2864 8.4.2. The Path Pattern
2866 Privoxy uses Perl compatible (PCRE) "Regular Expression" based syntax (through
2867 the PCRE library) for matching the path portion (after the slash), and is thus
2870 There is an Appendix with a brief quick-start into regular expressions, and
2871 full (very technical) documentation on PCRE regex syntax is available on-line
2872 at http://www.pcre.org/man.txt. You might also find the Perl man page on
2873 regular expressions (man perlre) useful, which is available on-line at http://
2874 perldoc.perl.org/perlre.html.
2876 Note that the path pattern is automatically left-anchored at the "/", i.e. it
2877 matches as if it would start with a "^" (regular expression speak for the
2878 beginning of a line).
2880 Please also note that matching in the path is CASE INSENSITIVE by default, but
2881 you can switch to case sensitive at any point in the pattern by using the "(?
2882 -i)" switch: www.example.com/(?-i)PaTtErN.* will match only documents whose
2883 path starts with PaTtErN in exactly this capitalization.
2887 Is equivalent to just ".example.com", since any documents within that
2888 domain are matched with or without the ".*" regular expression. This is
2891 .example.com/.*/index.html$
2893 Will match any page in the domain of "example.com" that is named
2894 "index.html", and that is part of some path. For example, it matches
2895 "www.example.com/testing/index.html" but NOT "www.example.com/index.html"
2896 because the regular expression called for at least two "/'s", thus the path
2897 requirement. It also would match "www.example.com/testing/index_html",
2898 because of the special meta-character ".".
2900 .example.com/(.*/)?index\.html$
2902 This regular expression is conditional so it will match any page named
2903 "index.html" regardless of path which in this case can have one or more "/
2904 's". And this one must contain exactly ".html" (but does not have to end
2907 .example.com/(.*/)(ads|banners?|junk)
2909 This regular expression will match any path of "example.com" that contains
2910 any of the words "ads", "banner", "banners" (because of the "?") or "junk".
2911 The path does not have to end in these words, just contain them.
2913 .example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$
2915 This is very much the same as above, except now it must end in either
2916 ".jpg", ".jpeg", ".gif" or ".png". So this one is limited to common image
2919 There are many, many good examples to be found in default.action, and more
2920 tutorials below in Appendix on regular expressions.
2922 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2924 8.4.3. The Tag Pattern
2926 Tag patterns are used to change the applying actions based on the request's
2927 tags. Tags can be created with either the client-header-tagger or the
2928 server-header-tagger action.
2930 Tag patterns have to start with "TAG:", so Privoxy can tell them apart from URL
2931 patterns. Everything after the colon including white space, is interpreted as a
2932 regular expression with path pattern syntax, except that tag patterns aren't
2933 left-anchored automatically (Privoxy doesn't silently add a "^", you have to do
2934 it yourself if you need it).
2936 To match all requests that are tagged with "foo" your pattern line should be
2937 "TAG:^foo$", "TAG:foo" would work as well, but it would also match requests
2938 whose tags contain "foo" somewhere. "TAG: foo" wouldn't work as it requires
2941 Sections can contain URL and tag patterns at the same time, but tag patterns
2942 are checked after the URL patterns and thus always overrule them, even if they
2943 are located before the URL patterns.
2945 Once a new tag is added, Privoxy checks right away if it's matched by one of
2946 the tag patterns and updates the action settings accordingly. As a result tags
2947 can be used to activate other tagger actions, as long as these other taggers
2948 look for headers that haven't already be parsed.
2950 For example you could tag client requests which use the POST method, then use
2951 this tag to activate another tagger that adds a tag if cookies are sent, and
2952 then use a block action based on the cookie tag. This allows the outcome of one
2953 action, to be input into a subsequent action. However if you'd reverse the
2954 position of the described taggers, and activated the method tagger based on the
2955 cookie tagger, no method tags would be created. The method tagger would look
2956 for the request line, but at the time the cookie tag is created, the request
2957 line has already been parsed.
2959 While this is a limitation you should be aware of, this kind of indirection is
2960 seldom needed anyway and even the example doesn't make too much sense.
2962 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2966 All actions are disabled by default, until they are explicitly enabled
2967 somewhere in an actions file. Actions are turned on if preceded with a "+", and
2968 turned off if preceded with a "-". So a +action means "do that action", e.g.
2969 +block means "please block URLs that match the following patterns", and -block
2970 means "don't block URLs that match the following patterns, even if +block
2971 previously applied."
2973 Again, actions are invoked by placing them on a line, enclosed in curly braces
2974 and separated by whitespace, like in {+some-action -some-other-action
2975 {some-parameter}}, followed by a list of URL patterns, one per line, to which
2976 they apply. Together, the actions line and the following pattern lines make up
2977 a section of the actions file.
2979 Actions fall into three categories:
2981 • Boolean, i.e the action can only be "enabled" or "disabled". Syntax:
2983 +name # enable action name
2984 -name # disable action name
2989 • Parameterized, where some value is required in order to enable this type of
2992 +name{param} # enable action and set parameter to param,
2993 # overwriting parameter from previous match if necessary
2994 -name # disable action. The parameter can be omitted
2997 Note that if the URL matches multiple positive forms of a parameterized
2998 action, the last match wins, i.e. the params from earlier matches are
3001 Example: +hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD i386; en-US;
3002 rv:1.8.1.4) Gecko/20070602 Firefox/2.0.0.4}
3004 • Multi-value. These look exactly like parameterized actions, but they behave
3005 differently: If the action applies multiple times to the same URL, but with
3006 different parameters, all the parameters from all matches are remembered.
3007 This is used for actions that can be executed for the same request
3008 repeatedly, like adding multiple headers, or filtering through multiple
3011 +name{param} # enable action and add param to the list of parameters
3012 -name{param} # remove the parameter param from the list of parameters
3013 # If it was the last one left, disable the action.
3014 -name # disable this action completely and remove all parameters from the list
3017 Examples: +add-header{X-Fun-Header: Some text} and +filter{html-annoyances}
3019 If nothing is specified in any actions file, no "actions" are taken. So in this
3020 case Privoxy would just be a normal, non-blocking, non-filtering proxy. You
3021 must specifically enable the privacy and blocking features you need (although
3022 the provided default actions files will give a good starting point).
3024 Later defined action sections always over-ride earlier ones of the same type.
3025 So exceptions to any rules you make, should come in the latter part of the file
3026 (or in a file that is processed later when using multiple actions files such as
3027 user.action). For multi-valued actions, the actions are applied in the order
3028 they are specified. Actions files are processed in the order they are defined
3029 in config (the default installation has three actions files). It also quite
3030 possible for any given URL to match more than one "pattern" (because of
3031 wildcards and regular expressions), and thus to trigger more than one set of
3032 actions! Last match wins.
3034 The list of valid Privoxy actions are:
3036 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3042 Confuse log analysis, custom applications
3046 Sends a user defined HTTP header to the web server.
3054 Any string value is possible. Validity of the defined HTTP headers is not
3055 checked. It is recommended that you use the "X-" prefix for custom headers.
3059 This action may be specified multiple times, in order to define multiple
3060 headers. This is rarely needed for the typical user. If you don't know what
3061 "HTTP headers" are, you definitely don't need to worry about this one.
3065 +add-header{X-User-Tracking: sucks}
3068 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3074 Block ads or other unwanted content
3078 Requests for URLs to which this action applies are blocked, i.e. the
3079 requests are trapped by Privoxy and the requested URL is never retrieved,
3080 but is answered locally with a substitute page or image, as determined by
3081 the handle-as-image, set-image-blocker, and handle-as-empty-document
3094 Privoxy sends a special "BLOCKED" page for requests to blocked pages. This
3095 page contains links to find out why the request was blocked, and a
3096 click-through to the blocked content (the latter only if compiled with the
3097 force feature enabled). The "BLOCKED" page adapts to the available screen
3098 space -- it displays full-blown if space allows, or miniaturized and
3099 text-only if loaded into a small frame or window. If you are using Privoxy
3100 right now, you can take a look at the "BLOCKED" page.
3102 A very important exception occurs if both block and handle-as-image, apply
3103 to the same request: it will then be replaced by an image. If
3104 set-image-blocker (see below) also applies, the type of image will be
3105 determined by its parameter, if not, the standard checkerboard pattern is
3108 It is important to understand this process, in order to understand how
3109 Privoxy deals with ads and other unwanted content. Blocking is a core
3110 feature, and one upon which various other features depend.
3112 The filter action can perform a very similar task, by "blocking" banner
3113 images and other content through rewriting the relevant URLs in the
3114 document's HTML source, so they don't get requested in the first place.
3115 Note that this is a totally different technique, and it's easy to confuse
3118 Example usage (section):
3121 # Block and replace with "blocked" page
3122 .nasty-stuff.example.com
3124 {+block +handle-as-image}
3125 # Block and replace with image
3129 {+block +handle-as-empty-document}
3130 # Block and then ignore
3131 adserver.exampleclick.net/.*\.js$
3134 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3136 8.5.3. client-header-filter
3140 Rewrite or remove single client headers.
3144 All client headers to which this action applies are filtered on-the-fly
3145 through the specified regular expression based substitutions.
3153 The name of a client-header filter, as defined in one of the filter files.
3157 Client-header filters are applied to each header on its own, not to all at
3158 once. This makes it easier to diagnose problems, but on the downside you
3159 can't write filters that only change header x if header y's value is z. You
3160 can do that by using tags though.
3162 Client-header filters are executed after the other header actions have
3163 finished and use their output as input.
3165 If the request URL gets changed, Privoxy will detect that and use the new
3166 one. This can be used to rewrite the request destination behind the
3167 client's back, for example to specify a Tor exit relay for certain
3170 Please refer to the filter file chapter to learn which client-header
3171 filters are available by default, and how to create your own.
3173 Example usage (section):
3175 {+client-header-filter{hide-tor-exit-notation}}
3180 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3182 8.5.4. client-header-tagger
3186 Block requests based on their headers.
3190 Client headers to which this action applies are filtered on-the-fly through
3191 the specified regular expression based substitutions, the result is used as
3200 The name of a client-header tagger, as defined in one of the filter files.
3204 Client-header taggers are applied to each header on its own, and as the
3205 header isn't modified, each tagger "sees" the original.
3207 Client-header taggers are the first actions that are executed and their
3208 tags can be used to control every other action.
3210 Example usage (section):
3212 # Tag every request with the User-Agent header
3213 {+client-header-tagger{user-agent}}
3218 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3220 8.5.5. content-type-overwrite
3224 Stop useless download menus from popping up, or change the browser's
3229 Replaces the "Content-Type:" HTTP server header.
3241 The "Content-Type:" HTTP server header is used by the browser to decide
3242 what to do with the document. The value of this header can cause the
3243 browser to open a download menu instead of displaying the document by
3244 itself, even if the document's format is supported by the browser.
3246 The declared content type can also affect which rendering mode the browser
3247 chooses. If XHTML is delivered as "text/html", many browsers treat it as
3248 yet another broken HTML document. If it is send as "application/xml",
3249 browsers with XHTML support will only display it, if the syntax is correct.
3251 If you see a web site that proudly uses XHTML buttons, but sets
3252 "Content-Type: text/html", you can use Privoxy to overwrite it with
3253 "application/xml" and validate the web master's claim inside your
3254 XHTML-supporting browser. If the syntax is incorrect, the browser will
3257 You can also go the opposite direction: if your browser prints error
3258 messages instead of rendering a document falsely declared as XHTML, you can
3259 overwrite the content type with "text/html" and have it rendered as broken
3262 By default content-type-overwrite only replaces "Content-Type:" headers
3263 that look like some kind of text. If you want to overwrite it
3264 unconditionally, you have to combine it with force-text-mode. This
3265 limitation exists for a reason, think twice before circumventing it.
3267 Most of the time it's easier to replace this action with a custom
3268 server-header filter. It allows you to activate it for every document of a
3269 certain site and it will still only replace the content types you aimed at.
3271 Of course you can apply content-type-overwrite to a whole site and then
3272 make URL based exceptions, but it's a lot more work to get the same
3275 Example usage (sections):
3277 # Check if www.example.net/ really uses valid XHTML
3278 { +content-type-overwrite{application/xml} }
3281 # but leave the content type unmodified if the URL looks like a style sheet
3282 {-content-type-overwrite}
3283 www.example.net/.*\.css$
3284 www.example.net/.*style
3287 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3289 8.5.6. crunch-client-header
3293 Remove a client header Privoxy has no dedicated action for.
3297 Deletes every header sent by the client that contains the string the user
3298 supplied as parameter.
3310 This action allows you to block client headers for which no dedicated
3311 Privoxy action exists. Privoxy will remove every client header that
3312 contains the string you supplied as parameter.
3314 Regular expressions are not supported and you can't use this action to
3315 block different headers in the same request, unless they contain the same
3318 crunch-client-header is only meant for quick tests. If you have to block
3319 several different headers, or only want to modify parts of them, you should
3320 use a client-header filter.
3322 ┌─────────────────────────────────────────────────────────────────┐
3324 ├─────────────────────────────────────────────────────────────────┤
3325 │Don't block any header without understanding the consequences. │
3326 └─────────────────────────────────────────────────────────────────┘
3327 Example usage (section):
3329 # Block the non-existent "Privacy-Violation:" client header
3330 { +crunch-client-header{Privacy-Violation:} }
3335 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3337 8.5.7. crunch-if-none-match
3341 Prevent yet another way to track the user's steps between sessions.
3345 Deletes the "If-None-Match:" HTTP client header.
3357 Removing the "If-None-Match:" HTTP client header is useful for filter
3358 testing, where you want to force a real reload instead of getting status
3359 code "304" which would cause the browser to use a cached copy of the page.
3361 It is also useful to make sure the header isn't used as a cookie
3362 replacement (unlikely but possible).
3364 Blocking the "If-None-Match:" header shouldn't cause any caching problems,
3365 as long as the "If-Modified-Since:" header isn't blocked or missing as
3368 It is recommended to use this action together with hide-if-modified-since
3369 and overwrite-last-modified.
3371 Example usage (section):
3373 # Let the browser revalidate cached documents but don't
3374 # allow the server to use the revalidation headers for user tracking.
3375 {+hide-if-modified-since{-60} \
3376 +overwrite-last-modified{randomize} \
3377 +crunch-if-none-match}
3381 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3383 8.5.8. crunch-incoming-cookies
3387 Prevent the web server from setting HTTP cookies on your system
3391 Deletes any "Set-Cookie:" HTTP headers from server replies.
3403 This action is only concerned with incoming HTTP cookies. For outgoing HTTP
3404 cookies, use crunch-outgoing-cookies. Use both to disable HTTP cookies
3407 It makes no sense at all to use this action in conjunction with the
3408 session-cookies-only action, since it would prevent the session cookies
3409 from being set. See also filter-content-cookies.
3413 +crunch-incoming-cookies
3416 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3418 8.5.9. crunch-server-header
3422 Remove a server header Privoxy has no dedicated action for.
3426 Deletes every header sent by the server that contains the string the user
3427 supplied as parameter.
3439 This action allows you to block server headers for which no dedicated
3440 Privoxy action exists. Privoxy will remove every server header that
3441 contains the string you supplied as parameter.
3443 Regular expressions are not supported and you can't use this action to
3444 block different headers in the same request, unless they contain the same
3447 crunch-server-header is only meant for quick tests. If you have to block
3448 several different headers, or only want to modify parts of them, you should
3449 use a custom server-header filter.
3451 ┌─────────────────────────────────────────────────────────────────┐
3453 ├─────────────────────────────────────────────────────────────────┤
3454 │Don't block any header without understanding the consequences. │
3455 └─────────────────────────────────────────────────────────────────┘
3456 Example usage (section):
3458 # Crunch server headers that try to prevent caching
3459 { +crunch-server-header{no-cache} }
3463 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3465 8.5.10. crunch-outgoing-cookies
3469 Prevent the web server from reading any HTTP cookies from your system
3473 Deletes any "Cookie:" HTTP headers from client requests.
3485 This action is only concerned with outgoing HTTP cookies. For incoming HTTP
3486 cookies, use crunch-incoming-cookies. Use both to disable HTTP cookies
3489 It makes no sense at all to use this action in conjunction with the
3490 session-cookies-only action, since it would prevent the session cookies
3495 +crunch-outgoing-cookies
3498 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3500 8.5.11. deanimate-gifs
3504 Stop those annoying, distracting animated GIF images.
3508 De-animate GIF animations, i.e. reduce them to their first or last image.
3520 This will also shrink the images considerably (in bytes, not pixels!). If
3521 the option "first" is given, the first frame of the animation is used as
3522 the replacement. If "last" is given, the last frame of the animation is
3523 used instead, which probably makes more sense for most banner animations,
3524 but also has the risk of not showing the entire last frame (if it is only a
3525 delta to an earlier frame).
3527 You can safely use this action with patterns that will also match non-GIF
3528 objects, because no attempt will be made at anything that doesn't look like
3533 +deanimate-gifs{last}
3536 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3538 8.5.12. downgrade-http-version
3542 Work around (very rare) problems with HTTP/1.1
3546 Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
3558 This is a left-over from the time when Privoxy didn't support important
3559 HTTP/1.1 features well. It is left here for the unlikely case that you
3560 experience HTTP/1.1 related problems with some server out there. Not all
3561 HTTP/1.1 features and requirements are supported yet, so there is a chance
3562 you might need this action.
3564 Example usage (section):
3566 {+downgrade-http-version}
3567 problem-host.example.com
3570 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3572 8.5.13. fast-redirects
3576 Fool some click-tracking scripts and speed up indirect links.
3580 Detects redirection URLs and redirects the browser without contacting the
3581 redirection server first.
3589 □ "simple-check" to just search for the string "http://" to detect
3592 □ "check-decoded-url" to decode URLs (if necessary) before searching for
3597 Many sites, like yahoo.com, don't just link to other sites. Instead, they
3598 will link to some script on their own servers, giving the destination as a
3599 parameter, which will then redirect you to the final target. URLs resulting
3600 from this scheme typically look like: "http://www.example.org/
3601 click-tracker.cgi?target=http%3a//www.example.net/".
3603 Sometimes, there are even multiple consecutive redirects encoded in the
3604 URL. These redirections via scripts make your web browsing more traceable,
3605 since the server from which you follow such a link can see where you go to.
3606 Apart from that, valuable bandwidth and time is wasted, while your browser
3607 asks the server for one redirect after the other. Plus, it feeds the
3610 This feature is currently not very smart and is scheduled for improvement.
3611 If it is enabled by default, you will have to create some exceptions to
3612 this action. It can lead to failures in several ways:
3614 Not every URLs with other URLs as parameters is evil. Some sites offer a
3615 real service that requires this information to work. For example a
3616 validation service needs to know, which document to validate.
3617 fast-redirects assumes that every URL parameter that looks like another URL
3618 is a redirection target, and will always redirect to the last one. Most of
3619 the time the assumption is correct, but if it isn't, the user gets
3622 Another failure occurs if the URL contains other parameters after the URL
3623 parameter. The URL: "http://www.example.org/?redirect=http%3a//
3624 www.example.net/&foo=bar". contains the redirection URL "http://
3625 www.example.net/", followed by another parameter. fast-redirects doesn't
3626 know that and will cause a redirect to "http://www.example.net/&foo=bar".
3627 Depending on the target server configuration, the parameter will be
3628 silently ignored or lead to a "page not found" error. You can prevent this
3629 problem by first using the redirect action to remove the last part of the
3630 URL, but it requires a little effort.
3632 To detect a redirection URL, fast-redirects only looks for the string
3633 "http://", either in plain text (invalid but often used) or encoded as
3634 "http%3a//". Some sites use their own URL encoding scheme, encrypt the
3635 address of the target server or replace it with a database id. In theses
3636 cases fast-redirects is fooled and the request reaches the redirection
3637 server where it probably gets logged.
3641 { +fast-redirects{simple-check} }
3644 { +fast-redirects{check-decoded-url} }
3645 another.example.com/testing
3648 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3654 Get rid of HTML and JavaScript annoyances, banner advertisements (by size),
3655 do fun text replacements, add personalized effects, etc.
3659 All instances of text-based type, most notably HTML and JavaScript, to
3660 which this action applies, can be filtered on-the-fly through the specified
3661 regular expression based substitutions. (Note: as of version 3.0.3 plain
3662 text documents are exempted from filtering, because web servers often use
3663 the text/plain MIME type for all files whose type they don't know.)
3671 The name of a content filter, as defined in the filter file. Filters can be
3672 defined in one or more files as defined by the filterfile option in the
3673 config file. default.filter is the collection of filters supplied by the
3674 developers. Locally defined filters should go in their own file, such as
3677 When used in its negative form, and without parameters, all filtering is
3678 completely disabled.
3682 For your convenience, there are a number of pre-defined filters available
3683 in the distribution filter file that you can use. See the examples below
3686 Filtering requires buffering the page content, which may appear to slow
3687 down page rendering since nothing is displayed until all content has passed
3688 the filters. (It does not really take longer, but seems that way since the
3689 page is not incrementally displayed.) This effect will be more noticeable
3690 on slower connections.
3692 "Rolling your own" filters requires a knowledge of "Regular Expressions"
3693 and "HTML". This is very powerful feature, and potentially very intrusive.
3694 Filters should be used with caution, and where an equivalent "action" is
3697 The amount of data that can be filtered is limited to the buffer-limit
3698 option in the main config file. The default is 4096 KB (4 Megs). Once this
3699 limit is exceeded, the buffered data, and all pending data, is passed
3702 Inappropriate MIME types, such as zipped files, are not filtered at all.
3703 (Again, only text-based types except plain text). Encrypted SSL data (from
3704 HTTPS servers) cannot be filtered either, since this would violate the
3705 integrity of the secure transaction. In some situations it might be
3706 necessary to protect certain text, like source code, from filtering by
3707 defining appropriate -filter exceptions.
3709 Compressed content can't be filtered either, unless Privoxy is compiled
3710 with zlib support (requires at least Privoxy 3.0.7), in which case Privoxy
3711 will decompress the content before filtering it.
3713 If you use a Privoxy version without zlib support, but want filtering to
3714 work on as much documents as possible, even those that would normally be
3715 sent compressed, you must use the prevent-compression action in conjunction
3718 Content filtering can achieve some of the same effects as the block action,
3719 i.e. it can be used to block ads and banners. But the mechanism works quite
3720 differently. One effective use, is to block ad banners based on their size
3721 (see below), since many of these seem to be somewhat standardized.
3723 Feedback with suggestions for new or improved filters is particularly
3726 The below list has only the names and a one-line description of each
3727 predefined filter. There are more verbose explanations of what these
3728 filters do in the filter file chapter.
3730 Example usage (with filters from the distribution default.filter file). See the
3731 Predefined Filters section for more explanation on each:
3733 +filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse
3736 +filter{js-events} # Kill all JS event bindings (Radically destructive! Only for extra nasty sites)
3739 +filter{html-annoyances} # Get rid of particularly annoying HTML abuse
3742 +filter{content-cookies} # Kill cookies that come in the HTML or JS content
3745 +filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups)
3748 +filter{unsolicited-popups} # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.
3751 +filter{all-popups} # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.
3754 +filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective
3757 +filter{banners-by-size} # Kill banners by size
3760 +filter{banners-by-link} # Kill banners by their links to known clicktrackers
3763 +filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking)
3766 +filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap
3769 +filter{jumping-windows} # Prevent windows from resizing and moving themselves
3772 +filter{frameset-borders} # Give frames a border and make them resizeable
3775 +filter{demoronizer} # Fix MS's non-standard use of standard charsets
3778 +filter{shockwave-flash} # Kill embedded Shockwave Flash objects
3781 +filter{quicktime-kioskmode} # Make Quicktime movies savable
3784 +filter{fun} # Text replacements for subversive browsing fun!
3787 +filter{crude-parental} # Crude parental filtering (demo only)
3790 +filter{ie-exploits} # Disable a known Internet Explorer bug exploits
3793 +filter{site-specifics} # Custom filters for specific site related problems
3796 +filter{google} # Removes text ads and other Google specific improvements
3799 +filter{yahoo} # Removes text ads and other Yahoo specific improvements
3802 +filter{msn} # Removes text ads and other MSN specific improvements
3805 +filter{blogspot} # Cleans up Blogspot blogs
3808 +filter{no-ping} # Removes non-standard ping attributes from anchor and area tags
3811 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3813 8.5.15. force-text-mode
3817 Force Privoxy to treat a document as if it was in some kind of text format.
3821 Declares a document as text, even if the "Content-Type:" isn't detected as
3834 As explained above, Privoxy tries to only filter files that are in some
3835 kind of text format. The same restrictions apply to content-type-overwrite.
3836 force-text-mode declares a document as text, without looking at the
3837 "Content-Type:" first.
3839 ┌─────────────────────────────────────────────────────────────────┐
3841 ├─────────────────────────────────────────────────────────────────┤
3842 │Think twice before activating this action. Filtering binary data │
3843 │with regular expressions can cause file damage. │
3844 └─────────────────────────────────────────────────────────────────┘
3851 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3853 8.5.16. forward-override
3857 Change the forwarding settings based on User-Agent or request origin
3861 Overrules the forward directives in the configuration file.
3869 □ "forward ." to use a direct connection without any additional proxies.
3871 □ "forward 127.0.0.1:8123" to use the HTTP proxy listening at 127.0.0.1
3874 □ "forward-socks4a 127.0.0.1:9050 ." to use the socks4a proxy listening
3875 at 127.0.0.1 port 9050. Replace "forward-socks4a" with "forward-socks4"
3876 to use a socks4 connection (with local DNS resolution) instead.
3878 □ "forward-socks4a 127.0.0.1:9050 proxy.example.org:8000" to use the
3879 socks4a proxy listening at 127.0.0.1 port 9050 to reach the HTTP proxy
3880 listening at proxy.example.org port 8000. Replace "forward-socks4a"
3881 with "forward-socks4" to use a socks4 connection (with local DNS
3882 resolution) instead.
3886 This action takes parameters similar to the forward directives in the
3887 configuration file, but without the URL pattern. It can be used as
3888 replacement, but normally it's only used in cases where matching based on
3889 the request URL isn't sufficient.
3891 ┌─────────────────────────────────────────────────────────────────┐
3893 ├─────────────────────────────────────────────────────────────────┤
3894 │Please read the description for the forward directives before │
3895 │using this action. Forwarding to the wrong people will reduce │
3896 │your privacy and increase the chances of man-in-the-middle │
3899 │If the ports are missing or invalid, default values will be used.│
3900 │This might change in the future and you shouldn't rely on it. │
3901 │Otherwise incorrect syntax causes Privoxy to exit. │
3903 │Use the show-url-info CGI page to verify that your forward │
3904 │settings do what you thought the do. │
3905 └─────────────────────────────────────────────────────────────────┘
3908 # Always use direct connections for requests previously tagged as
3909 # "User-Agent: fetch libfetch/2.0" and make sure
3910 # resuming downloads continues to work.
3911 # This way you can continue to use Tor for your normal browsing,
3912 # without overloading the Tor network with your FreeBSD ports updates
3913 # or downloads of bigger files like ISOs.
3914 # Note that HTTP headers are easy to fake and therefore their
3915 # values are as (un)trustworthy as your clients and users.
3916 {+forward-override{forward .} \
3917 -hide-if-modified-since \
3918 -overwrite-last-modified \
3920 TAG:^User-Agent: fetch libfetch/2\.0$
3924 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3926 8.5.17. handle-as-empty-document
3930 Mark URLs that should be replaced by empty documents if they get blocked
3934 This action alone doesn't do anything noticeable. It just marks URLs. If
3935 the block action also applies, the presence or absence of this mark decides
3936 whether an HTML "BLOCKED" page, or an empty document will be sent to the
3937 client as a substitute for the blocked content. The empty document isn't
3938 literally empty, but actually contains a single space.
3950 Some browsers complain about syntax errors if JavaScript documents are
3951 blocked with Privoxy's default HTML page; this option can be used to
3952 silence them. And of course this action can also be used to eliminate the
3953 Privoxy BLOCKED message in frames.
3955 The content type for the empty document can be specified with
3956 content-type-overwrite{}, but usually this isn't necessary.
3960 # Block all documents on example.org that end with ".js",
3961 # but send an empty document instead of the usual HTML message.
3962 {+block +handle-as-empty-document}
3967 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3969 8.5.18. handle-as-image
3973 Mark URLs as belonging to images (so they'll be replaced by images if they
3974 do get blocked, rather than HTML pages)
3978 This action alone doesn't do anything noticeable. It just marks URLs as
3979 images. If the block action also applies, the presence or absence of this
3980 mark decides whether an HTML "blocked" page, or a replacement image (as
3981 determined by the set-image-blocker action) will be sent to the client as a
3982 substitute for the blocked content.
3994 The below generic example section is actually part of default.action. It
3995 marks all URLs with well-known image file name extensions as images and
3996 should be left intact.
3998 Users will probably only want to use the handle-as-image action in
3999 conjunction with block, to block sources of banners, whose URLs don't
4000 reflect the file type, like in the second example section.
4002 Note that you cannot treat HTML pages as images in most cases. For
4003 instance, (in-line) ad frames require an HTML page to be sent, or they
4004 won't display properly. Forcing handle-as-image in this situation will not
4005 replace the ad frame with an image, but lead to error messages.
4007 Example usage (sections):
4009 # Generic image extensions:
4012 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
4014 # These don't look like images, but they're banners and should be
4015 # blocked as images:
4017 {+block +handle-as-image}
4018 some.nasty-banner-server.com/junk.cgi\?output=trash
4020 # Banner source! Who cares if they also have non-image content?
4024 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4026 8.5.19. hide-accept-language
4030 Pretend to use different language settings.
4034 Deletes or replaces the "Accept-Language:" HTTP header in client requests.
4042 Keyword: "block", or any user defined value.
4046 Faking the browser's language settings can be useful to make a foreign
4047 User-Agent set with hide-user-agent more believable.
4049 However some sites with content in different languages check the
4050 "Accept-Language:" to decide which one to take by default. Sometimes it
4051 isn't possible to later switch to another language without changing the
4052 "Accept-Language:" header first.
4054 Therefore it's a good idea to either only change the "Accept-Language:"
4055 header to languages you understand, or to languages that aren't wide
4058 Before setting the "Accept-Language:" header to a rare language, you should
4059 consider that it helps to make your requests unique and thus easier to
4060 trace. If you don't plan to change this header frequently, you should stick
4061 to a common language.
4063 Example usage (section):
4065 # Pretend to use Canadian language settings.
4066 {+hide-accept-language{en-ca} \
4067 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
4072 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4074 8.5.20. hide-content-disposition
4078 Prevent download menus for content you prefer to view inside the browser.
4082 Deletes or replaces the "Content-Disposition:" HTTP header set by some
4091 Keyword: "block", or any user defined value.
4095 Some servers set the "Content-Disposition:" HTTP header for documents they
4096 assume you want to save locally before viewing them. The
4097 "Content-Disposition:" header contains the file name the browser is
4098 supposed to use by default.
4100 In most browsers that understand this header, it makes it impossible to
4101 just view the document, without downloading it first, even if it's just a
4102 simple text file or an image.
4104 Removing the "Content-Disposition:" header helps to prevent this annoyance,
4105 but some browsers additionally check the "Content-Type:" header, before
4106 they decide if they can display a document without saving it first. In
4107 these cases, you have to change this header as well, before the browser
4108 stops displaying download menus.
4110 It is also possible to change the server's file name suggestion to another
4111 one, but in most cases it isn't worth the time to set it up.
4113 This action will probably be removed in the future, use server-header
4118 # Disarm the download link in Sourceforge's patch tracker
4120 +content-type-overwrite{text/plain}\
4121 +hide-content-disposition{block} }
4122 .sourceforge.net/tracker/download\.php
4125 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4127 8.5.21. hide-if-modified-since
4131 Prevent yet another way to track the user's steps between sessions.
4135 Deletes the "If-Modified-Since:" HTTP client header or modifies its value.
4143 Keyword: "block", or a user defined value that specifies a range of hours.
4147 Removing this header is useful for filter testing, where you want to force
4148 a real reload instead of getting status code "304", which would cause the
4149 browser to use a cached copy of the page.
4151 Instead of removing the header, hide-if-modified-since can also add or
4152 subtract a random amount of time to/from the header's value. You specify a
4153 range of minutes where the random factor should be chosen from and Privoxy
4154 does the rest. A negative value means subtracting, a positive value adding.
4156 Randomizing the value of the "If-Modified-Since:" makes it less likely that
4157 the server can use the time as a cookie replacement, but you will run into
4158 caching problems if the random range is too high.
4160 It is a good idea to only use a small negative value and let
4161 overwrite-last-modified handle the greater changes.
4163 It is also recommended to use this action together with
4164 crunch-if-none-match, otherwise it's more or less pointless.
4166 Example usage (section):
4168 # Let the browser revalidate but make tracking based on the time less likely.
4169 {+hide-if-modified-since{-60} \
4170 +overwrite-last-modified{randomize} \
4171 +crunch-if-none-match}
4175 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4177 8.5.22. hide-forwarded-for-headers
4181 Improve privacy by not forwarding the source of the request in the HTTP
4186 Deletes any existing "X-Forwarded-for:" HTTP header from client requests.
4198 It is safe and recommended to leave this on.
4202 +hide-forwarded-for-headers
4205 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4207 8.5.23. hide-from-header
4211 Keep your (old and ill) browser from telling web servers your email address
4215 Deletes any existing "From:" HTTP header, or replaces it with the specified
4224 Keyword: "block", or any user defined value.
4228 The keyword "block" will completely remove the header (not to be confused
4229 with the block action).
4231 Alternately, you can specify any value you prefer to be sent to the web
4232 server. If you do, it is a matter of fairness not to use any address that
4233 is actually used by a real person.
4235 This action is rarely needed, as modern web browsers don't send "From:"
4240 +hide-from-header{block}
4245 +hide-from-header{spam-me-senseless@sittingduck.example.com}
4248 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4250 8.5.24. hide-referrer
4254 Conceal which link you followed to get to a particular site
4258 Deletes the "Referer:" (sic) HTTP header from the client request, or
4259 replaces it with a forged one.
4267 □ "conditional-block" to delete the header completely if the host has
4270 □ "conditional-forge" to forge the header if the host has changed.
4272 □ "block" to delete the header unconditionally.
4274 □ "forge" to pretend to be coming from the homepage of the server we are
4277 □ Any other string to set a user defined referrer.
4281 conditional-block is the only parameter, that isn't easily detected in the
4282 server's log file. If it blocks the referrer, the request will look like
4283 the visitor used a bookmark or typed in the address directly.
4285 Leaving the referrer unmodified for requests on the same host allows the
4286 server owner to see the visitor's "click path", but in most cases she could
4287 also get that information by comparing other parts of the log file: for
4288 example the User-Agent if it isn't a very common one, or the user's IP
4289 address if it doesn't change between different requests.
4291 Always blocking the referrer, or using a custom one, can lead to failures
4292 on servers that check the referrer before they answer any requests, in an
4293 attempt to prevent their content from being embedded or linked to
4296 Both conditional-block and forge will work with referrer checks, as long as
4297 content and valid referring page are on the same host. Most of the time
4300 hide-referer is an alternate spelling of hide-referrer and the two can be
4301 can be freely substituted with each other. ("referrer" is the correct
4302 English spelling, however the HTTP specification has a bug - it requires it
4303 to be spelled as "referer".)
4307 +hide-referrer{forge}
4312 +hide-referrer{http://www.yahoo.com/}
4315 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4317 8.5.25. hide-user-agent
4321 Try to conceal your type of browser and client operating system
4325 Replaces the value of the "User-Agent:" HTTP header in client requests with
4326 the specified value.
4334 Any user-defined string.
4338 ┌─────────────────────────────────────────────────────────────────┐
4340 ├─────────────────────────────────────────────────────────────────┤
4341 │This can lead to problems on web sites that depend on looking at │
4342 │this header in order to customize their content for different │
4343 │browsers (which, by the way, is NOT the right thing to do: good │
4344 │web sites work browser-independently). │
4345 └─────────────────────────────────────────────────────────────────┘
4347 Using this action in multi-user setups or wherever different types of
4348 browsers will access the same Privoxy is not recommended. In single-user,
4349 single-browser setups, you might use it to delete your OS version
4350 information from the headers, because it is an invitation to exploit known
4351 bugs for your OS. It is also occasionally useful to forge this in order to
4352 access sites that won't let you in otherwise (though there may be a good
4353 reason in some cases). Example of this: some MSN sites will not let Mozilla
4354 enter, yet forging to a Netscape 6.1 user-agent works just fine. (Must be
4355 just a silly MS goof, I'm sure :-).
4357 More information on known user-agent strings can be found at http://
4358 www.user-agents.org/ and http://en.wikipedia.org/wiki/User_agent.
4362 +hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}
4365 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4367 8.5.26. inspect-jpegs
4371 Try to protect against a MS buffer over-run in JPEG processing
4375 Protect against a known exploit
4387 See Microsoft Security Bulletin MS04-028. JPEG images are one of the most
4388 common image types found across the Internet. The exploit as described can
4389 allow execution of code on the target system, giving an attacker access to
4390 the system in question by merely planting an altered JPEG image, which
4391 would have no obvious indications of what lurks inside. This action tries
4392 to prevent this exploit if delivered through unencrypted HTTP.
4394 Note that the exploit mentioned is several years old and it's unlikely that
4395 your client is still vulnerable against it. This action may be removed in
4396 one of the next releases.
4403 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4409 Eliminate those annoying pop-up windows (deprecated)
4413 While loading the document, replace JavaScript code that opens pop-up
4414 windows with (syntactically neutral) dummy code on the fly.
4426 This action is basically a built-in, hardwired special-purpose filter
4427 action, but there are important differences: For kill-popups, the document
4428 need not be buffered, so it can be incrementally rendered while
4429 downloading. But kill-popups doesn't catch as many pop-ups as filter
4430 {all-popups} does and is not as smart as filter{unsolicited-popups} is.
4432 Think of it as a fast and efficient replacement for a filter that you can
4433 use if you don't want any filtering at all. Note that it doesn't make sense
4434 to combine it with any filter action, since as soon as one filter applies,
4435 the whole document needs to be buffered anyway, which destroys the
4436 advantage of the kill-popups action over its filter equivalent.
4438 Killing all pop-ups unconditionally is problematic. Many shops and banks
4439 rely on pop-ups to display forms, shopping carts etc, and the filter
4440 {unsolicited-popups} does a better job of catching only the unwanted ones.
4442 If the only kind of pop-ups that you want to kill are exit consoles (those
4443 really nasty windows that appear when you close an other one), you might
4444 want to use filter{js-annoyances} instead.
4446 This action is most appropriate for browsers that don't have any controls
4447 for unwanted pop-ups. Not recommended for general usage.
4449 This action doesn't work very reliable and may be removed in future
4457 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4459 8.5.28. limit-connect
4463 Prevent abuse of Privoxy as a TCP proxy relay or disable SSL for untrusted
4468 Specifies to which ports HTTP CONNECT requests are allowable.
4476 A comma-separated list of ports or port ranges (the latter using dashes,
4477 with the minimum defaulting to 0 and the maximum to 65K).
4481 By default, i.e. if no limit-connect action applies, Privoxy only allows
4482 HTTP CONNECT requests to port 443 (the standard, secure HTTPS port). Use
4483 limit-connect if more fine-grained control is desired for some or all
4486 The CONNECT methods exists in HTTP to allow access to secure websites
4487 ("https://" URLs) through proxies. It works very simply: the proxy connects
4488 to the server on the specified port, and then short-circuits its
4489 connections to the client and to the remote server. This means
4490 CONNECT-enabled proxies can be used as TCP relays very easily.
4492 Privoxy relays HTTPS traffic without seeing the decoded content. Websites
4493 can leverage this limitation to circumvent Privoxy's filters. By specifying
4494 an invalid port range you can disable HTTPS entirely. If you plan to
4495 disable SSL by default, consider enabling
4496 treat-forbidden-connects-like-blocks as well, to be able to quickly create
4501 +limit-connect{443} # This is the default and need not be specified.
4502 +limit-connect{80,443} # Ports 80 and 443 are OK.
4503 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
4504 +limit-connect{-} # All ports are OK
4505 +limit-connect{,} # No HTTPS/SSL traffic is allowed
4508 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4510 8.5.29. prevent-compression
4514 Ensure that servers send the content uncompressed, so it can be passed
4519 Removes the Accept-Encoding header which can be used to ask for compressed
4532 More and more websites send their content compressed by default, which is
4533 generally a good idea and saves bandwidth. But the filter, deanimate-gifs
4534 and kill-popups actions need access to the uncompressed data.
4536 When compiled with zlib support (available since Privoxy 3.0.7), content
4537 that should be filtered is decompressed on-the-fly and you don't have to
4538 worry about this action. If you are using an older Privoxy version, or one
4539 that hasn't been compiled with zlib support, this action can be used to
4540 convince the server to send the content uncompressed.
4542 Most text-based instances compress very well, the size is seldom decreased
4543 by less than 50%, for markup-heavy instances like news feeds saving more
4544 than 90% of the original size isn't unusual.
4546 Not using compression will therefore slow down the transfer, and you should
4547 only enable this action if you really need it. As of Privoxy 3.0.7 it's
4548 disabled in all predefined action settings.
4550 Note that some (rare) ill-configured sites don't handle requests for
4551 uncompressed documents correctly. Broken PHP applications tend to send an
4552 empty document body, some IIS versions only send the beginning of the
4553 content. If you enable prevent-compression per default, you might want to
4554 add exceptions for those sites. See the example for how to do that.
4556 Example usage (sections):
4558 # Selectively turn off compression, and enable a filter
4560 { +filter{tiny-textforms} +prevent-compression }
4561 # Match only these sites
4566 # Or instead, we could set a universal default:
4568 { +prevent-compression }
4571 # Then maybe make exceptions for broken sites:
4573 { -prevent-compression }
4577 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4579 8.5.30. overwrite-last-modified
4583 Prevent yet another way to track the user's steps between sessions.
4587 Deletes the "Last-Modified:" HTTP server header or modifies its value.
4595 One of the keywords: "block", "reset-to-request-time" and "randomize"
4599 Removing the "Last-Modified:" header is useful for filter testing, where
4600 you want to force a real reload instead of getting status code "304", which
4601 would cause the browser to reuse the old version of the page.
4603 The "randomize" option overwrites the value of the "Last-Modified:" header
4604 with a randomly chosen time between the original value and the current
4605 time. In theory the server could send each document with a different
4606 "Last-Modified:" header to track visits without using cookies. "Randomize"
4607 makes it impossible and the browser can still revalidate cached documents.
4609 "reset-to-request-time" overwrites the value of the "Last-Modified:" header
4610 with the current time. You could use this option together with
4611 hided-if-modified-since to further customize your random range.
4613 The preferred parameter here is "randomize". It is safe to use, as long as
4614 the time settings are more or less correct. If the server sets the
4615 "Last-Modified:" header to the time of the request, the random range
4616 becomes zero and the value stays the same. Therefore you should later
4617 randomize it a second time with hided-if-modified-since, just to be sure.
4619 It is also recommended to use this action together with
4620 crunch-if-none-match.
4624 # Let the browser revalidate without being tracked across sessions
4625 { +hide-if-modified-since{-60} \
4626 +overwrite-last-modified{randomize} \
4627 +crunch-if-none-match}
4631 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4637 Redirect requests to other sites.
4641 Convinces the browser that the requested document has been moved to another
4642 location and the browser should get it from there.
4650 An absolute URL or a single pcrs command.
4654 Requests to which this action applies are answered with a HTTP redirect to
4655 URLs of your choosing. The new URL is either provided as parameter, or
4656 derived by applying a single pcrs command to the original URL.
4658 This action will be ignored if you use it together with block. It can be
4659 combined with fast-redirects{check-decoded-url} to redirect to a decoded
4660 version of a rewritten URL.
4662 Use this action carefully, make sure not to create redirection loops and be
4663 aware that using your own redirects might make it possible to fingerprint
4668 # Replace example.com's style sheet with another one
4669 { +redirect{http://localhost/css-replacements/example.com.css} }
4670 example.com/stylesheet\.css
4672 # Create a short, easy to remember nickname for a favorite site
4673 # (relies on the browser accept and forward invalid URLs to Privoxy)
4674 { +redirect{http://www.privoxy.org/user-manual/actions-file.html} }
4677 # Always use the expanded view for Undeadly.org articles
4678 # (Note the $ at the end of the URL pattern to make sure
4679 # the request for the rewritten URL isn't redirected as well)
4680 {+redirect{s@$@&mode=expanded@}}
4681 undeadly.org/cgi\?action=article&sid=\d*$
4684 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4686 8.5.32. send-vanilla-wafer
4690 Feed log analysis scripts with useless data.
4694 Sends a cookie with each request stating that you do not accept any
4695 copyright on cookies sent to you, and asking the site operator not to track
4708 The vanilla wafer is a (relatively) unique header and could conceivably be
4711 This action is rarely used and not enabled in the default configuration.
4718 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4724 Send custom cookies or feed log analysis scripts with even more useless
4729 Sends a custom, user-defined cookie with each request.
4737 A string of the form "name=value".
4741 Being multi-valued, multiple instances of this action can apply to the same
4742 request, resulting in multiple cookies being sent.
4744 This action is rarely used and not enabled in the default configuration.
4746 Example usage (section):
4748 {+send-wafer{UsingPrivoxy=true}}
4749 my-internal-testing-server.void
4752 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4754 8.5.34. server-header-filter
4758 Rewrite or remove single server headers.
4762 All server headers to which this action applies are filtered on-the-fly
4763 through the specified regular expression based substitutions.
4771 The name of a server-header filter, as defined in one of the filter files.
4775 Server-header filters are applied to each header on its own, not to all at
4776 once. This makes it easier to diagnose problems, but on the downside you
4777 can't write filters that only change header x if header y's value is z. You
4778 can do that by using tags though.
4780 Server-header filters are executed after the other header actions have
4781 finished and use their output as input.
4783 Please refer to the filter file chapter to learn which server-header
4784 filters are available by default, and how to create your own.
4786 Example usage (section):
4788 {+server-header-filter{html-to-xml}}
4789 example.org/xml-instance-that-is-delivered-as-html
4791 {+server-header-filter{xml-to-html}}
4792 example.org/instance-that-is-delivered-as-xml-but-is-not
4796 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4798 8.5.35. server-header-tagger
4802 Enable or disable filters based on the Content-Type header.
4806 Server headers to which this action applies are filtered on-the-fly through
4807 the specified regular expression based substitutions, the result is used as
4816 The name of a server-header tagger, as defined in one of the filter files.
4820 Server-header taggers are applied to each header on its own, and as the
4821 header isn't modified, each tagger "sees" the original.
4823 Server-header taggers are executed before all other header actions that
4824 modify server headers. Their tags can be used to control all of the other
4825 server-header actions, the content filters and the crunch actions (redirect
4828 Obviously crunching based on tags created by server-header taggers doesn't
4829 prevent the request from showing up in the server's log file.
4831 Example usage (section):
4833 # Tag every request with the content type declared by the server
4834 {+server-header-tagger{content-type}}
4839 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4841 8.5.36. session-cookies-only
4845 Allow only temporary "session" cookies (for the current browser session
4850 Deletes the "expires" field from "Set-Cookie:" server headers. Most
4851 browsers will not store such cookies permanently and forget them in between
4864 This is less strict than crunch-incoming-cookies / crunch-outgoing-cookies
4865 and allows you to browse websites that insist or rely on setting cookies,
4866 without compromising your privacy too badly.
4868 Most browsers will not permanently store cookies that have been processed
4869 by session-cookies-only and will forget about them between sessions. This
4870 makes profiling cookies useless, but won't break sites which require
4871 cookies so that you can log in for transactions. This is generally turned
4872 on for all sites, and is the recommended setting.
4874 It makes no sense at all to use session-cookies-only together with
4875 crunch-incoming-cookies or crunch-outgoing-cookies. If you do, cookies will
4878 Note that it is up to the browser how it handles such cookies without an
4879 "expires" field. If you use an exotic browser, you might want to try it out
4882 This setting also has no effect on cookies that may have been stored
4883 previously by the browser before starting Privoxy. These would have to be
4886 Privoxy also uses the content-cookies filter to block some types of
4887 cookies. Content cookies are not effected by session-cookies-only.
4891 +session-cookies-only
4894 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4896 8.5.37. set-image-blocker
4900 Choose the replacement for blocked images
4904 This action alone doesn't do anything noticeable. If both block and
4905 handle-as-image also apply, i.e. if the request is to be blocked as an
4906 image, then the parameter of this action decides what will be sent as a
4915 □ "pattern" to send a built-in checkerboard pattern image. The image is
4916 visually decent, scales very well, and makes it obvious where banners
4919 □ "blank" to send a built-in transparent image. This makes banners
4920 disappear completely, but makes it hard to detect where Privoxy has
4921 blocked images on a given page and complicates troubleshooting if
4922 Privoxy has blocked innocent images, like navigation icons.
4924 □ "target-url" to send a redirect to target-url. You can redirect to any
4925 image anywhere, even in your local filesystem via "file:///" URL. (But
4926 note that not all browsers support redirecting to a local file system).
4928 A good application of redirects is to use special Privoxy-built-in
4929 URLs, which send the built-in images, as target-url. This has the same
4930 visual effect as specifying "blank" or "pattern" in the first place,
4931 but enables your browser to cache the replacement image, instead of
4932 requesting it over and over again.
4936 The URLs for the built-in images are "http://config.privoxy.org/
4937 send-banner?type=type", where type is either "blank" or "pattern".
4939 There is a third (advanced) type, called "auto". It is NOT to be used in
4940 set-image-blocker, but meant for use from filters. Auto will select the
4941 type of image that would have applied to the referring page, had it been an
4948 +set-image-blocker{pattern}
4951 Redirect to the BSD daemon:
4953 +set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}
4956 Redirect to the built-in pattern for better caching:
4958 +set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}
4961 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4963 8.5.38. treat-forbidden-connects-like-blocks
4967 Block forbidden connects with an easy to find error message.
4971 If this action is enabled, Privoxy no longer makes a difference between
4972 forbidden connects and ordinary blocks.
4984 By default Privoxy answers forbidden "Connect" requests with a short error
4985 message inside the headers. If the browser doesn't display headers (most
4986 don't), you just see an empty page.
4988 With this action enabled, Privoxy displays the message that is used for
4989 ordinary blocks instead. If you decide to make an exception for the page in
4990 question, you can do so by following the "See why" link.
4992 For "Connect" requests the clients tell Privoxy which host they are
4993 interested in, but not which document they plan to get later. As a result,
4994 the "Go there anyway" wouldn't work and is therefore suppressed.
4998 +treat-forbidden-connects-like-blocks
5001 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5005 Note that many of these actions have the potential to cause a page to
5006 misbehave, possibly even not to display at all. There are many ways a site
5007 designer may choose to design his site, and what HTTP header content, and other
5008 criteria, he may depend on. There is no way to have hard and fast rules for all
5009 sites. See the Appendix for a brief example on troubleshooting actions.
5011 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5015 Custom "actions", known to Privoxy as "aliases", can be defined by combining
5016 other actions. These can in turn be invoked just like the built-in actions.
5017 Currently, an alias name can contain any character except space, tab, "=", "{"
5018 and "}", but we strongly recommend that you only use "a" to "z", "0" to "9",
5019 "+", and "-". Alias names are not case sensitive, and are not required to start
5020 with a "+" or "-" sign, since they are merely textually expanded.
5022 Aliases can be used throughout the actions file, but they must be defined in a
5023 special section at the top of the file! And there can only be one such section
5024 per actions file. Each actions file may have its own alias section, and the
5025 aliases defined in it are only visible within that file.
5027 There are two main reasons to use aliases: One is to save typing for frequently
5028 used combinations of actions, the other one is a gain in flexibility: If you
5029 decide once how you want to handle shops by defining an alias called "shop",
5030 you can later change your policy on shops in one place, and your changes will
5031 take effect everywhere in the actions file where the "shop" alias is used.
5032 Calling aliases by their purpose also makes your actions files more readable.
5034 Currently, there is one big drawback to using aliases, though: Privoxy's
5035 built-in web-based action file editor honors aliases when reading the actions
5036 files, but it expands them before writing. So the effects of your aliases are
5037 of course preserved, but the aliases themselves are lost when you edit sections
5038 that use aliases with it.
5040 Now let's define some aliases...
5042 # Useful custom aliases we can use later.
5044 # Note the (required!) section header line and that this section
5045 # must be at the top of the actions file!
5049 # These aliases just save typing later:
5050 # (Note that some already use other aliases!)
5052 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
5053 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
5054 +block-as-image = +block +handle-as-image
5055 allow-all-cookies = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
5057 # These aliases define combinations of actions
5058 # that are useful for certain types of sites:
5060 fragile = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -kill-popups -prevent-compression
5062 shop = -crunch-all-cookies -filter{all-popups} -kill-popups
5064 # Short names for other aliases, for really lazy people ;-)
5066 c0 = +crunch-all-cookies
5067 c1 = -crunch-all-cookies
5070 ...and put them to use. These sections would appear in the lower part of an
5071 actions file and define exceptions to the default actions (as specified further
5072 up for the "/" pattern):
5074 # These sites are either very complex or very keen on
5075 # user data and require minimal interference to work:
5078 .office.microsoft.com
5079 .windowsupdate.microsoft.com
5080 # Gmail is really mail.google.com, not gmail.com
5084 # Allow cookies (for setting and retrieving your customer data)
5088 .worldpay.com # for quietpc.com
5091 # These shops require pop-ups:
5093 {-kill-popups -filter{all-popups} -filter{unsolicited-popups}}
5098 Aliases like "shop" and "fragile" are typically used for "problem" sites that
5099 require more than one action to be disabled in order to function properly.
5101 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5103 8.7. Actions Files Tutorial
5105 The above chapters have shown which actions files there are and how they are
5106 organized, how actions are specified and applied to URLs, how patterns work,
5107 and how to define and use aliases. Now, let's look at an example default.action
5108 and user.action file and see how all these pieces come together:
5110 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5112 8.7.1. default.action
5114 Every config file should start with a short comment stating its purpose:
5116 # Sample default.action file <ijbswa-developers@lists.sourceforge.net>
5119 Then, since this is the default.action file, the first section is a special
5120 section for internal use that you needn't change or worry about:
5122 ##########################################################################
5123 # Settings -- Don't change! For internal Privoxy use ONLY.
5124 ##########################################################################
5127 for-privoxy-version=3.0
5130 After that comes the (optional) alias section. We'll use the example section
5131 from the above chapter on aliases, that also explains why and how aliases are
5134 ##########################################################################
5136 ##########################################################################
5139 # These aliases just save typing later:
5140 # (Note that some already use other aliases!)
5142 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
5143 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
5144 +block-as-image = +block +handle-as-image
5145 mercy-for-cookies = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
5147 # These aliases define combinations of actions
5148 # that are useful for certain types of sites:
5150 fragile = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -kill-popups
5151 shop = -crunch-all-cookies -filter{all-popups} -kill-popups
5154 Now come the regular sections, i.e. sets of actions, accompanied by URL
5155 patterns to which they apply. Remember all actions are disabled when matching
5156 starts, so we have to explicitly enable the ones we want.
5158 The first regular section is probably the most important. It has only one
5159 pattern, "/", but this pattern matches all URLs. Therefore, the set of actions
5160 used in this "default" section will be applied to all requests as a start. It
5161 can be partly or wholly overridden by later matches further down this file, or
5162 in user.action, but it will still be largely responsible for your overall
5163 browsing experience.
5165 Again, at the start of matching, all actions are disabled, so there is no need
5166 to disable any actions here. (Remember: a "+" preceding the action name enables
5167 the action, a "-" disables!). Also note how this long line has been made more
5168 readable by splitting it into multiple lines with line continuation.
5170 ##########################################################################
5171 # "Defaults" section:
5172 ##########################################################################
5175 +filter{html-annoyances} \
5176 +filter{refresh-tags} \
5178 +filter{ie-exploits} \
5179 +hide-forwarded-for-headers \
5180 +hide-from-header{block} \
5181 +hide-referrer{forge} \
5182 +prevent-compression \
5183 +session-cookies-only \
5184 +set-image-blocker{pattern} \
5186 / # forward slash will match *all* potential URL patterns.
5189 The default behavior is now set.
5191 The first of our specialized sections is concerned with "fragile" sites, i.e.
5192 sites that require minimum interference, because they are either very complex
5193 or very keen on tracking you (and have mechanisms in place that make them
5194 unusable for people who avoid being tracked). We will simply use our
5195 pre-defined fragile alias instead of stating the list of actions explicitly:
5197 ##########################################################################
5198 # Exceptions for sites that'll break under the default action set:
5199 ##########################################################################
5201 # "Fragile" Use a minimum set of actions for these sites (see alias above):
5204 .office.microsoft.com # surprise, surprise!
5205 .windowsupdate.microsoft.com
5209 Shopping sites are not as fragile, but they typically require cookies to log
5210 in, and pop-up windows for shopping carts or item details. Again, we'll use a
5217 .worldpay.com # for quietpc.com
5222 The fast-redirects action, which we enabled per default above, breaks some
5223 sites. So disable it for popular sites where we know it misbehaves:
5229 .altavista.com/.*(like|url|link):http
5230 .altavista.com/trans.*urltext=http
5234 It is important that Privoxy knows which URLs belong to images, so that if they
5235 are to be blocked, a substitute image can be sent, rather than an HTML page.
5236 Contacting the remote site to find out is not an option, since it would destroy
5237 the loading time advantage of banner blocking, and it would feed the
5238 advertisers (in terms of money and information). We can mark any URL as an
5239 image with the handle-as-image action, and marking all URLs that end in a known
5240 image file extension is a good start:
5242 ##########################################################################
5244 ##########################################################################
5246 # Define which file types will be treated as images, in case they get
5247 # blocked further down this file:
5249 { +handle-as-image }
5250 /.*\.(gif|jpe?g|png|bmp|ico)$
5253 And then there are known banner sources. They often use scripts to generate the
5254 banners, so it won't be visible from the URL that the request is for an image.
5255 Hence we block them and mark them as images in one go, with the help of our
5256 +block-as-image alias defined above. (We could of course just as well use +
5257 block +handle-as-image here.) Remember that the type of the replacement image
5258 is chosen by the set-image-blocker action. Since all URLs have matched the
5259 default section with its +set-image-blocker{pattern} action before, it still
5260 applies and needn't be repeated:
5262 # Known ad generators:
5267 .ad.*.doubleclick.net
5268 .a.yimg.com/(?:(?!/i/).)*$
5269 .a[0-9].yimg.com/(?:(?!/i/).)*$
5274 One of the most important jobs of Privoxy is to block banners. Many of these
5275 can be "blocked" by the filter{banners-by-size} action, which we enabled above,
5276 and which deletes the references to banner images from the pages while they are
5277 loaded, so the browser doesn't request them anymore, and hence they don't need
5278 to be blocked here. But this naturally doesn't catch all banners, and some
5279 people choose not to use filters, so we need a comprehensive list of patterns
5280 for banner URLs here, and apply the block action to them.
5282 First comes many generic patterns, which do most of the work, by matching
5283 typical domain and path name components of banners. Then comes a list of
5284 individual patterns for specific sites, which is omitted here to keep the
5287 ##########################################################################
5288 # Block these fine banners:
5289 ##########################################################################
5298 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
5299 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
5301 # Site-specific patterns (abbreviated):
5306 It's quite remarkable how many advertisers actually call their banner servers
5307 ads.company.com, or call the directory in which the banners are stored simply
5308 "banners". So the above generic patterns are surprisingly effective.
5310 But being very generic, they necessarily also catch URLs that we don't want to
5311 block. The pattern .*ads. e.g. catches "nasty-ads.nasty-corp.com" as intended,
5312 but also "downloads.sourcefroge.net" or "adsl.some-provider.net." So here come
5313 some well-known exceptions to the +block section above.
5315 Note that these are exceptions to exceptions from the default! Consider the URL
5316 "downloads.sourcefroge.net": Initially, all actions are deactivated, so it
5317 wouldn't get blocked. Then comes the defaults section, which matches the URL,
5318 but just deactivates the block action once again. Then it matches .*ads., an
5319 exception to the general non-blocking policy, and suddenly +block applies. And
5320 now, it'll match .*loads., where -block applies, so (unless it matches again
5321 further down) it ends up with no block action applying.
5323 ##########################################################################
5324 # Save some innocent victims of the above generic block patterns:
5325 ##########################################################################
5330 adv[io]*. # (for advogato.org and advice.*)
5331 adsl. # (has nothing to do with ads)
5332 adobe. # (has nothing to do with ads either)
5333 ad[ud]*. # (adult.* and add.*)
5334 .edu # (universities don't host banners (yet!))
5335 .*loads. # (downloads, uploads etc)
5343 www.globalintersec.com/adv # (adv = advanced)
5344 www.ugu.com/sui/ugu/adv
5347 Filtering source code can have nasty side effects, so make an exception for our
5348 friends at sourceforge.net, and all paths with "cvs" in them. Note that -filter
5349 disables all filters in one fell swoop!
5351 # Don't filter code!
5361 The actual default.action is of course much more comprehensive, but we hope
5362 this example made clear how it works.
5364 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5368 So far we are painting with a broad brush by setting general policies, which
5369 would be a reasonable starting point for many people. Now, you might want to be
5370 more specific and have customized rules that are more suitable to your personal
5371 habits and preferences. These would be for narrowly defined situations like
5372 your ISP or your bank, and should be placed in user.action, which is parsed
5373 after all other actions files and hence has the last word, over-riding any
5374 previously defined actions. user.action is also a safe place for your personal
5375 settings, since default.action is actively maintained by the Privoxy developers
5376 and you'll probably want to install updated versions from time to time.
5378 So let's look at a few examples of things that one might typically do in
5381 # My user.action file. <fred@example.com>
5384 As aliases are local to the actions file that they are defined in, you can't
5385 use the ones from default.action, unless you repeat them here:
5387 # Aliases are local to the file they are defined in.
5388 # (Re-)define aliases for this file:
5392 # These aliases just save typing later, and the alias names should
5393 # be self explanatory.
5395 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
5396 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
5397 allow-all-cookies = -crunch-all-cookies -session-cookies-only
5398 allow-popups = -filter{all-popups} -kill-popups
5399 +block-as-image = +block +handle-as-image
5400 -block-as-image = -block
5402 # These aliases define combinations of actions that are useful for
5403 # certain types of sites:
5405 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer -kill-popups
5406 shop = -crunch-all-cookies allow-popups
5408 # Allow ads for selected useful free sites:
5410 allow-ads = -block -filter{banners-by-size} -filter{banners-by-link}
5412 # Alias for specific file types that are text, but might have conflicting
5413 # MIME types. We want the browser to force these to be text documents.
5414 handle-as-text = -filter +-content-type-overwrite{text/plain} +-force-text-mode -hide-content-disposition
5419 Say you have accounts on some sites that you visit regularly, and you don't
5420 want to have to log in manually each time. So you'd like to allow persistent
5421 cookies for these sites. The allow-all-cookies alias defined above does exactly
5422 that, i.e. it disables crunching of cookies in any direction, and the
5423 processing of cookies to make them only temporary.
5425 { allow-all-cookies }
5432 Your bank is allergic to some filter, but you don't know which, so you disable
5436 .your-home-banking-site.com
5439 Some file types you may not want to filter for various reasons:
5441 # Technical documentation is likely to contain strings that might
5442 # erroneously get altered by the JavaScript-oriented filters:
5447 # And this stupid host sends streaming video with a wrong MIME type,
5448 # so that Privoxy thinks it is getting HTML and starts filtering:
5450 stupid-server.example.com/
5453 Example of a simple block action. Say you've seen an ad on your favourite page
5454 on example.com that you want to get rid of. You have right-clicked the image,
5455 selected "copy image location" and pasted the URL below while removing the
5456 leading http://, into a { +block } section. Note that { +handle-as-image } need
5457 not be specified, since all URLs ending in .gif will be tagged as images by the
5458 general rules as set in default.action anyway:
5461 www.example.com/nasty-ads/sponsor\.gif
5462 another.example.net/more/junk/here/
5465 The URLs of dynamically generated banners, especially from large banner farms,
5466 often don't use the well-known image file name extensions, which makes it
5467 impossible for Privoxy to guess the file type just by looking at the URL. You
5468 can use the +block-as-image alias defined above for these cases. Note that
5469 objects which match this rule but then turn out NOT to be an image are
5470 typically rendered as a "broken image" icon by the browser. Use cautiously.
5479 Now you noticed that the default configuration breaks Forbes Magazine, but you
5480 were too lazy to find out which action is the culprit, and you were again too
5481 lazy to give feedback, so you just used the fragile alias on the site, and --
5482 whoa! -- it worked. The fragile aliases disables those actions that are most
5483 likely to break a site. Also, good for testing purposes to see if it is Privoxy
5484 that is causing the problem or not. We later find other regular sites that
5485 misbehave, and add those to our personalized list of troublemakers:
5493 You like the "fun" text replacements in default.filter, but it is disabled in
5494 the distributed actions file. So you'd like to turn it on in your private,
5495 update-safe config, once and for all:
5501 Note that the above is not really a good idea: There are exceptions to the
5502 filters in default.action for things that really shouldn't be filtered, like
5503 code on CVS->Web interfaces. Since user.action has the last word, these
5504 exceptions won't be valid for the "fun" filtering specified here.
5506 You might also worry about how your favourite free websites are funded, and
5507 find that they rely on displaying banner advertisements to survive. So you
5508 might want to specifically allow banners for those sites that you feel provide
5517 Note that allow-ads has been aliased to -block, -filter{banners-by-size}, and -
5518 filter{banners-by-link} above.
5520 Invoke another alias here to force an over-ride of the MIME type application/
5521 x-sh which typically would open a download type dialog. In my case, I want to
5522 look at the shell script, and then I can save it should I choose to.
5528 user.action is generally the best place to define exceptions and additions to
5529 the default policies of default.action. Some actions are safe to have their
5530 default policies set here though. So let's set a default policy to have a
5531 "blank" image as opposed to the checkerboard pattern for ALL sites. "/" of
5532 course matches all URL paths and patterns:
5534 { +set-image-blocker{blank} }
5538 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5542 On-the-fly text substitutions need to be defined in a "filter file". Once
5543 defined, they can then be invoked as an "action".
5545 Privoxy supports three different filter actions: filter to rewrite the content
5546 that is send to the client, client-header-filter to rewrite headers that are
5547 send by the client, and server-header-filter to rewrite headers that are send
5550 Privoxy also supports two tagger actions: client-header-tagger and
5551 server-header-tagger. Taggers and filters use the same syntax in the filter
5552 files, the difference is that taggers don't modify the text they are filtering,
5553 but use a rewritten version of the filtered text as tag. The tags can then be
5554 used to change the applying actions through sections with tag-patterns.
5556 Multiple filter files can be defined through the filterfile config directive.
5557 The filters as supplied by the developers are located in default.filter. It is
5558 recommended that any locally defined or modified filters go in a separately
5559 defined file such as user.filter.
5561 Common tasks for content filters are to eliminate common annoyances in HTML and
5562 JavaScript, such as pop-up windows, exit consoles, crippled windows without
5563 navigation tools, the infamous <BLINK> tag etc, to suppress images with certain
5564 width and height attributes (standard banner sizes or web-bugs), or just to
5567 Enabled content filters are applied to any content whose "Content Type" header
5568 is recognised as a sign of text-based content, with the exception of text/
5569 plain. Use the force-text-mode action to also filter other content.
5571 Substitutions are made at the source level, so if you want to "roll your own"
5572 filters, you should first be familiar with HTML syntax, and, of course, regular
5575 Just like the actions files, the filter file is organized in sections, which
5576 are called filters here. Each filter consists of a heading line, that starts
5577 with one of the keywords FILTER:, CLIENT-HEADER-FILTER: or
5578 SERVER-HEADER-FILTER: followed by the filter's name, and a short (one line)
5579 description of what it does. Below that line come the jobs, i.e. lines that
5580 define the actual text substitutions. By convention, the name of a filter
5581 should describe what the filter eliminates. The comment is used in the
5582 web-based user interface.
5584 Once a filter called name has been defined in the filter file, it can be
5585 invoked by using an action of the form +filter{name} in any actions file.
5587 Filter definitions start with a header line that contains the filter type, the
5588 filter name and the filter description. A content filter header line for a
5589 filter called "foo" could look like this:
5591 FILTER: foo Replace all "foo" with "bar"
5594 Below that line, and up to the next header line, come the jobs that define what
5595 text replacements the filter executes. They are specified in a syntax that
5596 imitates Perl's s/// operator. If you are familiar with Perl, you will find
5597 this to be quite intuitive, and may want to look at the PCRS documentation for
5598 the subtle differences to Perl behaviour. Most notably, the non-standard option
5599 letter U is supported, which turns the default to ungreedy matching.
5601 If you are new to "Regular Expressions", you might want to take a look at the
5602 Appendix on regular expressions, and see the Perl manual for the s///
5603 operator's syntax and Perl-style regular expressions in general. The below
5604 examples might also help to get you started.
5606 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5608 9.1. Filter File Tutorial
5610 Now, let's complete our "foo" content filter. We have already defined the
5611 heading, but the jobs are still missing. Since all it does is to replace "foo"
5612 with "bar", there is only one (trivial) job needed:
5617 But wait! Didn't the comment say that all occurrences of "foo" should be
5618 replaced? Our current job will only take care of the first "foo" on each page.
5619 For global substitution, we'll need to add the g option:
5624 Our complete filter now looks like this:
5626 FILTER: foo Replace all "foo" with "bar"
5630 Let's look at some real filters for more interesting examples. Here you see a
5631 filter that protects against some common annoyances that arise from JavaScript
5632 abuse. Let's look at its jobs one after the other:
5634 FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse
5636 # Get rid of JavaScript referrer tracking. Test page: http://www.randomoddness.com/untitled.htm
5638 s|(<script.*)document\.referrer(.*</script>)|$1"Not Your Business!"$2|Usg
5641 Following the header line and a comment, you see the job. Note that it uses |
5642 as the delimiter instead of /, because the pattern contains a forward slash,
5643 which would otherwise have to be escaped by a backslash (\).
5645 Now, let's examine the pattern: it starts with the text <script.* enclosed in
5646 parentheses. Since the dot matches any character, and * means: "Match an
5647 arbitrary number of the element left of myself", this matches "<script",
5648 followed by any text, i.e. it matches the whole page, from the start of the
5651 That's more than we want, but the pattern continues: document\.referrer matches
5652 only the exact string "document.referrer". The dot needed to be escaped, i.e.
5653 preceded by a backslash, to take away its special meaning as a joker, and make
5654 it just a regular dot. So far, the meaning is: Match from the start of the
5655 first <script> tag in a the page, up to, and including, the text
5656 "document.referrer", if both are present in the page (and appear in that
5659 But there's still more pattern to go. The next element, again enclosed in
5660 parentheses, is .*</script>. You already know what .* means, so the whole
5661 pattern translates to: Match from the start of the first <script> tag in a page
5662 to the end of the last <script> tag, provided that the text "document.referrer"
5663 appears somewhere in between.
5665 This is still not the whole story, since we have ignored the options and the
5666 parentheses: The portions of the page matched by sub-patterns that are enclosed
5667 in parentheses, will be remembered and be available through the variables $1,
5668 $2, ... in the substitute. The U option switches to ungreedy matching, which
5669 means that the first .* in the pattern will only "eat up" all text in between "
5670 <script" and the first occurrence of "document.referrer", and that the second
5671 .* will only span the text up to the first "</script>" tag. Furthermore, the s
5672 option says that the match may span multiple lines in the page, and the g
5673 option again means that the substitution is global.
5675 So, to summarize, the pattern means: Match all scripts that contain the text
5676 "document.referrer". Remember the parts of the script from (and including) the
5677 start tag up to (and excluding) the string "document.referrer" as $1, and the
5678 part following that string, up to and including the closing tag, as $2.
5680 Now the pattern is deciphered, but wasn't this about substituting things? So
5681 lets look at the substitute: $1"Not Your Business!"$2 is easy to read: The text
5682 remembered as $1, followed by "Not Your Business!" (including the quotation
5683 marks!), followed by the text remembered as $2. This produces an exact copy of
5684 the original string, with the middle part (the "document.referrer") replaced by
5685 "Not Your Business!".
5687 The whole job now reads: Replace "document.referrer" by "Not Your Business!"
5688 wherever it appears inside a <script> tag. Note that this job won't break
5689 JavaScript syntax, since both the original and the replacement are
5690 syntactically valid string objects. The script just won't have access to the
5691 referrer information anymore.
5693 We'll show you two other jobs from the JavaScript taming department, but this
5694 time only point out the constructs of special interest:
5696 # The status bar is for displaying link targets, not pointless blahblah
5698 s/window\.status\s*=\s*(['"]).*?\1/dUmMy=1/ig
5701 \s stands for whitespace characters (space, tab, newline, carriage return, form
5702 feed), so that \s* means: "zero or more whitespace". The ? in .*? makes this
5703 matching of arbitrary text ungreedy. (Note that the U option is not set). The
5704 ['"] construct means: "a single or a double quote". Finally, \1 is a
5705 back-reference to the first parenthesis just like $1 above, with the difference
5706 that in the pattern, a backslash indicates a back-reference, whereas in the
5707 substitute, it's the dollar.
5709 So what does this job do? It replaces assignments of single- or double-quoted
5710 strings to the "window.status" object with a dummy assignment (using a variable
5711 name that is hopefully odd enough not to conflict with real variables in
5712 scripts). Thus, it catches many cases where e.g. pointless descriptions are
5713 displayed in the status bar instead of the link target when you move your mouse
5716 # Kill OnUnload popups. Yummy. Test: http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html
5718 s/(<body [^>]*)onunload(.*>)/$1never$2/iU
5721 Including the OnUnload event binding in the HTML DOM was a CRIME. When I close
5722 a browser window, I want it to close and die. Basta. This job replaces the
5723 "onunload" attribute in "<body>" tags with the dummy word never. Note that the
5724 i option makes the pattern matching case-insensitive. Also note that ungreedy
5725 matching alone doesn't always guarantee a minimal match: In the first
5726 parenthesis, we had to use [^>]* instead of .* to prevent the match from
5727 exceeding the <body> tag if it doesn't contain "OnUnload", but the page's
5730 The last example is from the fun department:
5732 FILTER: fun Fun text replacements
5734 # Spice the daily news:
5736 s/microsoft(?!\.com)/MicroSuck/ig
5739 Note the (?!\.com) part (a so-called negative lookahead) in the job's pattern,
5740 which means: Don't match, if the string ".com" appears directly following
5741 "microsoft" in the page. This prevents links to microsoft.com from being
5742 trashed, while still replacing the word everywhere else.
5744 # Buzzword Bingo (example for extended regex syntax)
5746 s* industry[ -]leading \
5748 | customer[ -]focused \
5749 | market[ -]driven \
5750 | award[ -]winning # Comments are OK, too! \
5751 | high[ -]performance \
5752 | solutions[ -]based \
5756 *<font color="red"><b>BINGO!</b></font> \
5760 The x option in this job turns on extended syntax, and allows for e.g. the
5761 liberal use of (non-interpreted!) whitespace for nicer formatting.
5765 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5767 9.2. The Pre-defined Filters
5769 The distribution default.filter file contains a selection of pre-defined
5770 filters for your convenience:
5774 The purpose of this filter is to get rid of particularly annoying
5775 JavaScript abuse. To that end, it
5777 □ replaces JavaScript references to the browser's referrer information
5778 with the string "Not Your Business!". This compliments the
5779 hide-referrer action on the content level.
5781 □ removes the bindings to the DOM's unload event which we feel has no
5782 right to exist and is responsible for most "exit consoles", i.e. nasty
5783 windows that pop up when you close another one.
5785 □ removes code that causes new windows to be opened with undesired
5786 properties, such as being full-screen, non-resizeable, without
5787 location, status or menu bar etc.
5789 Use with caution. This is an aggressive filter, and can break sites that
5790 rely heavily on JavaScript.
5794 This is a very radical measure. It removes virtually all JavaScript event
5795 bindings, which means that scripts can not react to user actions such as
5796 mouse movements or clicks, window resizing etc, anymore. Use with caution!
5798 We strongly discourage using this filter as a default since it breaks many
5799 legitimate scripts. It is meant for use only on extra-nasty sites (should
5800 you really need to go there).
5804 This filter will undo many common instances of HTML based abuse.
5806 The BLINK and MARQUEE tags are neutralized (yeah baby!), and browser
5807 windows will be created as resizeable (as of course they should be!), and
5808 will have location, scroll and menu bars -- even if specified otherwise.
5812 Most cookies are set in the HTTP dialog, where they can be intercepted by
5813 the crunch-incoming-cookies and crunch-outgoing-cookies actions. But web
5814 sites increasingly make use of HTML meta tags and JavaScript to sneak
5815 cookies to the browser on the content level.
5817 This filter disables most HTML and JavaScript code that reads or sets
5818 cookies. It cannot detect all clever uses of these types of code, so it
5819 should not be relied on as an absolute fix. Use it wherever you would also
5820 use the cookie crunch actions.
5824 Disable any refresh tags if the interval is greater than nine seconds (so
5825 that redirections done via refresh tags are not destroyed). This is useful
5826 for dial-on-demand setups, or for those who find this HTML feature
5831 This filter attempts to prevent only "unsolicited" pop-up windows from
5832 opening, yet still allow pop-up windows that the user has explicitly chosen
5833 to open. It was added in version 3.0.1, as an improvement over earlier such
5836 Technical note: The filter works by redefining the window.open JavaScript
5837 function to a dummy function, PrivoxyWindowOpen(), during the loading and
5838 rendering phase of each HTML page access, and restoring the function
5841 This is recommended only for browsers that cannot perform this function
5842 reliably themselves. And be aware that some sites require such windows in
5843 order to function normally. Use with caution.
5847 Attempt to prevent all pop-up windows from opening. Note this should be
5848 used with even more discretion than the above, since it is more likely to
5849 break some sites that require pop-ups for normal usage. Use with caution.
5853 This is a helper filter that has no value if used alone. It makes the
5854 banners-by-size and banners-by-link (see below) filters more effective and
5855 should be enabled together with them.
5859 This filter removes image tags purely based on what size they are.
5860 Fortunately for us, many ads and banner images tend to conform to certain
5861 standardized sizes, which makes this filter quite effective for ad
5864 Occasionally this filter will cause false positives on images that are not
5865 ads, but just happen to be of one of the standard banner sizes.
5867 Recommended only for those who require extreme ad blocking. The default
5868 block rules should catch 95+% of all ads without this filter enabled.
5872 This is an experimental filter that attempts to kill any banners if their
5873 URLs seem to point to known or suspected click trackers. It is currently
5874 not of much value and is not recommended for use by default.
5878 Webbugs are small, invisible images (technically 1X1 GIF images), that are
5879 used to track users across websites, and collect information on them. As an
5880 HTML page is loaded by the browser, an embedded image tag causes the
5881 browser to contact a third-party site, disclosing the tracking information
5882 through the requested URL and/or cookies for that third-party domain,
5883 without the user ever becoming aware of the interaction with the
5884 third-party site. HTML-ized spam also uses a similar technique to verify
5887 This filter removes the HTML code that loads such "webbugs".
5891 A rather special-purpose filter that can be used to enlarge textareas
5892 (those multi-line text boxes in web forms) and turn off hard word wrap in
5893 them. It was written for the sourceforge.net tracker system where such
5894 boxes are a nuisance, but it can be handy on other sites, too.
5896 It is not recommended to use this filter as a default.
5900 Many consider windows that move, or resize themselves to be abusive. This
5901 filter neutralizes the related JavaScript code. Note that some sites might
5902 not display or behave as intended when using this filter. Use with caution.
5906 Some web designers seem to assume that everyone in the world will view
5907 their web sites using the same browser brand and version, screen resolution
5908 etc, because only that assumption could explain why they'd use static frame
5909 sizes, yet prevent their frames from being resized by the user, should they
5910 be too small to show their whole content.
5912 This filter removes the related HTML code. It should only be applied to
5913 sites which need it.
5917 Many Microsoft products that generate HTML use non-standard extensions
5918 (read: violations) of the ISO 8859-1 aka Latin-1 character set. This can
5919 cause those HTML documents to display with errors on standard-compliant
5922 This filter translates the MS-only characters into Latin-1 equivalents. It
5923 is not necessary when using MS products, and will cause corruption of all
5924 documents that use 8-bit character sets other than Latin-1. It's mostly
5925 worthwhile for Europeans on non-MS platforms, if weird garbage characters
5926 sometimes appear on some pages, or user agents that don't correct for this
5931 A filter for shockwave haters. As the name suggests, this filter strips
5932 code out of web pages that is used to embed shockwave flash objects.
5936 Change HTML code that embeds Quicktime objects so that kioskmode, which
5937 prevents saving, is disabled.
5941 Text replacements for subversive browsing fun. Make fun of your favorite
5942 Monopolist or play buzzword bingo.
5946 A demonstration-only filter that shows how Privoxy can be used to delete
5947 web content on a keyword basis.
5951 An experimental collection of text replacements to disable malicious HTML
5952 and JavaScript code that exploits known security holes in Internet
5955 Presently, it only protects against Nimda and a cross-site scripting bug,
5956 and would need active maintenance to provide more substantial protection.
5960 Some web sites have very specific problems, the cure for which doesn't
5961 apply anywhere else, or could even cause damage on other sites.
5963 This is a collection of such site-specific cures which should only be
5964 applied to the sites they were intended for, which is what the supplied
5965 default.action file does. Users shouldn't need to change anything regarding
5970 A CSS based block for Google text ads. Also removes a width limitation and
5971 the toolbar advertisement.
5975 Another CSS based block, this time for Yahoo text ads. And removes a width
5980 Another CSS based block, this time for MSN text ads. And removes tracking
5981 URLs, as well as a width limitation.
5985 Cleans up some Blogspot blogs. Read the fine print before using this one!
5987 This filter also intentionally removes some navigation stuff and sets the
5988 page width to 100%. As a result, some rounded "corners" would appear to
5989 early or not at all and as fixing this would require a browser that
5990 understands background-size (CSS3), they are removed instead.
5994 Server-header filter to change the Content-Type from xml to html.
5998 Server-header filter to change the Content-Type from html to xml.
6002 Removes the non-standard ping attribute from anchor and area HTML tags.
6004 hide-tor-exit-notation
6006 Client-header filter to remove the Tor exit node notation found in Host and
6009 If Privoxy and Tor are chained and Privoxy is configured to use socks4a,
6010 one can use "http://www.example.org.foobar.exit/" to access the host
6011 "www.example.org" through the Tor exit node "foobar".
6013 As the HTTP client isn't aware of this notation, it treats the whole string
6014 "www.example.org.foobar.exit" as host and uses it for the "Host" and
6015 "Referer" headers. From the server's point of view the resulting headers
6016 are invalid and can cause problems.
6018 An invalid "Referer" header can trigger "hot-linking" protections, an
6019 invalid "Host" header will make it impossible for the server to find the
6020 right vhost (several domains hosted on the same IP address).
6022 This client-header filter removes the "foo.exit" part in those headers to
6023 prevent the mentioned problems. Note that it only modifies the HTTP
6024 headers, it doesn't make it impossible for the server to detect your Tor
6025 exit node based on the IP address the request is coming from.
6027 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6029 10. Privoxy's Template Files
6031 All Privoxy built-in pages, i.e. error pages such as the "404 - No Such Domain"
6032 error page, the "BLOCKED" page and all pages of its web-based user interface,
6033 are generated from templates. (Privoxy must be running for the above links to
6036 These templates are stored in a subdirectory of the configuration directory
6037 called templates. On Unixish platforms, this is typically /etc/privoxy/
6040 The templates are basically normal HTML files, but with place-holders (called
6041 symbols or exports), which Privoxy fills at run time. It is possible to edit
6042 the templates with a normal text editor, should you want to customize them.
6043 (Not recommended for the casual user). Should you create your own custom
6044 templates, you should use the config setting templdir to specify an alternate
6045 location, so your templates do not get overwritten during upgrades.
6047 Note that just like in configuration files, lines starting with # are ignored
6048 when the templates are filled in.
6050 The place-holders are of the form @name@, and you will find a list of available
6051 symbols, which vary from template to template, in the comments at the start of
6052 each file. Note that these comments are not always accurate, and that it's
6053 probably best to look at the existing HTML code to find out which symbols are
6054 supported and what they are filled in with.
6056 A special application of this substitution mechanism is to make whole blocks of
6057 HTML code disappear when a specific symbol is set. We use this for many
6058 purposes, one of them being to include the beta warning in all our user
6059 interface (CGI) pages when Privoxy is in an alpha or beta development stage:
6061 <!-- @if-unstable-start -->
6063 ... beta warning HTML code goes here ...
6065 <!-- if-unstable-end@ -->
6068 If the "unstable" symbol is set, everything in between and including
6069 @if-unstable-start and if-unstable-end@ will disappear, leaving nothing but an
6075 There's also an if-then-else construct and an #include mechanism, but you'll
6076 sure find out if you are inclined to edit the templates ;-)
6078 All templates refer to a style located at http://config.privoxy.org/
6079 send-stylesheet. This is, of course, locally served by Privoxy and the source
6080 for it can be found and edited in the cgi-style.css template.
6082 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6084 11. Contacting the Developers, Bug Reporting and Feature Requests
6086 We value your feedback. In fact, we rely on it to improve Privoxy and its
6087 configuration. However, please note the following hints, so we can provide you
6088 with the best support:
6090 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6094 For casual users, our support forum at SourceForge is probably best suited:
6095 http://sourceforge.net/tracker/?group_id=11118&atid=211118
6097 All users are of course welcome to discuss their issues on the users mailing
6098 list, where the developers also hang around.
6100 Note that the Privoxy mailing lists are moderated. Posts from unsubscribed
6101 addresses have to be accepted manually by a moderator. This may cause a delay
6102 of several days and if you use a subject that doesn't clearly mention Privoxy
6103 or one of its features, your message may be accidentally discarded as spam.
6105 If you aren't subscribed, you should therefore spend a few seconds to come up
6106 with a proper subject. Additionally you should make it clear that you want to
6107 get CC'd. Otherwise some responses will be directed to the mailing list only,
6108 and you won't see them.
6110 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6112 11.2. Reporting Problems
6114 "Problems" for our purposes, come in two forms:
6116 • Configuration issues, such as ads that slip through, or sites that don't
6117 function properly due to one Privoxy "action" or another being turned "on".
6119 • "Bugs" in the programming code that makes up Privoxy, such as that might
6122 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6124 11.2.1. Reporting Ads or Other Configuration Problems
6126 Please send feedback on ads that slipped through, innocent images that were
6127 blocked, sites that don't work properly, and other configuration related
6128 problem of default.action file, to http://sourceforge.net/tracker/?group_id=
6129 11118&atid=460288, the Actions File Tracker.
6131 New, improved default.action files may occasionally be made available based on
6132 your feedback. These will be announced on the ijbswa-announce list and
6133 available from our the files section of our project page.
6135 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6137 11.2.2. Reporting Bugs
6139 Please report all bugs through our bug tracker: http://sourceforge.net/tracker
6140 /?group_id=11118&atid=111118.
6142 Before doing so, please make sure that the bug has not already been submitted
6143 and observe the additional hints at the top of the submit form. If already
6144 submitted, please feel free to add any info to the original report that might
6145 help to solve the issue.
6147 Please try to verify that it is a Privoxy bug, and not a browser or site bug or
6148 documented behaviour that just happens to be different than what you expected.
6149 If unsure, try toggling off Privoxy, and see if the problem persists.
6151 If you are using your own custom configuration, please try the stock configs to
6152 see if the problem is configuration related. If you're having problems with a
6153 feature that is disabled by default, please ask around on the mailing list if
6154 others can reproduce the problem.
6156 If you aren't using the latest Privoxy version, the bug may have been found and
6157 fixed in the meantime. We would appreciate if you could take the time to
6158 upgrade to the latest version (or even the latest CVS snapshot) and verify that
6159 your bug still exists.
6161 Please be sure to provide the following information:
6163 • The exact Privoxy version you are using (if you got the source from CVS,
6164 please also provide the source code revisions as shown in http://
6165 config.privoxy.org/show-version).
6167 • The operating system and versions you run Privoxy on, (e.g. Windows XP
6168 SP2), if you are using a Unix flavor, sending the output of "uname -a"
6169 should do, in case of GNU/Linux, please also name the distribution.
6171 • The name, platform, and version of the browser you were using (e.g.
6172 Internet Explorer v5.5 for Mac).
6174 • The URL where the problem occurred, or some way for us to duplicate the
6175 problem (e.g. http://somesite.example.com/?somethingelse=123).
6177 • Whether your version of Privoxy is one supplied by the Privoxy developers
6178 via SourceForge, or if you got your copy somewhere else.
6180 • Whether you are using Privoxy in tandem with another proxy such as Tor. If
6181 so, please temporary disable the other proxy to see if the symptoms change.
6183 • Whether you are using a personal firewall product. If so, does Privoxy work
6186 • Any other pertinent information to help identify the problem such as config
6187 or log file excerpts (yes, you should have log file entries for each action
6190 You don't have to tell us your actual name when filing a problem report, but
6191 please use a nickname so we can differentiate between your messages and the
6192 ones entered by other "anonymous" users that may respond to your request if
6193 they have the same problem or already found a solution.
6195 Please also check the status of your request a few days after submitting it, as
6196 we may request additional information. If you use a SF id, you should
6197 automatically get a mail when someone responds to your request.
6199 The appendix of the Privoxy User Manual also has helpful information on
6200 understanding actions, and action debugging.
6202 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6204 11.3. Request New Features
6206 You are welcome to submit ideas on new features or other proposals for
6207 improvement through our feature request tracker at http://sourceforge.net/
6208 tracker/?atid=361118&group_id=11118.
6210 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6214 For any other issues, feel free to use the mailing lists. Technically
6215 interested users and people who wish to contribute to the project are also
6216 welcome on the developers list! You can find an overview of all Privoxy-related
6217 mailing lists, including list archives, at: http://sourceforge.net/mail/?
6220 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6222 12. Privoxy Copyright, License and History
6224 Copyright 2001-2007 by Privoxy Developers <
6225 ijbswa-developers@lists.sourceforge.net>
6227 Some source code is based on code Copyright 1997 by Anonymous Coders and
6228 Junkbusters, Inc. and licensed under the GNU General Public License.
6230 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6234 Privoxy is free software; you can redistribute it and/or modify it under the
6235 terms of the GNU General Public License, version 2, as published by the Free
6236 Software Foundation.
6238 This program is distributed in the hope that it will be useful, but WITHOUT ANY
6239 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
6240 PARTICULAR PURPOSE. See the GNU General Public License for more details, which
6241 is available from the Free Software Foundation, Inc, 51 Franklin Street, Fifth
6242 Floor, Boston, MA 02110-1301, USA
6244 You should have received a copy of the GNU General Public License along with
6245 this program; if not, write to the
6248 Foundation, Inc. 51 Franklin Street, Fifth Floor
6249 Boston, MA 02110-1301
6252 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6256 A long time ago, there was the Internet Junkbuster, by Anonymous Coders and
6257 Junkbusters Corporation. This saved many users a lot of pain in the early days
6258 of web advertising and user tracking.
6260 But the web, its protocols and standards, and with it, the techniques for
6261 forcing ads on users, give up autonomy over their browsing, and for tracking
6262 them, keeps evolving. Unfortunately, the Internet Junkbuster did not. Version
6263 2.0.2, published in 1998, was (and is) the last official release available from
6264 Junkbusters Corporation. Fortunately, it had been released under the GNU GPL,
6265 which allowed further development by others.
6267 So Stefan Waldherr started maintaining an improved version of the software, to
6268 which eventually a number of people contributed patches. It could already
6269 replace banners with a transparent image, and had a first version of pop-up
6270 killing, but it was still very closely based on the original, with all its
6271 limitations, such as the lack of HTTP/1.1 support, flexible per-site
6272 configuration, or content modification. The last release from this effort was
6273 version 2.0.2-10, published in 2000.
6275 Then, some developers picked up the thread, and started turning the software
6276 inside out, upside down, and then reassembled it, adding many new features
6279 The result of this is Privoxy, whose first stable version, 3.0, was released
6282 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6286 Current Privoxy Team:
6288 Fabian Keil, lead developer
6289 David Schmidt, developer
6295 Former Privoxy Team Members:
6320 Thanks to the many people who have tested Privoxy, reported bugs, provided
6321 patches, made suggestions or contributed in some way. These include (in
6322 alphabetical order):
6378 Privoxy is based in part on code originally developed by Junkbusters Corp. and
6381 Privoxy heavily relies on Philip Hazel's PCRE.
6383 The code to filter compressed content makes use of zlib which is written by
6384 Jean-loup Gailly and Mark Adler.
6386 On systems that lack snprintf(), Privoxy is using a version written by Mark
6387 Martinec. On systems that lack strptime(), Privoxy is using the one from the
6388 GNU C Library written by Ulrich Drepper.
6390 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6394 Other references and sites of interest to Privoxy users:
6396 http://www.privoxy.org/, the Privoxy Home page.
6398 http://www.privoxy.org/faq/, the Privoxy FAQ.
6400 http://sourceforge.net/projects/ijbswa/, the Project Page for Privoxy on
6403 http://config.privoxy.org/, the web-based user interface. Privoxy must be
6404 running for this to work. Shortcut: http://p.p/
6406 http://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit "misses"
6407 and other configuration related suggestions to the developers.
6409 http://www.junkbusters.com/ht/en/cookies.html, an explanation how cookies are
6410 used to track web users.
6412 http://www.junkbusters.com/ijb.html, the original Internet Junkbuster.
6414 http://privacy.net/, a useful site to check what information about you is
6415 leaked while you browse the web.
6417 http://www.squid-cache.org/, a popular caching proxy, which is often used
6418 together with Privoxy.
6420 http://www.pps.jussieu.fr/~jch/software/polipo/, Polipo is a caching proxy with
6421 advanced features like pipelining, multiplexing and caching of partial
6422 instances. In many setups it can be used as Squid replacement.
6424 http://tor.eff.org/, Tor can help anonymize web browsing, web publishing,
6425 instant messaging, IRC, SSH, and other applications.
6427 http://www.privoxy.org/developer-manual/, the Privoxy developer manual.
6429 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6433 14.1. Regular Expressions
6435 Privoxy uses Perl-style "regular expressions" in its actions files and filter
6436 file, through the PCRE and PCRS libraries.
6438 If you are reading this, you probably don't understand what "regular
6439 expressions" are, or what they can do. So this will be a very brief
6440 introduction only. A full explanation would require a book ;-)
6442 Regular expressions provide a language to describe patterns that can be run
6443 against strings of characters (letter, numbers, etc), to see if they match the
6444 string or not. The patterns are themselves (sometimes complex) strings of
6445 literal characters, combined with wild-cards, and other special characters,
6446 called meta-characters. The "meta-characters" have special meanings and are
6447 used to build complex patterns to be matched against. Perl Compatible Regular
6448 Expressions are an especially convenient "dialect" of the regular expression
6451 To make a simple analogy, we do something similar when we use wild-card
6452 characters when listing files with the dir command in DOS. *.* matches all
6453 filenames. The "special" character here is the asterisk which matches any and
6454 all characters. We can be more specific and use ? to match just individual
6455 characters. So "dir file?.text" would match "file1.txt", "file2.txt", etc. We
6456 are pattern matching, using a similar technique to "regular expressions"!
6458 Regular expressions do essentially the same thing, but are much, much more
6459 powerful. There are many more "special characters" and ways of building complex
6460 patterns however. Let's look at a few of the common ones, and then some
6463 . - Matches any single character, e.g. "a", "A", "4", ":", or "@".
6465 ? - The preceding character or expression is matched ZERO or ONE times. Either/
6468 + - The preceding character or expression is matched ONE or MORE times.
6470 * - The preceding character or expression is matched ZERO or MORE times.
6472 \ - The "escape" character denotes that the following character should be taken
6473 literally. This is used where one of the special characters (e.g. ".") needs to
6474 be taken literally and not as a special meta-character. Example: "example
6475 \.com", makes sure the period is recognized only as a period (and not expanded
6476 to its meta-character meaning of any single character).
6478 [ ] - Characters enclosed in brackets will be matched if any of the enclosed
6479 characters are encountered. For instance, "[0-9]" matches any numeric digit
6480 (zero through nine). As an example, we can combine this with "+" to match any
6481 digit one of more times: "[0-9]+".
6483 ( ) - parentheses are used to group a sub-expression, or multiple
6486 | - The "bar" character works like an "or" conditional statement. A match is
6487 successful if the sub-expression on either side of "|" matches. As an example:
6488 "/(this|that) example/" uses grouping and the bar character and would match
6489 either "this example" or "that example", and nothing else.
6491 These are just some of the ones you are likely to use when matching URLs with
6492 Privoxy, and is a long way from a definitive list. This is enough to get us
6493 started with a few simple examples which may be more illuminating:
6495 /.*/banners/.* - A simple example that uses the common combination of "." and
6496 "*" to denote any character, zero or more times. In other words, any string at
6497 all. So we start with a literal forward slash, then our regular expression
6498 pattern (".*") another literal forward slash, the string "banners", another
6499 forward slash, and lastly another ".*". We are building a directory path here.
6500 This will match any file with the path that has a directory named "banners" in
6501 it. The ".*" matches any characters, and this could conceivably be more forward
6502 slashes, so it might expand into a much longer looking path. For example, this
6503 could match: "/eye/hate/spammers/banners/annoy_me_please.gif", or just "/
6504 banners/annoying.html", or almost an infinite number of other possible
6505 combinations, just so it has "banners" in the path somewhere.
6507 And now something a little more complex:
6509 /.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have several literal forward
6510 slashes again ("/"), so we are building another expression that is a file path
6511 statement. We have another ".*", so we are matching against any conceivable
6512 sub-path, just so it matches our expression. The only true literal that must
6513 match our pattern is adv, together with the forward slashes. What comes after
6514 the "adv" string is the interesting part.
6516 Remember the "?" means the preceding expression (either a literal character or
6517 anything grouped with "(...)" in this case) can exist or not, since this means
6518 either zero or one match. So "((er)?ts?|ertis(ing|ements?))" is optional, as
6519 are the individual sub-expressions: "(er)", "(ing|ements?)", and the "s". The "
6520 |" means "or". We have two of those. For instance, "(ing|ements?)", can expand
6521 to match either "ing" OR "ements?". What is being done here, is an attempt at
6522 matching as many variations of "advertisement", and similar, as possible. So
6523 this would expand to match just "adv", or "advert", or "adverts", or
6524 "advertising", or "advertisement", or "advertisements". You get the idea. But
6525 it would not match "advertizements" (with a "z"). We could fix that by changing
6526 our regular expression to: "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/", which
6527 would then match either spelling.
6529 /.*/advert[0-9]+\.(gif|jpe?g) - Again another path statement with forward
6530 slashes. Anything in the square brackets "[ ]" can be matched. This is using
6531 "0-9" as a shorthand expression to mean any digit one through nine. It is the
6532 same as saying "0123456789". So any digit matches. The "+" means one or more of
6533 the preceding expression must be included. The preceding expression here is
6534 what is in the square brackets -- in this case, any digit one through nine.
6535 Then, at the end, we have a grouping: "(gif|jpe?g)". This includes a "|", so
6536 this needs to match the expression on either side of that bar character also. A
6537 simple "gif" on one side, and the other side will in turn match either "jpeg"
6538 or "jpg", since the "?" means the letter "e" is optional and can be matched
6539 once or not at all. So we are building an expression here to match image GIF or
6540 JPEG type image file. It must include the literal string "advert", then one or
6541 more digits, and a "." (which is now a literal, and not a special character,
6542 since it is escaped with "\"), and lastly either "gif", or "jpeg", or "jpg".
6543 Some possible matches would include: "//advert1.jpg", "/nasty/ads/
6544 advert1234.gif", "/banners/from/hell/advert99.jpg". It would not match
6545 "advert1.gif" (no leading slash), or "/adverts232.jpg" (the expression does not
6546 include an "s"), or "/advert1.jsp" ("jsp" is not in the expression anywhere).
6548 We are barely scratching the surface of regular expressions here so that you
6549 can understand the default Privoxy configuration files, and maybe use this
6550 knowledge to customize your own installation. There is much, much more that can
6551 be done with regular expressions. Now that you know enough to get started, you
6552 can learn more on your own :/
6554 More reading on Perl Compatible Regular expressions: http://perldoc.perl.org/
6557 For information on regular expression based substitutions and their
6558 applications in filters, please see the filter file tutorial in this manual.
6560 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6562 14.2. Privoxy's Internal Pages
6564 Since Privoxy proxies each requested web page, it is easy for Privoxy to trap
6565 certain special URLs. In this way, we can talk directly to Privoxy, and see how
6566 it is configured, see how our rules are being applied, change these rules and
6567 other configuration options, and even turn Privoxy's filtering off, all with a
6570 The URLs listed below are the special ones that allow direct access to Privoxy.
6571 Of course, Privoxy must be running to access these. If not, you will get a
6572 friendly error message. Internet access is not necessary either.
6574 • Privoxy main page:
6576 http://config.privoxy.org/
6578 There is a shortcut: http://p.p/ (But it doesn't provide a fall-back to a
6579 real page, in case the request is not sent through Privoxy)
6581 • Show information about the current configuration, including viewing and
6582 editing of actions files:
6584 http://config.privoxy.org/show-status
6586 • Show the source code version numbers:
6588 http://config.privoxy.org/show-version
6590 • Show the browser's request headers:
6592 http://config.privoxy.org/show-request
6594 • Show which actions apply to a URL and why:
6596 http://config.privoxy.org/show-url-info
6598 • Toggle Privoxy on or off. This feature can be turned off/on in the main
6599 config file. When toggled "off", "Privoxy" continues to run, but only as a
6600 pass-through proxy, with no actions taking place:
6602 http://config.privoxy.org/toggle
6604 Short cuts. Turn off, then on:
6606 http://config.privoxy.org/toggle?set=disable
6608 http://config.privoxy.org/toggle?set=enable
6610 These may be bookmarked for quick reference. See next.
6612 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6614 14.2.1. Bookmarklets
6616 Below are some "bookmarklets" to allow you to easily access a "mini" version of
6617 some of Privoxy's special pages. They are designed for MS Internet Explorer,
6618 but should work equally well in Netscape, Mozilla, and other browsers which
6619 support JavaScript. They are designed to run directly from your bookmarks - not
6620 by clicking the links below (although that should work for testing).
6622 To save them, right-click the link and choose "Add to Favorites" (IE) or "Add
6623 Bookmark" (Netscape). You will get a warning that the bookmark "may not be
6624 safe" - just click OK. Then you can run the Bookmarklet directly from your
6625 favorites/bookmarks. For even faster access, you can put them on the "Links"
6626 bar (IE) or the "Personal Toolbar" (Netscape), and run them with a single
6633 • Privoxy - Toggle Privoxy (Toggles between enabled and disabled)
6635 • Privoxy- View Status
6639 Credit: The site which gave us the general idea for these bookmarklets is
6640 www.bookmarklets.com. They have more information about bookmarklets.
6642 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6644 14.3. Chain of Events
6646 Let's take a quick look at how some of Privoxy's core features are triggered,
6647 and the ensuing sequence of events when a web page is requested by your
6650 • First, your web browser requests a web page. The browser knows to send the
6651 request to Privoxy, which will in turn, relay the request to the remote web
6652 server after passing the following tests:
6654 • Privoxy traps any request for its own internal CGI pages (e.g http://p.p/)
6655 and sends the CGI page back to the browser.
6657 • Next, Privoxy checks to see if the URL matches any "+block" patterns. If
6658 so, the URL is then blocked, and the remote web server will not be
6659 contacted. "+handle-as-image" and "+handle-as-empty-document" are then
6660 checked, and if there is no match, an HTML "BLOCKED" page is sent back to
6661 the browser. Otherwise, if it does match, an image is returned for the
6662 former, and an empty text document for the latter. The type of image would
6663 depend on the setting of "+set-image-blocker" (blank, checkerboard pattern,
6664 or an HTTP redirect to an image elsewhere).
6666 • Untrusted URLs are blocked. If URLs are being added to the trust file, then
6669 • If the URL pattern matches the "+fast-redirects" action, it is then
6670 processed. Unwanted parts of the requested URL are stripped.
6672 • Now the rest of the client browser's request headers are processed. If any
6673 of these match any of the relevant actions (e.g. "+hide-user-agent", etc.),
6674 headers are suppressed or forged as determined by these actions and their
6677 • Now the web server starts sending its response back (i.e. typically a web
6680 • First, the server headers are read and processed to determine, among other
6681 things, the MIME type (document type) and encoding. The headers are then
6682 filtered as determined by the "+crunch-incoming-cookies",
6683 "+session-cookies-only", and "+downgrade-http-version" actions.
6685 • If the "+kill-popups" action applies, and it is an HTML or JavaScript
6686 document, the popup-code in the response is filtered on-the-fly as it is
6689 • If any "+filter" action or "+deanimate-gifs" action applies (and the
6690 document type fits the action), the rest of the page is read into memory
6691 (up to a configurable limit). Then the filter rules (from default.filter
6692 and any other filter files) are processed against the buffered content.
6693 Filters are applied in the order they are specified in one of the filter
6694 files. Animated GIFs, if present, are reduced to either the first or last
6695 frame, depending on the action setting.The entire page, which is now
6696 filtered, is then sent by Privoxy back to your browser.
6698 If neither a "+filter" action or "+deanimate-gifs" matches, then Privoxy
6699 passes the raw data through to the client browser as it becomes available.
6701 • As the browser receives the now (possibly filtered) page content, it reads
6702 and then requests any URLs that may be embedded within the page source,
6703 e.g. ad images, stylesheets, JavaScript, other HTML documents (e.g.
6704 frames), sounds, etc. For each of these objects, the browser issues a
6705 separate request (this is easily viewable in Privoxy's logs). And each such
6706 request is in turn processed just as above. Note that a complex web page
6707 will have many, many such embedded URLs. If these secondary requests are to
6708 a different server, then quite possibly a very differing set of actions is
6711 NOTE: This is somewhat of a simplistic overview of what happens with each URL
6712 request. For the sake of brevity and simplicity, we have focused on Privoxy's
6715 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6717 14.4. Troubleshooting: Anatomy of an Action
6719 The way Privoxy applies actions and filters to any given URL can be complex,
6720 and not always so easy to understand what is happening. And sometimes we need
6721 to be able to see just what Privoxy is doing. Especially, if something Privoxy
6722 is doing is causing us a problem inadvertently. It can be a little daunting to
6723 look at the actions and filters files themselves, since they tend to be filled
6724 with regular expressions whose consequences are not always so obvious.
6726 One quick test to see if Privoxy is causing a problem or not, is to disable it
6727 temporarily. This should be the first troubleshooting step. See the
6728 Bookmarklets section on a quick and easy way to do this (be sure to flush
6729 caches afterward!). Looking at the logs is a good idea too. (Note that both the
6730 toggle feature and logging are enabled via config file settings, and may need
6733 Another easy troubleshooting step to try is if you have done any customization
6734 of your installation, revert back to the installed defaults and see if that
6735 helps. There are times the developers get complaints about one thing or
6736 another, and the problem is more related to a customized configuration issue.
6738 Privoxy also provides the http://config.privoxy.org/show-url-info page that can
6739 show us very specifically how actions are being applied to any given URL. This
6740 is a big help for troubleshooting.
6742 First, enter one URL (or partial URL) at the prompt, and then Privoxy will tell
6743 us how the current configuration will handle it. This will not help with
6744 filtering effects (i.e. the "+filter" action) from one of the filter files
6745 since this is handled very differently and not so easy to trap! It also will
6746 not tell you about any other URLs that may be embedded within the URL you are
6747 testing. For instance, images such as ads are expressed as URLs within the raw
6748 page source of HTML pages. So you will only get info for the actual URL that is
6749 pasted into the prompt area -- not any sub-URLs. If you want to know about
6750 embedded URLs like ads, you will have to dig those out of the HTML source. Use
6751 your browser's "View Page Source" option for this. Or right click on the ad,
6754 Let's try an example, google.com, and look at it one section at a time in a
6755 sample configuration (your real configuration may vary):
6757 Matches for http://www.google.com:
6759 In file: default.action [ View ] [ Edit ]
6761 {+deanimate-gifs {last}
6762 +fast-redirects {check-decoded-url}
6763 +filter {refresh-tags}
6764 +filter {img-reorder}
6765 +filter {banners-by-size}
6767 +filter {jumping-windows}
6768 +filter {ie-exploits}
6769 +hide-forwarded-for-headers
6770 +hide-from-header {block}
6771 +hide-referrer {forge}
6772 +session-cookies-only
6773 +set-image-blocker {pattern}
6776 { -session-cookies-only }
6782 In file: user.action [ View ] [ Edit ]
6783 (no matches in this file)
6786 This is telling us how we have defined our "actions", and which ones match for
6787 our test case, "google.com". Displayed is all the actions that are available to
6788 us. Remember, the + sign denotes "on". - denotes "off". So some are "on" here,
6789 but many are "off". Each example we try may provide a slightly different end
6790 result, depending on our configuration directives.
6792 The first listing is for our default.action file. The large, multi-line
6793 listing, is how the actions are set to match for all URLs, i.e. our default
6794 settings. If you look at your "actions" file, this would be the section just
6795 below the "aliases" section near the top. This will apply to all URLs as
6796 signified by the single forward slash at the end of the listing -- " / ".
6798 But we have defined additional actions that would be exceptions to these
6799 general rules, and then we list specific URLs (or patterns) that these
6800 exceptions would apply to. Last match wins. Just below this then are two
6801 explicit matches for ".google.com". The first is negating our previous cookie
6802 setting, which was for "+session-cookies-only" (i.e. not persistent). So we
6803 will allow persistent cookies for google, at least that is how it is in this
6804 example. The second turns off any "+fast-redirects" action, allowing this to
6805 take place unmolested. Note that there is a leading dot here -- ".google.com".
6806 This will match any hosts and sub-domains, in the google.com domain also, such
6807 as "www.google.com" or "mail.google.com". But it would not match
6808 "www.google.de"! So, apparently, we have these two actions defined as
6809 exceptions to the general rules at the top somewhere in the lower part of our
6810 default.action file, and "google.com" is referenced somewhere in these latter
6813 Then, for our user.action file, we again have no hits. So there is nothing
6814 google-specific that we might have added to our own, local configuration. If
6815 there was, those actions would over-rule any actions from previously processed
6816 files, such as default.action. user.action typically has the last word. This is
6817 the best place to put hard and fast exceptions,
6819 And finally we pull it all together in the bottom section and summarize how
6820 Privoxy is applying all its "actions" to "google.com":
6826 -client-header-filter{hide-tor-exit-notation}
6827 -content-type-overwrite
6828 -crunch-client-header
6829 -crunch-if-none-match
6830 -crunch-incoming-cookies
6831 -crunch-outgoing-cookies
6832 -crunch-server-header
6833 +deanimate-gifs {last}
6834 -downgrade-http-version
6837 -filter {content-cookies}
6838 -filter {all-popups}
6839 -filter {banners-by-link}
6840 -filter {tiny-textforms}
6841 -filter {frameset-borders}
6842 -filter {demoronizer}
6843 -filter {shockwave-flash}
6844 -filter {quicktime-kioskmode}
6846 -filter {crude-parental}
6847 -filter {site-specifics}
6848 -filter {js-annoyances}
6849 -filter {html-annoyances}
6850 +filter {refresh-tags}
6851 -filter {unsolicited-popups}
6852 +filter {img-reorder}
6853 +filter {banners-by-size}
6855 +filter {jumping-windows}
6856 +filter {ie-exploits}
6863 -handle-as-empty-document
6865 -hide-accept-language
6866 -hide-content-disposition
6867 +hide-forwarded-for-headers
6868 +hide-from-header {block}
6869 -hide-if-modified-since
6870 +hide-referrer {forge}
6875 -overwrite-last-modified
6876 -prevent-compression
6880 -server-header-filter{xml-to-html}
6881 -server-header-filter{html-to-xml}
6882 -session-cookies-only
6883 +set-image-blocker {pattern}
6884 -treat-forbidden-connects-like-blocks
6887 Notice the only difference here to the previous listing, is to "fast-redirects"
6888 and "session-cookies-only", which are activated specifically for this site in
6889 our configuration, and thus show in the "Final Results".
6891 Now another example, "ad.doubleclick.net":
6899 { +block +handle-as-image }
6900 .[a-vx-z]*.doubleclick.net
6903 We'll just show the interesting part here - the explicit matches. It is matched
6904 three different times. Two "+block" sections, and a "+block +handle-as-image",
6905 which is the expanded form of one of our aliases that had been defined as:
6906 "+block-as-image". ("Aliases" are defined in the first section of the actions
6907 file and typically used to combine more than one action.)
6909 Any one of these would have done the trick and blocked this as an unwanted
6910 image. This is unnecessarily redundant since the last case effectively would
6911 also cover the first. No point in taking chances with these guys though ;-)
6912 Note that if you want an ad or obnoxious URL to be invisible, it should be
6913 defined as "ad.doubleclick.net" is done here -- as both a "+block" and an
6914 "+handle-as-image". The custom alias "+block-as-image" just simplifies the
6915 process and make it more readable.
6917 One last example. Let's try "http://www.example.net/adsl/HOWTO/". This one is
6918 giving us problems. We are getting a blank page. Hmmm ...
6920 Matches for http://www.example.net/adsl/HOWTO/:
6922 In file: default.action [ View ] [ Edit ]
6926 -client-header-filter{hide-tor-exit-notation}
6927 -content-type-overwrite
6928 -crunch-client-header
6929 -crunch-if-none-match
6930 -crunch-incoming-cookies
6931 -crunch-outgoing-cookies
6932 -crunch-server-header
6934 -downgrade-http-version
6935 +fast-redirects {check-decoded-url}
6937 -filter {content-cookies}
6938 -filter {all-popups}
6939 -filter {banners-by-link}
6940 -filter {tiny-textforms}
6941 -filter {frameset-borders}
6942 -filter {demoronizer}
6943 -filter {shockwave-flash}
6944 -filter {quicktime-kioskmode}
6946 -filter {crude-parental}
6947 -filter {site-specifics}
6948 -filter {js-annoyances}
6949 -filter {html-annoyances}
6950 +filter {refresh-tags}
6951 -filter {unsolicited-popups}
6952 +filter {img-reorder}
6953 +filter {banners-by-size}
6955 +filter {jumping-windows}
6956 +filter {ie-exploits}
6963 -handle-as-empty-document
6965 -hide-accept-language
6966 -hide-content-disposition
6967 +hide-forwarded-for-headers
6968 +hide-from-header{block}
6969 +hide-referer{forge}
6973 -overwrite-last-modified
6974 +prevent-compression
6978 -server-header-filter{xml-to-html}
6979 -server-header-filter{html-to-xml}
6980 +session-cookies-only
6981 +set-image-blocker{blank}
6982 -treat-forbidden-connects-like-blocks }
6985 { +block +handle-as-image }
6989 Ooops, the "/adsl/" is matching "/ads" in our configuration! But we did not
6990 want this at all! Now we see why we get the blank page. It is actually
6991 triggering two different actions here, and the effects are aggregated so that
6992 the URL is blocked, and Privoxy is told to treat the block as if it were an
6993 image. But this is, of course, all wrong. We could now add a new action below
6994 this (or better in our own user.action file) that explicitly un blocks ( "
6995 {-block}") paths with "adsl" in them (remember, last match in the configuration
6996 wins). There are various ways to handle such exceptions. Example:
7002 Now the page displays ;-) Remember to flush your browser's caches when making
7003 these kinds of changes to your configuration to insure that you get a freshly
7004 delivered page! Or, try using Shift+Reload.
7006 But now what about a situation where we get no explicit matches like we did
7009 { +block +handle-as-image }
7013 That actually was very helpful and pointed us quickly to where the problem was.
7014 If you don't get this kind of match, then it means one of the default rules in
7015 the first section of default.action is causing the problem. This would require
7016 some guesswork, and maybe a little trial and error to isolate the offending
7017 rule. One likely cause would be one of the "+filter" actions. These tend to be
7018 harder to troubleshoot. Try adding the URL for the site to one of aliases that
7023 .worldpay.com # for quietpc.com
7029 "{ shop }" is an "alias" that expands to "{ -filter -session-cookies-only }".
7030 Or you could do your own exception to negate filtering:
7033 # Disable ALL filter actions for sites in this section
7039 This would turn off all filtering for these sites. This is best put in
7040 user.action, for local site exceptions. Note that when a simple domain pattern
7041 is used by itself (without the subsequent path portion), all sub-pages within
7042 that domain are included automatically in the scope of the action.
7044 Images that are inexplicably being blocked, may well be hitting the "+filter
7045 {banners-by-size}" rule, which assumes that images of certain sizes are ad
7046 banners (works well most of the time since these tend to be standardized).
7048 "{ fragile }" is an alias that disables most actions that are the most likely
7049 to cause trouble. This can be used as a last resort for problem sites.
7052 # Handle with care: easy to break
7057 Remember to flush caches! Note that the mail.google reference lacks the TLD
7058 portion (e.g. ".com"). This will effectively match any TLD with google in it,
7059 such as mail.google.de., just as an example.
7061 If this still does not work, you will have to go through the remaining actions
7062 one by one to find which one(s) is causing the problem.