1 Privoxy 3.0.8 User Manual
3 [Copyright[ (c) 2001 - 2008 by Privoxy Developers]]
5 $Id: user-manual.txt,v 1.74 2008/01/19 21:41:37 hal9 Exp $
7 The Privoxy User Manual gives users information on how to install,
8 configure and use Privoxy.
10 Privoxy is a non-caching web proxy with advanced filtering capabilities
11 for enhancing privacy, modifying web page data, managing HTTP cookies,
12 controlling access, and removing ads, banners, pop-ups and other obnoxious
13 Internet junk. Privoxy has a flexible configuration and can be customized
14 to suit individual needs and tastes. Privoxy has application for both
15 stand-alone systems and multi-user networks.
17 Privoxy is based on Internet Junkbuster (tm).
19 You can find the latest version of the Privoxy User Manual at
20 http://www.privoxy.org/user-manual/. Please see the Contact section on how
21 to contact the developers.
23 --------------------------------------------------------------------------
35 2.1.1. Red Hat and Fedora RPMs
37 2.1.2. Debian and Ubuntu
53 2.2. Building from Source
55 2.3. Keeping your Installation Up-to-Date
57 3. What's New in this Release
59 3.1. Note to Upgraders
61 4. Quickstart to Using Privoxy
63 4.1. Quickstart to Ad Blocking
67 5.1. Red Hat and Fedora
73 5.4. Solaris, NetBSD, FreeBSD, HP-UX and others
83 5.9. Command Line Options
85 6. Privoxy Configuration
87 6.1. Controlling Privoxy with Your Web Browser
89 6.2. Configuration Files Overview
91 7. The Main Configuration File
93 7.1. Local Set-up Documentation
101 7.1.4. proxy-info-url
103 7.2. Configuration and Log File Locations
125 7.3.2. single-threaded
127 7.4. Access Control and Security
129 7.4.1. listen-address
133 7.4.3. enable-remote-toggle
135 7.4.4. enable-remote-http-toggle
137 7.4.5. enable-edit-actions
139 7.4.6. enforce-blocks
141 7.4.7. ACLs: permit-access and deny-access
149 7.5.2. forward-socks4 and forward-socks4a
151 7.5.3. Advanced Forwarding Examples
153 7.5.4. forwarded-connect-retries
155 7.5.5. accept-intercepted-requests
157 7.5.6. allow-cgi-request-crunching
159 7.5.7. split-large-forms
161 7.6. Windows GUI Options
165 8.1. Finding the Right Mix
169 8.3. How Actions are Applied to Requests
173 8.4.1. The Domain Pattern
175 8.4.2. The Path Pattern
177 8.4.3. The Tag Pattern
185 8.5.3. client-header-filter
187 8.5.4. client-header-tagger
189 8.5.5. content-type-overwrite
191 8.5.6. crunch-client-header
193 8.5.7. crunch-if-none-match
195 8.5.8. crunch-incoming-cookies
197 8.5.9. crunch-server-header
199 8.5.10. crunch-outgoing-cookies
201 8.5.11. deanimate-gifs
203 8.5.12. downgrade-http-version
205 8.5.13. fast-redirects
209 8.5.15. force-text-mode
211 8.5.16. forward-override
213 8.5.17. handle-as-empty-document
215 8.5.18. handle-as-image
217 8.5.19. hide-accept-language
219 8.5.20. hide-content-disposition
221 8.5.21. hide-if-modified-since
223 8.5.22. hide-forwarded-for-headers
225 8.5.23. hide-from-header
227 8.5.24. hide-referrer
229 8.5.25. hide-user-agent
231 8.5.26. inspect-jpegs
235 8.5.28. limit-connect
237 8.5.29. prevent-compression
239 8.5.30. overwrite-last-modified
243 8.5.32. send-vanilla-wafer
247 8.5.34. server-header-filter
249 8.5.35. server-header-tagger
251 8.5.36. session-cookies-only
253 8.5.37. set-image-blocker
255 8.5.38. treat-forbidden-connects-like-blocks
261 8.7. Actions Files Tutorial
263 8.7.1. default.action
269 9.1. Filter File Tutorial
271 9.2. The Pre-defined Filters
273 10. Privoxy's Template Files
275 11. Contacting the Developers, Bug Reporting and Feature Requests
279 11.2. Reporting Problems
281 11.2.1. Reporting Ads or Other Configuration
284 11.2.2. Reporting Bugs
286 11.3. Request New Features
290 12. Privoxy Copyright, License and History
302 14.1. Regular Expressions
304 14.2. Privoxy's Internal Pages
308 14.3. Chain of Events
310 14.4. Troubleshooting: Anatomy of an Action
314 This documentation is included with the current stable version of Privoxy,
317 --------------------------------------------------------------------------
321 In addition to the core features of ad blocking and cookie management,
322 Privoxy provides many supplemental features, that give the end-user more
323 control, more privacy and more freedom:
325 * Can be run as an "intercepting" proxy, which obviates the need to
326 configure browsers individually.
328 * Sophisticated actions and filters for manipulating both server and
331 * Can be chained with other proxies.
333 * Integrated browser based configuration and control utility at
334 http://config.privoxy.org/ (shortcut: http://p.p/). Browser-based
335 tracing of rule and filter effects. Remote toggling.
337 * Web page filtering (text replacements, removes banners based on size,
338 invisible "web-bugs", JavaScript and HTML annoyances, pop-up windows,
341 * Modularized configuration that allows for standard settings and user
342 settings to reside in separate files, so that installing updated
343 actions files won't overwrite individual user settings.
345 * Support for Perl Compatible Regular Expressions in the configuration
346 files, and a more sophisticated and flexible configuration syntax.
348 * Improved cookie management features (e.g. session based cookies).
352 * Bypass many click-tracking scripts (avoids script redirection).
354 * Multi-threaded (POSIX and native threads).
356 * User-customizable HTML templates for all proxy-generated pages (e.g.
359 * Auto-detection and re-reading of config file changes.
361 * Improved signal handling, and a true daemon mode (Unix).
363 * Every feature now controllable on a per-site or per-location basis,
364 configuration more powerful and versatile over-all.
366 * Many smaller new features added, limitations and bugs removed, and
367 security holes fixed.
369 --------------------------------------------------------------------------
373 Privoxy is available both in convenient pre-compiled packages for a wide
374 range of operating systems, and as raw source code. For most users, we
375 recommend using the packages, which can be downloaded from our Privoxy
378 Note: On some platforms, the installer may remove previously installed
379 versions, if found. (See below for your platform). In any case be sure to
380 backup your old configuration if it is valuable to you. See the note to
381 upgraders section below.
383 --------------------------------------------------------------------------
387 How to install the binary packages depends on your operating system:
389 --------------------------------------------------------------------------
391 2.1.1. Red Hat and Fedora RPMs
393 RPMs can be installed with rpm -Uvh privoxy-3.0.8-1.rpm, and will use
394 /etc/privoxy for the location of configuration files.
396 Note that on Red Hat, Privoxy will not be automatically started on system
397 boot. You will need to enable that using chkconfig, ntsysv, or similar
400 If you have problems with failed dependencies, try rebuilding the SRC RPM:
401 rpm --rebuild privoxy-3.0.8-1.src.rpm. This will use your locally
402 installed libraries and RPM version.
404 Also note that if you have a Junkbuster RPM installed on your system, you
405 need to remove it first, because the packages conflict. Otherwise, RPM
406 will try to remove Junkbuster automatically if found, before installing
409 --------------------------------------------------------------------------
411 2.1.2. Debian and Ubuntu
413 DEBs can be installed with apt-get install privoxy, and will use
414 /etc/privoxy for the location of configuration files.
416 --------------------------------------------------------------------------
420 Just double-click the installer, which will guide you through the
421 installation process. You will find the configuration files in the same
422 directory as you installed Privoxy in.
424 Version 3.0.5 beta introduced full Windows service functionality. On
425 Windows only, the Privoxy program has two new command line arguments to
426 install and uninstall Privoxy as a service.
430 --install[:service_name]
432 --uninstall[:service_name]
434 After invoking Privoxy with --install, you will need to bring up the
435 Windows service console to assign the user you want Privoxy to run under,
436 and whether or not you want it to run whenever the system starts. You can
437 start the Windows services console with the following command:
438 services.msc. If you do not take the manual step of modifying Privoxy's
439 service settings, it will not start. Note too that you will need to give
440 Privoxy a user account that actually exists, or it will not be permitted
441 to write to its log and configuration files.
443 --------------------------------------------------------------------------
447 Create a new directory, cd to it, then unzip and untar the archive. For
448 the most part, you'll have to figure out where things go.
450 --------------------------------------------------------------------------
454 First, make sure that no previous installations of Junkbuster and / or
455 Privoxy are left on your system. Check that no Junkbuster or Privoxy
456 objects are in your startup folder.
458 Then, just double-click the WarpIN self-installing archive, which will
459 guide you through the installation process. A shadow of the Privoxy
460 executable will be placed in your startup folder so it will start
461 automatically whenever OS/2 starts.
463 The directory you choose to install Privoxy into will contain all of the
466 --------------------------------------------------------------------------
470 Unzip the downloaded file (you can either double-click on the file from
471 the finder, or from the desktop if you downloaded it there). Then,
472 double-click on the package installer icon named Privoxy.pkg and follow
473 the installation process. Privoxy will be installed in the folder
474 /Library/Privoxy. It will start automatically whenever you start up. To
475 prevent it from starting automatically, remove or rename the folder
476 /Library/StartupItems/Privoxy.
478 To start Privoxy by hand, double-click on StartPrivoxy.command in the
479 /Library/Privoxy folder. Or, type this command in the Terminal:
481 /Library/Privoxy/StartPrivoxy.command
484 You will be prompted for the administrator password.
486 --------------------------------------------------------------------------
490 Copy and then unpack the lha archive to a suitable location. All necessary
491 files will be installed into Privoxy directory, including all
492 configuration and log files. To uninstall, just remove this directory.
494 --------------------------------------------------------------------------
498 Privoxy is part of FreeBSD's Ports Collection, you can build and install
499 it with cd /usr/ports/www/privoxy; make install clean.
501 If you don't use the ports, you can fetch and install the package with
504 The port skeleton and the package can also be downloaded from the File
505 Release Page, but there's no reason to use them unless you're interested
506 in the beta releases which are only available there.
508 --------------------------------------------------------------------------
512 Gentoo source packages (Ebuilds) for Privoxy are contained in the Gentoo
513 Portage Tree (they are not on the download page, but there is a Gentoo
514 section, where you can see when a new Privoxy Version is added to the
517 Before installing Privoxy under Gentoo just do first emerge rsync to get
518 the latest changes from the Portage tree. With emerge privoxy you install
521 Configuration files are in /etc/privoxy, the documentation is in
522 /usr/share/doc/privoxy-3.0.8 and the Log directory is in /var/log/privoxy.
524 --------------------------------------------------------------------------
526 2.2. Building from Source
528 The most convenient way to obtain the Privoxy sources is to download the
529 source tarball from our project download page.
531 If you like to live on the bleeding edge and are not afraid of using
532 possibly unstable development versions, you can check out the
533 up-to-the-minute version directly from the CVS repository.
535 To build Privoxy from source, autoconf, GNU make (gmake), and, of course,
536 a C compiler like gcc are required.
538 When building from a source tarball, first unpack the source:
540 tar xzvf privoxy-3.0.8-src* [.tgz or .tar.gz]
543 For retrieving the current CVS sources, you'll need a CVS client
544 installed. Note that sources from CVS are typically development quality,
545 and may not be stable, or well tested. To download CVS source, check the
546 Sourceforge documentation, which might give commands like:
548 cvs -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa login
549 cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co current
552 This will create a directory named current/, which will contain the source
555 You can also check out any Privoxy "branch", just exchange the current
556 name with the wanted branch name (Example: v_3_0_branch for the 3.0 cvs
559 It is also strongly recommended to not run Privoxy as root. You should
560 configure/install/run Privoxy as an unprivileged user, preferably by
561 creating a "privoxy" user and group just for this purpose. See your local
562 documentation for the correct command line to do add new users and groups
563 (something like adduser, but the command syntax may vary from platform to
566 /etc/passwd might then look like:
568 privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell
570 And then /etc/group, like:
574 Some binary packages may do this for you.
576 Then, to build from either unpacked tarball or CVS source:
580 ./configure # (--help to see options)
581 make # (the make from GNU, sometimes called gmake)
582 su # Possibly required
583 make -n install # (to see where all the files will go)
584 make -s install # (to really install, -s to silence output)
586 Using GNU make, you can have the first four steps automatically done for
591 in the freshly downloaded or unpacked source directory.
593 To build an executable with security enhanced features so that users
594 cannot easily bypass the proxy (e.g. "Go There Anyway"), or alter their
595 own configurations, configure like this:
597 ./configure --disable-toggle --disable-editor --disable-force
599 Then build as above. In Privoxy 3.0.7 and later, all of these options can
600 also be disabled through the configuration file.
602 WARNING: If installing as root, the install will fail unless a non-root
603 user or group is specified, or a privoxy user and group already exist on
604 the system. If a non-root user is specified, and no group, then the
605 installation will try to also use a group of the same name as "user". If a
606 group is specified (and no user), then the support files will be installed
607 as writable by that group, and owned by the user running the installation.
609 configure accepts --with-user and --with-group options for setting user
610 and group ownership of the configuration files (which need to be writable
611 by the daemon). The specified user must already exist. When starting
612 Privoxy, it must be run as this same user to insure write access to
613 configuration and log files!
615 Alternately, you can specify user and group on the make command line, but
616 be sure both already exist:
618 make -s install USER=privoxy GROUP=privoxy
620 The default installation path for make install is /usr/local. This may of
621 course be customized with the various ./configure path options. If you are
622 doing an install to anywhere besides /usr/local, be sure to set the
623 appropriate paths with the correct configure options (./configure --help).
624 Non-privileged users must of course have write access permissions to
625 wherever the target installation is going.
627 If you do install to /usr/local, the install will use
628 sysconfdir=$prefix/etc/privoxy by default. All other destinations, and the
629 direct usage of --sysconfdir flag behave like normal, i.e. will not add
630 the extra privoxy directory. This is for a safer install, as there may
631 already exist another program that uses a file with the "config" name, and
632 thus makes /usr/local/etc cleaner.
634 If installing to /usr/local, the documentation will go by default to
635 $prefix/share/doc. But if this directory doesn't exist, it will then try
636 $prefix/doc and install there before creating a new $prefix/share/doc just
639 Again, if the installs goes to /usr/local, the localstatedir (ie: var/)
640 will default to /var instead of $prefix/var so the logs will go to
641 /var/log/privoxy/, and the pid file will be created in
642 /var/run/privoxy.pid.
644 make install will attempt to set the correct values in config (main
645 configuration file). You should check this to make sure all values are
646 correct. If appropriate, an init script will be installed, but it is up to
647 the user to determine how and where to start Privoxy. The init script
648 should be checked for correct paths and values, if anything other than a
649 default install is done.
651 If install finds previous versions of local configuration files, most of
652 these will not be overwritten, and the new ones will be installed with a
653 "new" extension. default.action, default.filter, and standard.action will
654 be overwritten. You will then need to manually update the other installed
655 configuration files as needed. The default template files will be
656 overwritten. If you have customized, local templates, these should be
657 stored safely in a separate directory and defined in config by the
658 "templdir" directive. It is of course wise to always back-up any important
659 configuration files "just in case". If a previous version of Privoxy is
660 already running, you will have to restart it manually.
662 For more detailed instructions on how to build Redhat RPMs, Windows
663 self-extracting installers, building on platforms with special
664 requirements etc, please consult the developer manual.
666 --------------------------------------------------------------------------
668 2.3. Keeping your Installation Up-to-Date
670 As user feedback comes in and development continues, we will make updated
671 versions of both the main actions file (as a separate package) and the
672 software itself (including the actions file) available for download.
674 If you wish to receive an email notification whenever we release updates
675 of Privoxy or the actions file, subscribe to our announce mailing list,
676 ijbswa-announce@lists.sourceforge.net.
678 In order not to lose your personal changes and adjustments when updating
679 to the latest default.action file we strongly recommend that you use
680 user.action and user.filter for your local customizations of Privoxy. See
681 the Chapter on actions files for details.
683 --------------------------------------------------------------------------
685 3. What's New in this Release
687 There are many improvements and new features since Privoxy 3.0.6, the last
690 * Two new actions server-header-tagger and client-header-tagger that can
691 be used to create arbitrary "tags" based on client and server headers.
692 These "tags" can then subsequently be used to control the other
693 actions used for the current request, greatly increasing Privoxy's
694 flexibility and selectivity. See tag patterns for more information on
697 * Header filtering is done with dedicated header filters now. As a
698 result the actions "filter-client-headers" and "filter-server-headers"
699 that were introduced with Privoxy 3.0.5 to apply content filters to
700 the headers have been removed. See the new actions
701 server-header-filter and client-header-filter for details.
703 * There are four new options for the main config file:
705 * allow-cgi-request-crunching which allows requests for Privoxy's
706 internal CGI pages to be blocked, redirected or (un)trusted like
709 * split-large-forms that will work around a browser bug that caused
710 IE6 and IE7 to ignore the Submit button on the Privoxy's
711 edit-actions-for-url CGI page.
713 * accept-intercepted-requests which allows to combine Privoxy with
714 any packet filter to create an intercepting proxy for HTTP/1.1
715 requests (and for HTTP/1.0 requests with Host header set). This
716 means clients can be forced to use Privoxy even if their proxy
717 settings are configured differently.
719 * templdir to designate an alternate location for Privoxy's locally
720 customized CGI templates so that these are not overwritten during
723 * A new command line option --pre-chroot-nslookup hostname to initialize
724 the resolver library before chroot'ing. On some systems this reduces
725 the number of files that must be copied into the chroot tree. (Patch
726 provided by Stephen Gildea)
728 * The forward-override action allows changing of the forwarding settings
729 through the actions files. Combined with tags, this allows to choose
730 the forwarder based on client headers like the User-Agent, or the
733 * The redirect action can now use regular expression substitutions
734 against the original URL.
736 * zlib support is now available as a compile time option to filter
737 compressed content. Patch provided by Wil Mahan.
739 * Improve various filters, and add new ones.
741 * Include support for RFC 3253 so that Subversion works with Privoxy.
742 Patch provided by Petr Kadlec.
744 * Logging can be completely turned off by not specifying a logfile
747 * A number of improvements to Privoxy's internal CGI pages, including
748 the use of favicons for error and control pages.
750 * Many bugfixes, memory leaks addressed, code improvements, and logging
753 For a more detailed list of changes please have a look at the ChangeLog.
755 --------------------------------------------------------------------------
757 3.1. Note to Upgraders
759 A quick list of things to be aware of before upgrading from earlier
762 * The recommended way to upgrade Privoxy is to backup your old
763 configuration files, install the new ones, verify that Privoxy is
764 working correctly and finally merge back your changes using diff and
767 There are a number of new features in each Privoxy release and most of
768 them have to be explicitly enabled in the configuration files. Old
769 configuration files obviously don't do that and due to syntax changes
770 using old configuration files with a new Privoxy isn't always possible
773 * Note that some installers remove earlier versions completely,
774 including configuration files, therefore you should really save any
775 important configuration files!
777 * On the other hand, other installers don't overwrite existing
778 configuration files, thinking you will want to do that yourself.
780 * standard.action now only includes the enabled actions. Not all actions
783 * In the default configuration only fatal errors are logged now. You can
784 change that in the debug section of the configuration file. You may
785 also want to enable more verbose logging until you verified that the
786 new Privoxy version is working as expected.
788 * Three other config file settings are now off by default:
789 enable-remote-toggle, enable-remote-http-toggle, and
790 enable-edit-actions. If you use or want these, you will need to
791 explicitly enable them, and be aware of the security issues involved.
793 * The "filter-client-headers" and "filter-server-headers" actions that
794 were introduced with Privoxy 3.0.5 to apply content filters to the
795 headers have been removed and replaced with new actions. See the
796 What's New section above.
798 --------------------------------------------------------------------------
800 4. Quickstart to Using Privoxy
802 * Install Privoxy. See the Installation Section below for platform
803 specific information.
805 * Advanced users and those who want to offer Privoxy service to more
806 than just their local machine should check the main config file,
807 especially the security-relevant options. These are off by default.
809 * Start Privoxy, if the installation program has not done this already
810 (may vary according to platform). See the section Starting Privoxy.
812 * Set your browser to use Privoxy as HTTP and HTTPS (SSL) proxy by
813 setting the proxy configuration for address of 127.0.0.1 and port
814 8118. DO NOT activate proxying for FTP or any protocols besides HTTP
815 and HTTPS (SSL) unless you intend to prevent your browser from using
818 * Flush your browser's disk and memory caches, to remove any cached ad
819 images. If using Privoxy to manage cookies, you should remove any
820 currently stored cookies too.
822 * A default installation should provide a reasonable starting point for
823 most. There will undoubtedly be occasions where you will want to
824 adjust the configuration, but that can be dealt with as the need
825 arises. Little to no initial configuration is required in most cases,
826 you may want to enable the web-based action editor though. Be sure to
827 read the warnings first.
829 See the Configuration section for more configuration options, and how
830 to customize your installation. You might also want to look at the
831 next section for a quick introduction to how Privoxy blocks ads and
834 * If you experience ads that slip through, innocent images that are
835 blocked, or otherwise feel the need to fine-tune Privoxy's behavior,
836 take a look at the actions files. As a quick start, you might find the
837 richly commented examples helpful. You can also view and edit the
838 actions files through the web-based user interface. The Appendix
839 "Troubleshooting: Anatomy of an Action" has hints on how to understand
840 and debug actions that "misbehave".
842 * Please see the section Contacting the Developers on how to report
843 bugs, problems with websites or to get help.
845 * Now enjoy surfing with enhanced control, comfort and privacy!
847 --------------------------------------------------------------------------
849 4.1. Quickstart to Ad Blocking
851 Ad blocking is but one of Privoxy's array of features. Many of these
852 features are for the technically minded advanced user. But, ad and banner
853 blocking is surely common ground for everybody.
855 This section will provide a quick summary of ad blocking so you can get up
856 to speed quickly without having to read the more extensive information
857 provided below, though this is highly recommended.
859 First a bit of a warning ... blocking ads is much like blocking SPAM: the
860 more aggressive you are about it, the more likely you are to block things
861 that were not intended. And the more likely that some things may not work
862 as intended. So there is a trade off here. If you want extreme ad free
863 browsing, be prepared to deal with more "problem" sites, and to spend more
864 time adjusting the configuration to solve these unintended consequences.
865 In short, there is not an easy way to eliminate all ads. Either take the
866 easy way and settle for most ads blocked with the default configuration,
867 or jump in and tweak it for your personal surfing habits and preferences.
869 Secondly, a brief explanation of Privoxy's "actions". "Actions" in this
870 context, are the directives we use to tell Privoxy to perform some task
871 relating to HTTP transactions (i.e. web browsing). We tell Privoxy to take
872 some "action". Each action has a unique name and function. While there are
873 many potential actions in Privoxy's arsenal, only a few are used for ad
874 blocking. Actions, and action configuration files, are explained in depth
877 Actions are specified in Privoxy's configuration, followed by one or more
878 URLs to which the action should apply. URLs can actually be URL type
879 patterns that use wildcards so they can apply potentially to a range of
880 similar URLs. The actions, together with the URL patterns are called a
883 When you connect to a website, the full URL will either match one or more
884 of the sections as defined in Privoxy's configuration, or not. If so, then
885 Privoxy will perform the respective actions. If not, then nothing special
886 happens. Furthermore, web pages may contain embedded, secondary URLs that
887 your web browser will use to load additional components of the page, as it
888 parses the original page's HTML content. An ad image for instance, is just
889 an URL embedded in the page somewhere. The image itself may be on the same
890 server, or a server somewhere else on the Internet. Complex web pages will
891 have many such embedded URLs. Privoxy can deal with each URL individually,
892 so, for instance, the main page text is not touched, but images from
893 such-and-such server are blocked.
895 The most important actions for basic ad blocking are: block,
896 handle-as-image, handle-as-empty-document,and set-image-blocker:
898 * block - this is perhaps the single most used action, and is
899 particularly important for ad blocking. This action stops any contact
900 between your browser and any URL patterns that match this action's
901 configuration. It can be used for blocking ads, but also anything that
902 is determined to be unwanted. By itself, it simply stops any
903 communication with the remote server and sends Privoxy's own built-in
904 BLOCKED page instead to let you now what has happened (with some
905 exceptions, see below).
907 * handle-as-image - tells Privoxy to treat this URL as an image.
908 Privoxy's default configuration already does this for all common image
909 types (e.g. GIF), but there are many situations where this is not so
910 easy to determine. So we'll force it in these cases. This is
911 particularly important for ad blocking, since only if we know that
912 it's an image of some kind, can we replace it with an image of our
913 choosing, instead of the Privoxy BLOCKED page (which would only result
914 in a "broken image" icon). There are some limitations to this though.
915 For instance, you can't just brute-force an image substitution for an
916 entire HTML page in most situations.
918 * handle-as-empty-document - sends an empty document instead of
919 Privoxy's normal BLOCKED HTML page. This is useful for file types that
920 are neither HTML nor images, such as blocking JavaScript files.
922 * set-image-blocker - tells Privoxy what to display in place of an ad
923 image that has hit a block rule. For this to come into play, the URL
924 must match a block action somewhere in the configuration, and, it must
925 also match an handle-as-image action.
927 The configuration options on what to display instead of the ad are:
929 pattern - a checkerboard pattern, so that an ad replacement is
930 obvious. This is the default.
932 blank - A very small empty GIF image is displayed. This is the
933 so-called "invisible" configuration option.
935 http://<URL> - A redirect to any image anywhere of the user's
936 choosing (advanced usage).
938 Advanced users will eventually want to explore Privoxy filters as well.
939 Filters are very different from blocks. A "block" blocks a site, page, or
940 unwanted contented. Filters are a way of filtering or modifying what is
941 actually on the page. An example filter usage: a text replacement of
942 "no-no" for "nasty-word". That is a very simple example. This process can
943 be used for ad blocking, but it is more in the realm of advanced usage and
944 has some pitfalls to be wary off.
946 The quickest way to adjust any of these settings is with your browser
947 through the special Privoxy editor at
948 http://config.privoxy.org/show-status (shortcut: http://p.p/show-status).
949 This is an internal page, and does not require Internet access.
951 Note that as of Privoxy 3.0.7 beta the action editor is disabled by
952 default. Check the enable-edit-actions section in the configuration file
953 to learn why and in which cases it's safe to enable again.
955 If you decided to enable the action editor, select the appropriate
956 "actions" file, and click "Edit". It is best to put personal or local
957 preferences in user.action since this is not meant to be overwritten
958 during upgrades, and will over-ride the settings in other files. Here you
959 can insert new "actions", and URLs for ad blocking or other purposes, and
960 make other adjustments to the configuration. Privoxy will detect these
961 changes automatically.
963 A quick and simple step by step example:
965 * Right click on the ad image to be blocked, then select "Copy Link
966 Location" from the pop-up menu.
968 * Set your browser to http://config.privoxy.org/show-status
970 * Find user.action in the top section, and click on "Edit":
972 Figure 1. Actions Files in Use
974 * You should have a section with only block listed under "Actions:". If
975 not, click a "Insert new section below" button, and in the new section
976 that just appeared, click the Edit button right under the word
977 "Actions:". This will bring up a list of all actions. Find block near
978 the top, and click in the "Enabled" column, then "Submit" just below
981 * Now, in the block actions section, click the "Add" button, and paste
982 the URL the browser got from "Copy Link Location". Remove the http://
983 at the beginning of the URL. Then, click "Submit" (or "OK" if in a
986 * Now go back to the original page, and press SHIFT-Reload (or flush all
987 browser caches). The image should be gone now.
989 This is a very crude and simple example. There might be good reasons to
990 use a wildcard pattern match to include potentially similar images from
991 the same site. For a more extensive explanation of "patterns", and the
992 entire actions concept, see the Actions section.
994 For advanced users who want to hand edit their config files, you might
995 want to now go to the Actions Files Tutorial. The ideas explained therein
996 also apply to the web-based editor.
998 There are also various filters that can be used for ad blocking (filters
999 are a special subset of actions). These fall into the "advanced" usage
1000 category, and are explained in depth in later sections.
1002 --------------------------------------------------------------------------
1006 Before launching Privoxy for the first time, you will want to configure
1007 your browser(s) to use Privoxy as a HTTP and HTTPS (SSL) proxy. The
1008 default is 127.0.0.1 (or localhost) for the proxy address, and port 8118
1009 (earlier versions used port 8000). This is the one configuration step that
1012 Please note that Privoxy can only proxy HTTP and HTTPS traffic. It will
1013 not work with FTP or other protocols.
1015 Figure 2. Proxy Configuration Showing Mozilla/Netscape HTTP and HTTPS
1018 With Firefox, this is typically set under:
1020 Tools -> Options -> Advanced -> Network ->Connection -> Settings
1023 Or optionally on some platforms:
1025 Edit -> Preferences -> General -> Connection Settings -> Manual Proxy
1029 With Netscape (and Mozilla), this can be set under:
1031 Edit -> Preferences -> Advanced -> Proxies -> HTTP Proxy
1034 For Internet Explorer v.5-7:
1036 Tools -> Internet Options -> Connections -> LAN Settings
1038 Then, check "Use Proxy" and fill in the appropriate info (Address:
1039 127.0.0.1, Port: 8118). Include HTTPS (SSL), if you want HTTPS proxy
1040 support too (sometimes labeled "Secure"). Make sure any checkboxes like
1041 "Use the same proxy server for all protocols" is UNCHECKED. You want only
1042 HTTP and HTTPS (SSL)!
1044 Figure 3. Proxy Configuration Showing Internet Explorer HTTP and HTTPS
1047 After doing this, flush your browser's disk and memory caches to force a
1048 re-reading of all pages and to get rid of any ads that may be cached.
1049 Remove any cookies, if you want Privoxy to manage that. You are now ready
1050 to start enjoying the benefits of using Privoxy!
1052 Privoxy itself is typically started by specifying the main configuration
1053 file to be used on the command line. If no configuration file is specified
1054 on the command line, Privoxy will look for a file named config in the
1055 current directory. Except on Win32 where it will try config.txt.
1057 --------------------------------------------------------------------------
1059 5.1. Red Hat and Fedora
1061 A default Red Hat installation may not start Privoxy upon boot. It will
1062 use the file /etc/privoxy/config as its main configuration file.
1064 # /etc/rc.d/init.d/privoxy start
1068 # service privoxy start
1070 --------------------------------------------------------------------------
1074 We use a script. Note that Debian typically starts Privoxy upon booting
1075 per default. It will use the file /etc/privoxy/config as its main
1078 # /etc/init.d/privoxy start
1080 --------------------------------------------------------------------------
1084 Click on the Privoxy Icon to start Privoxy. If no configuration file is
1085 specified on the command line, Privoxy will look for a file named
1086 config.txt. Note that Windows will automatically start Privoxy when the
1087 system starts if you chose that option when installing.
1089 Privoxy can run with full Windows service functionality. On Windows only,
1090 the Privoxy program has two new command line arguments to install and
1091 uninstall Privoxy as a service. See the Windows Installation instructions
1094 --------------------------------------------------------------------------
1096 5.4. Solaris, NetBSD, FreeBSD, HP-UX and others
1098 Example Unix startup command:
1100 # /usr/sbin/privoxy /etc/privoxy/config
1102 --------------------------------------------------------------------------
1106 During installation, Privoxy is configured to start automatically when the
1107 system restarts. You can start it manually by double-clicking on the
1108 Privoxy icon in the Privoxy folder.
1110 --------------------------------------------------------------------------
1114 During installation, Privoxy is configured to start automatically when the
1115 system restarts. To start Privoxy manually, double-click on the
1116 StartPrivoxy.command icon in the /Library/Privoxy folder. Or, type this
1117 command in the Terminal:
1119 /Library/Privoxy/StartPrivoxy.command
1122 You will be prompted for the administrator password.
1124 --------------------------------------------------------------------------
1128 Start Privoxy (with RUN <>NIL:) in your startnet script (AmiTCP), in
1129 s:user-startup (RoadShow), as startup program in your startup script
1130 (Genesis), or as startup action (Miami and MiamiDx). Privoxy will
1131 automatically quit when you quit your TCP/IP stack (just ignore the
1132 harmless warning your TCP/IP stack may display that Privoxy is still
1135 --------------------------------------------------------------------------
1139 A script is again used. It will use the file /etc/privoxy/config as its
1140 main configuration file.
1142 /etc/init.d/privoxy start
1145 Note that Privoxy is not automatically started at boot time by default.
1146 You can change this with the rc-update command.
1148 rc-update add privoxy default
1151 --------------------------------------------------------------------------
1153 5.9. Command Line Options
1155 Privoxy may be invoked with the following command-line options:
1159 Print version info and exit. Unix only.
1163 Print short usage info and exit. Unix only.
1167 Don't become a daemon, i.e. don't fork and become process group
1168 leader, and don't detach from controlling tty. Unix only.
1172 On startup, write the process ID to FILE. Delete the FILE on exit.
1173 Failure to create or delete the FILE is non-fatal. If no FILE option
1174 is given, no PID file will be used. Unix only.
1176 * --user USER[.GROUP]
1178 After (optionally) writing the PID file, assume the user ID of USER,
1179 and if included the GID of GROUP. Exit if the privileges are not
1180 sufficient to do so. Unix only.
1184 Before changing to the user ID given in the --user option, chroot to
1185 that user's home directory, i.e. make the kernel pretend to the
1186 Privoxy process that the directory tree starts there. If set up
1187 carefully, this can limit the impact of possible vulnerabilities in
1188 Privoxy to the files contained in that hierarchy. Unix only.
1190 * --pre-chroot-nslookup hostname
1192 Specifies a hostname to look up before doing a chroot. On some
1193 systems, initializing the resolver library involves reading config
1194 files from /etc and/or loading additional shared libraries from /lib.
1195 On these systems, doing a hostname lookup before the chroot reduces
1196 the number of files that must be copied into the chroot tree.
1198 For fastest startup speed, a good value is a hostname that is not in
1199 /etc/hosts but that your local name server (listed in
1200 /etc/resolv.conf) can resolve without recursion (that is, without
1201 having to ask any other name servers). The hostname need not exist,
1202 but if it doesn't, an error message (which can be ignored) will be
1207 If no configfile is included on the command line, Privoxy will look
1208 for a file named "config" in the current directory (except on Win32
1209 where it will look for "config.txt" instead). Specify full path to
1210 avoid confusion. If no config file is found, Privoxy will fail to
1213 On MS Windows only there are two additional command-line options to allow
1214 Privoxy to install and run as a service. See the Window Installation
1215 section for details.
1217 --------------------------------------------------------------------------
1219 6. Privoxy Configuration
1221 All Privoxy configuration is stored in text files. These files can be
1222 edited with a text editor. Many important aspects of Privoxy can also be
1223 controlled easily with a web browser.
1225 --------------------------------------------------------------------------
1227 6.1. Controlling Privoxy with Your Web Browser
1229 Privoxy's user interface can be reached through the special URL
1230 http://config.privoxy.org/ (shortcut: http://p.p/), which is a built-in
1231 page and works without Internet access. You will see the following
1238 sB View & change the current configuration
1240 sB View the source code version numbers
1242 sB View the request headers.
1244 sB Look up which actions apply to a URL and why
1246 sB Toggle Privoxy on or off
1251 This should be self-explanatory. Note the first item leads to an editor
1252 for the actions files, which is where the ad, banner, cookie, and URL
1253 blocking magic is configured as well as other advanced features of
1254 Privoxy. This is an easy way to adjust various aspects of Privoxy
1255 configuration. The actions file, and other configuration files, are
1256 explained in detail below.
1258 "Toggle Privoxy On or Off" is handy for sites that might have problems
1259 with your current actions and filters. You can in fact use it as a test to
1260 see whether it is Privoxy causing the problem or not. Privoxy continues to
1261 run as a proxy in this case, but all manipulation is disabled, i.e.
1262 Privoxy acts like a normal forwarding proxy. There is even a toggle
1263 Bookmarklet offered, so that you can toggle Privoxy with one click from
1266 Note that several of the features described above are disabled by default
1267 in Privoxy 3.0.7 beta and later. Check the configuration file to learn why
1268 and in which cases it's safe to enable them again.
1270 --------------------------------------------------------------------------
1272 6.2. Configuration Files Overview
1274 For Unix, *BSD and Linux, all configuration files are located in
1275 /etc/privoxy/ by default. For MS Windows, OS/2, and AmigaOS these are all
1276 in the same directory as the Privoxy executable.
1278 The installed defaults provide a reasonable starting point, though some
1279 settings may be aggressive by some standards. For the time being, the
1280 principle configuration files are:
1282 * The main configuration file is named config on Linux, Unix, BSD, OS/2,
1283 and AmigaOS and config.txt on Windows. This is a required file.
1285 * default.action (the main actions file) is used to define which
1286 "actions" relating to banner-blocking, images, pop-ups, content
1287 modification, cookie handling etc should be applied by default. It
1288 also defines many exceptions (both positive and negative) from this
1289 default set of actions that enable Privoxy to selectively eliminate
1290 the junk, and only the junk, on as many websites as possible.
1292 Multiple actions files may be defined in config. These are processed
1293 in the order they are defined. Local customizations and locally
1294 preferred exceptions to the default policies as defined in
1295 default.action (which you will most probably want to define sooner or
1296 later) are probably best applied in user.action, where you can
1297 preserve them across upgrades. standard.action is only for Privoxy's
1300 There is also a web based editor that can be accessed from
1301 http://config.privoxy.org/show-status (Shortcut:
1302 http://p.p/show-status) for the various actions files.
1304 * "Filter files" (the filter file) can be used to re-write the raw page
1305 content, including viewable text as well as embedded HTML and
1306 JavaScript, and whatever else lurks on any given web page. The
1307 filtering jobs are only pre-defined here; whether to apply them or not
1308 is up to the actions files. default.filter includes various filters
1309 made available for use by the developers. Some are much more intrusive
1310 than others, and all should be used with caution. You may define
1311 additional filter files in config as you can with actions files. We
1312 suggest user.filter for any locally defined filters or customizations.
1314 The syntax of the configuration and filter files may change between
1315 different Privoxy versions, unfortunately some enhancements cost backwards
1318 All files use the "#" character to denote a comment (the rest of the line
1319 will be ignored) and understand line continuation through placing a
1320 backslash ("\") as the very last character in a line. If the # is preceded
1321 by a backslash, it looses its special function. Placing a # in front of an
1322 otherwise valid configuration line to prevent it from being interpreted is
1323 called "commenting out" that line. Blank lines are ignored.
1325 The actions files and filter files can use Perl style regular expressions
1326 for maximum flexibility.
1328 After making any changes, there is no need to restart Privoxy in order for
1329 the changes to take effect. Privoxy detects such changes automatically.
1330 Note, however, that it may take one or two additional requests for the
1331 change to take effect. When changing the listening address of Privoxy,
1332 these "wake up" requests must obviously be sent to the old listening
1335 --------------------------------------------------------------------------
1337 7. The Main Configuration File
1339 Again, the main configuration file is named config on Linux/Unix/BSD and
1340 OS/2, and config.txt on Windows. Configuration lines consist of an initial
1341 keyword followed by a list of values, all separated by whitespace (any
1342 number of spaces or tabs). For example:
1344 confdir /etc/privoxy
1346 Assigns the value /etc/privoxy to the option confdir and thus indicates
1347 that the configuration directory is named "/etc/privoxy/".
1349 All options in the config file except for confdir and logdir are optional.
1350 Watch out in the below description for what happens if you leave them
1353 The main config file controls all aspects of Privoxy's operation that are
1354 not location dependent (i.e. they apply universally, no matter where you
1357 --------------------------------------------------------------------------
1359 7.1. Local Set-up Documentation
1361 If you intend to operate Privoxy for more users than just yourself, it
1362 might be a good idea to let them know how to reach you, what you block and
1363 why you do that, your policies, etc.
1365 --------------------------------------------------------------------------
1371 Location of the Privoxy User Manual.
1375 A fully qualified URI
1383 http://www.privoxy.org/version/user-manual/ will be used, where
1384 version is the Privoxy version.
1388 The User Manual URI is the single best source of information on
1389 Privoxy, and is used for help links from some of the internal CGI
1390 pages. The manual itself is normally packaged with the binary
1391 distributions, so you probably want to set this to a locally
1396 The best all purpose solution is simply to put the full local PATH
1397 to where the User Manual is located:
1399 user-manual /usr/share/doc/privoxy/user-manual
1401 The User Manual is then available to anyone with access to
1402 Privoxy, by following the built-in URL:
1403 http://config.privoxy.org/user-manual/ (or the shortcut:
1404 http://p.p/user-manual/).
1406 If the documentation is not on the local system, it can be
1407 accessed from a remote server, as:
1409 user-manual http://example.com/privoxy/user-manual/
1411 +---------------------------------------------------------+
1413 |---------------------------------------------------------|
1414 | If set, this option should be the first option in the |
1415 | config file, because it is used while the config file |
1416 | is being read on start-up. |
1417 +---------------------------------------------------------+
1419 --------------------------------------------------------------------------
1421 7.1.2. trust-info-url
1425 A URL to be displayed in the error page that users will see if
1426 access to an untrusted page is denied.
1434 Two example URLs are provided
1438 No links are displayed on the "untrusted" error page.
1442 The value of this option only matters if the experimental trust
1443 mechanism has been activated. (See trustfile below.)
1445 If you use the trust mechanism, it is a good idea to write up some
1446 on-line documentation about your trust policy and to specify the
1447 URL(s) here. Use multiple times for multiple URLs.
1449 The URL(s) should be added to the trustfile as well, so users
1450 don't end up locked out from the information on why they were
1451 locked out in the first place!
1453 --------------------------------------------------------------------------
1455 7.1.3. admin-address
1459 An email address to reach the Privoxy administrator.
1471 No email address is displayed on error pages and the CGI user
1476 If both admin-address and proxy-info-url are unset, the whole
1477 "Local Privoxy Support" box on all generated pages will not be
1480 --------------------------------------------------------------------------
1482 7.1.4. proxy-info-url
1486 A URL to documentation about the local Privoxy setup,
1487 configuration or policies.
1499 No link to local documentation is displayed on error pages and the
1504 If both admin-address and proxy-info-url are unset, the whole
1505 "Local Privoxy Support" box on all generated pages will not be
1508 This URL shouldn't be blocked ;-)
1510 --------------------------------------------------------------------------
1512 7.2. Configuration and Log File Locations
1514 Privoxy can (and normally does) use a number of other files for additional
1515 configuration, help and logging. This section of the configuration file
1516 tells Privoxy where to find those other files.
1518 The user running Privoxy, must have read permission for all configuration
1519 files, and write permission to any files that would be modified, such as
1520 log files and actions files.
1522 --------------------------------------------------------------------------
1528 The directory where the other configuration files are located.
1536 /etc/privoxy (Unix) or Privoxy installation dir (Windows)
1544 No trailing "/", please.
1546 --------------------------------------------------------------------------
1552 An alternative directory where the templates are loaded from.
1564 The templates are assumed to be located in confdir/template.
1568 Privoxy's original templates are usually overwritten with each
1569 update. Use this option to relocate customized templates that
1570 should be kept. As template variables might change between
1571 updates, you shouldn't expect templates to work with Privoxy
1572 releases other than the one they were part of, though.
1574 --------------------------------------------------------------------------
1580 The directory where all logging takes place (i.e. where logfile
1581 and jarfile are located).
1589 /var/log/privoxy (Unix) or Privoxy installation dir (Windows)
1597 No trailing "/", please.
1599 --------------------------------------------------------------------------
1605 The actions file(s) to use
1609 Complete file name, relative to confdir
1613 standard.action # Internal purposes, no editing recommended
1614 default.action # Main actions file
1615 user.action # User customizations
1619 No actions are taken at all. More or less neutral proxying.
1623 Multiple actionsfile lines are permitted, and are in fact
1626 The default values include standard.action, which is used for
1627 internal purposes and should be loaded, default.action, which is
1628 the "main" actions file maintained by the developers, and
1629 user.action, where you can make your personal additions.
1631 Actions files contain all the per site and per URL configuration
1632 for ad blocking, cookie management, privacy considerations, etc.
1633 There is no point in using Privoxy without at least one actions
1636 Note that since Privoxy 3.0.7, the complete filename, including
1637 the ".action" extension has to be specified. The syntax change was
1638 necessary to be consistent with the other file options and to
1639 allow previously forbidden characters.
1641 --------------------------------------------------------------------------
1647 The filter file(s) to use
1651 File name, relative to confdir
1655 default.filter (Unix) or default.filter.txt (Windows)
1659 No textual content filtering takes place, i.e. all +filter{name}
1660 actions in the actions files are turned neutral.
1664 Multiple filterfile lines are permitted.
1666 The filter files contain content modification rules that use
1667 regular expressions. These rules permit powerful changes on the
1668 content of Web pages, and optionally the headers as well, e.g.,
1669 you could try to disable your favorite JavaScript annoyances,
1670 re-write the actual displayed text, or just have some fun playing
1671 buzzword bingo with web pages.
1673 The +filter{name} actions rely on the relevant filter (name) to be
1674 defined in a filter file!
1676 A pre-defined filter file called default.filter that contains a
1677 number of useful filters for common problems is included in the
1678 distribution. See the section on the filter action for a list.
1680 It is recommended to place any locally adapted filters into a
1681 separate file, such as user.filter.
1683 --------------------------------------------------------------------------
1693 File name, relative to logdir
1697 Unset (commented out). When activated: logfile (Unix) or
1698 privoxy.log (Windows).
1702 No logfile is written.
1706 The logfile is where all logging and error messages are written.
1707 The level of detail and number of messages are set with the debug
1708 option (see below). The logfile can be useful for tracking down a
1709 problem with Privoxy (e.g., it's not blocking an ad you think it
1710 should block) and it can help you to monitor what your browser is
1713 Depending on the debug options below, the logfile may be a privacy
1714 risk if third parties can get access to it. As most users will
1715 never look at it, Privoxy 3.0.7 and later only log fatal errors by
1718 For most troubleshooting purposes, you will have to change that,
1719 please refer to the debugging section for details.
1721 Your logfile will grow indefinitely, and you will probably want to
1722 periodically remove it. On Unix systems, you can do this with a
1723 cron job (see "man cron"). For Red Hat based Linux distributions,
1724 a logrotate script has been included.
1726 Any log files must be writable by whatever user Privoxy is being
1727 run as (on Unix, default user id is "privoxy").
1729 --------------------------------------------------------------------------
1735 The file to store intercepted cookies in
1739 File name, relative to logdir
1743 Unset (commented out). When activated: jarfile (Unix) or
1744 privoxy.jar (Windows).
1748 Intercepted cookies are not stored in a dedicated log file.
1752 The jarfile may grow to ridiculous sizes over time.
1754 If debug 8 (show header parsing) is enabled, cookies are also
1755 written to the logfile with the rest of the headers. Therefore
1756 this option isn't very useful and may be removed in future
1757 releases. Please report to the developers if you are still using
1760 --------------------------------------------------------------------------
1766 The name of the trust file to use
1770 File name, relative to confdir
1774 Unset (commented out). When activated: trust (Unix) or trust.txt
1779 The entire trust mechanism is disabled.
1783 The trust mechanism is an experimental feature for building
1784 white-lists and should be used with care. It is NOT recommended
1785 for the casual user.
1787 If you specify a trust file, Privoxy will only allow access to
1788 sites that are specified in the trustfile. Sites can be listed in
1791 Prepending a ~ character limits access to this site only (and any
1792 sub-paths within this site), e.g. ~www.example.com allows access
1793 to ~www.example.com/features/news.html, etc.
1795 Or, you can designate sites as trusted referrers, by prepending
1796 the name with a + character. The effect is that access to
1797 untrusted sites will be granted -- but only if a link from this
1798 trusted referrer was used to get there. The link target will then
1799 be added to the "trustfile" so that future, direct accesses will
1800 be granted. Sites added via this mechanism do not become trusted
1801 referrers themselves (i.e. they are added with a ~ designation).
1802 There is a limit of 512 such entries, after which new entries will
1805 If you use the + operator in the trust file, it may grow
1806 considerably over time.
1808 It is recommended that Privoxy be compiled with the
1809 --disable-force, --disable-toggle and --disable-editor options, if
1810 this feature is to be used.
1812 Possible applications include limiting Internet access for
1815 --------------------------------------------------------------------------
1819 These options are mainly useful when tracing a problem. Note that you
1820 might also want to invoke Privoxy with the --no-daemon command line option
1823 --------------------------------------------------------------------------
1829 Key values that determine what information gets logged.
1837 0 (i.e.: only fatal errors (that cause Privoxy to exit) are
1842 Default value is used (see above).
1846 The available debug levels are:
1848 debug 1 # log each request destination (and the crunch reason if Privoxy intercepted the request)
1849 debug 2 # show each connection status
1850 debug 4 # show I/O status
1851 debug 8 # show header parsing
1852 debug 16 # log all data written to the network into the logfile
1853 debug 32 # debug force feature
1854 debug 64 # debug regular expression filters
1855 debug 128 # debug redirects
1856 debug 256 # debug GIF de-animation
1857 debug 512 # Common Log Format
1858 debug 1024 # debug kill pop-ups
1859 debug 2048 # CGI user interface
1860 debug 4096 # Startup banner and warnings.
1861 debug 8192 # Non-fatal errors
1863 To select multiple debug levels, you can either add them or use
1864 multiple debug lines.
1866 A debug level of 1 is informative because it will show you each
1867 request as it happens. 1, 4096 and 8192 are recommended so that
1868 you will notice when things go wrong. The other levels are
1869 probably only of interest if you are hunting down a specific
1870 problem. They can produce a hell of an output (especially 16).
1872 Privoxy used to ship with the debug levels recommended above
1873 enabled by default, but due to privacy concerns 3.0.7 and later
1874 are configured to only log fatal errors.
1876 If you are used to the more verbose settings, simply enable the
1877 debug lines below again.
1879 If you want to use pure CLF (Common Log Format), you should set
1880 "debug 512" ONLY and not enable anything else.
1882 Privoxy has a hard-coded limit for the length of log messages. If
1883 it's reached, messages are logged truncated and marked with "...
1884 [too long, truncated]".
1886 Please don't file any support requests without trying to reproduce
1887 the problem with increased debug level first. Once you read the
1888 log messages, you may even be able to solve the problem on your
1891 --------------------------------------------------------------------------
1893 7.3.2. single-threaded
1897 Whether to run only one server thread.
1909 Multi-threaded (or, where unavailable: forked) operation, i.e. the
1910 ability to serve multiple requests simultaneously.
1914 This option is only there for debugging purposes. It will
1915 drastically reduce performance.
1917 --------------------------------------------------------------------------
1919 7.4. Access Control and Security
1921 This section of the config file controls the security-relevant aspects of
1922 Privoxy's configuration.
1924 --------------------------------------------------------------------------
1926 7.4.1. listen-address
1930 The IP address and TCP port on which Privoxy will listen for
1943 Bind to 127.0.0.1 (localhost), port 8118. This is suitable and
1944 recommended for home users who run Privoxy on the same machine as
1949 You will need to configure your browser(s) to this proxy address
1952 If you already have another service running on port 8118, or if
1953 you want to serve requests from other machines (e.g. on your local
1954 network) as well, you will need to override the default.
1956 If you leave out the IP address, Privoxy will bind to all
1957 interfaces (addresses) on your machine and may become reachable
1958 from the Internet. In that case, consider using access control
1959 lists (ACL's, see below), and/or a firewall.
1961 If you open Privoxy to untrusted users, you will also want to make
1962 sure that the following actions are disabled: enable-edit-actions
1963 and enable-remote-toggle
1967 Suppose you are running Privoxy on a machine which has the address
1968 192.168.0.1 on your local private network (192.168.0.0) and has
1969 another outside connection with a different address. You want it
1970 to serve requests from inside only:
1972 listen-address 192.168.0.1:8118
1974 --------------------------------------------------------------------------
1980 Initial state of "toggle" status
1992 Act as if toggled on
1996 If set to 0, Privoxy will start in "toggled off" mode, i.e. mostly
1997 behave like a normal, content-neutral proxy with both ad blocking
1998 and content filtering disabled. See enable-remote-toggle below.
2000 The windows version will only display the toggle icon in the
2001 system tray if this option is present.
2003 --------------------------------------------------------------------------
2005 7.4.3. enable-remote-toggle
2009 Whether or not the web-based toggle feature may be used
2021 The web-based toggle feature is disabled.
2025 When toggled off, Privoxy mostly acts like a normal,
2026 content-neutral proxy, i.e. doesn't block ads or filter content.
2028 Access to the toggle feature can not be controlled separately by
2029 "ACLs" or HTTP authentication, so that everybody who can access
2030 Privoxy (see "ACLs" and listen-address above) can toggle it for
2031 all users. So this option is not recommended for multi-user
2032 environments with untrusted users.
2034 Note that malicious client side code (e.g Java) is also capable of
2037 As a lot of Privoxy users don't read documentation, this feature
2038 is disabled by default.
2040 Note that you must have compiled Privoxy with support for this
2041 feature, otherwise this option has no effect.
2043 --------------------------------------------------------------------------
2045 7.4.4. enable-remote-http-toggle
2049 Whether or not Privoxy recognizes special HTTP headers to change
2062 Privoxy ignores special HTTP headers.
2066 When toggled on, the client can change Privoxy's behaviour by
2067 setting special HTTP headers. Currently the only supported special
2068 header is "X-Filter: No", to disable filtering for the ongoing
2069 request, even if it is enabled in one of the action files.
2071 This feature is disabled by default. If you are using Privoxy in a
2072 environment with trusted clients, you may enable this feature at
2073 your discretion. Note that malicious client side code (e.g Java)
2074 is also capable of using this feature.
2076 This option will be removed in future releases as it has been
2077 obsoleted by the more general header taggers.
2079 --------------------------------------------------------------------------
2081 7.4.5. enable-edit-actions
2085 Whether or not the web-based actions file editor may be used
2097 The web-based actions file editor is disabled.
2101 Access to the editor can not be controlled separately by "ACLs" or
2102 HTTP authentication, so that everybody who can access Privoxy (see
2103 "ACLs" and listen-address above) can modify its configuration for
2106 This option is not recommended for environments with untrusted
2107 users and as a lot of Privoxy users don't read documentation, this
2108 feature is disabled by default.
2110 Note that malicious client side code (e.g Java) is also capable of
2111 using the actions editor and you shouldn't enable this options
2112 unless you understand the consequences and are sure your browser
2113 is configured correctly.
2115 Note that you must have compiled Privoxy with support for this
2116 feature, otherwise this option has no effect.
2118 --------------------------------------------------------------------------
2120 7.4.6. enforce-blocks
2124 Whether the user is allowed to ignore blocks and can "go there
2137 Blocks are not enforced.
2141 Privoxy is mainly used to block and filter requests as a service
2142 to the user, for example to block ads and other junk that clogs
2143 the pipes. Privoxy's configuration isn't perfect and sometimes
2144 innocent pages are blocked. In this situation it makes sense to
2145 allow the user to enforce the request and have Privoxy ignore the
2148 In the default configuration Privoxy's "Blocked" page contains a
2149 "go there anyway" link to adds a special string (the force prefix)
2150 to the request URL. If that link is used, Privoxy will detect the
2151 force prefix, remove it again and let the request pass.
2153 Of course Privoxy can also be used to enforce a network policy. In
2154 that case the user obviously should not be able to bypass any
2155 blocks, and that's what the "enforce-blocks" option is for. If
2156 it's enabled, Privoxy hides the "go there anyway" link. If the
2157 user adds the force prefix by hand, it will not be accepted and
2158 the circumvention attempt is logged.
2164 --------------------------------------------------------------------------
2166 7.4.7. ACLs: permit-access and deny-access
2170 Who can access what.
2174 src_addr[/src_masklen] [dst_addr[/dst_masklen]]
2176 Where src_addr and dst_addr are IP addresses in dotted decimal
2177 notation or valid DNS names, and src_masklen and dst_masklen are
2178 subnet masks in CIDR notation, i.e. integer values from 2 to 30
2179 representing the length (in bits) of the network address. The
2180 masks and the whole destination part are optional.
2188 Don't restrict access further than implied by listen-address
2192 Access controls are included at the request of ISPs and systems
2193 administrators, and are not usually needed by individual users.
2194 For a typical home user, it will normally suffice to ensure that
2195 Privoxy only listens on the localhost (127.0.0.1) or internal
2196 (home) network address by means of the listen-address option.
2198 Please see the warnings in the FAQ that Privoxy is not intended to
2199 be a substitute for a firewall or to encourage anyone to defer
2200 addressing basic security weaknesses.
2202 Multiple ACL lines are OK. If any ACLs are specified, Privoxy only
2203 talks to IP addresses that match at least one permit-access line
2204 and don't match any subsequent deny-access line. In other words,
2205 the last match wins, with the default being deny-access.
2207 If Privoxy is using a forwarder (see forward below) for a
2208 particular destination URL, the dst_addr that is examined is the
2209 address of the forwarder and NOT the address of the ultimate
2210 target. This is necessary because it may be impossible for the
2211 local Privoxy to determine the IP address of the ultimate target
2212 (that's often what gateways are used for).
2214 You should prefer using IP addresses over DNS names, because the
2215 address lookups take time. All DNS names must resolve! You can not
2216 use domain patterns like "*.org" or partial domain names. If a DNS
2217 name resolves to multiple IP addresses, only the first one is
2220 Denying access to particular sites by ACL may have undesired side
2221 effects if the site in question is hosted on a machine which also
2222 hosts other sites (most sites are).
2226 Explicitly define the default behavior if no ACL and
2227 listen-address are set: "localhost" is OK. The absence of a
2228 dst_addr implies that all destination addresses are OK:
2230 permit-access localhost
2232 Allow any host on the same class C subnet as www.privoxy.org
2233 access to nothing but www.example.com (or other domains hosted on
2236 permit-access www.privoxy.org/24 www.example.com/32
2238 Allow access from any host on the 26-bit subnet 192.168.45.64 to
2239 anywhere, with the exception that 192.168.45.73 may not access the
2240 IP address behind www.dirty-stuff.example.com:
2242 permit-access 192.168.45.64/26
2243 deny-access 192.168.45.73 www.dirty-stuff.example.com
2245 --------------------------------------------------------------------------
2251 Maximum size of the buffer for content filtering.
2263 Use a 4MB (4096 KB) limit.
2267 For content filtering, i.e. the +filter and +deanimate-gif
2268 actions, it is necessary that Privoxy buffers the entire document
2269 body. This can be potentially dangerous, since a server could just
2270 keep sending data indefinitely and wait for your RAM to exhaust --
2271 with nasty consequences. Hence this option.
2273 When a document buffer size reaches the buffer-limit, it is
2274 flushed to the client unfiltered and no further attempt to filter
2275 the rest of the document is made. Remember that there may be
2276 multiple threads running, which might require up to buffer-limit
2277 Kbytes each, unless you have enabled "single-threaded" above.
2279 --------------------------------------------------------------------------
2283 This feature allows routing of HTTP requests through a chain of multiple
2286 Forwarding can be used to chain Privoxy with a caching proxy to speed up
2287 browsing. Using a parent proxy may also be necessary if the machine that
2288 Privoxy runs on has no direct Internet access.
2290 Note that parent proxies can severely decrease your privacy level. For
2291 example a parent proxy could add your IP address to the request headers
2292 and if it's a caching proxy it may add the "Etag" header to revalidation
2293 requests again, even though you configured Privoxy to remove it. It may
2294 also ignore Privoxy's header time randomization and use the original
2295 values which could be used by the server as cookie replacement to track
2296 your steps between visits.
2298 Also specified here are SOCKS proxies. Privoxy supports the SOCKS 4 and
2301 --------------------------------------------------------------------------
2307 To which parent HTTP proxy specific requests should be routed.
2311 target_pattern http_parent[:port]
2313 where target_pattern is a URL pattern that specifies to which
2314 requests (i.e. URLs) this forward rule shall apply. Use / to
2315 denote "all URLs". http_parent[:port] is the DNS name or IP
2316 address of the parent HTTP proxy through which the requests should
2317 be forwarded, optionally followed by its listening port (default:
2318 8080). Use a single dot (.) to denote "no forwarding".
2326 Don't use parent HTTP proxies.
2330 If http_parent is ".", then requests are not forwarded to another
2331 HTTP proxy but are made directly to the web servers.
2333 Multiple lines are OK, they are checked in sequence, and the last
2338 Everything goes to an example parent proxy, except SSL on port 443
2339 (which it doesn't handle):
2341 forward / parent-proxy.example.org:8080
2344 Everything goes to our example ISP's caching proxy, except for
2345 requests to that ISP's sites:
2347 forward / caching-proxy.isp.example.net:8000
2348 forward .isp.example.net .
2350 --------------------------------------------------------------------------
2352 7.5.2. forward-socks4 and forward-socks4a
2356 Through which SOCKS proxy (and optionally to which parent HTTP
2357 proxy) specific requests should be routed.
2361 target_pattern socks_proxy[:port] http_parent[:port]
2363 where target_pattern is a URL pattern that specifies to which
2364 requests (i.e. URLs) this forward rule shall apply. Use / to
2365 denote "all URLs". http_parent and socks_proxy are IP addresses in
2366 dotted decimal notation or valid DNS names (http_parent may be "."
2367 to denote "no HTTP forwarding"), and the optional port parameters
2368 are TCP ports, i.e. integer values from 1 to 64535
2376 Don't use SOCKS proxies.
2380 Multiple lines are OK, they are checked in sequence, and the last
2383 The difference between forward-socks4 and forward-socks4a is that
2384 in the SOCKS 4A protocol, the DNS resolution of the target
2385 hostname happens on the SOCKS server, while in SOCKS 4 it happens
2388 If http_parent is ".", then requests are not forwarded to another
2389 HTTP proxy but are made (HTTP-wise) directly to the web servers,
2390 albeit through a SOCKS proxy.
2394 From the company example.com, direct connections are made to all
2395 "internal" domains, but everything outbound goes through their
2396 ISP's proxy by way of example.com's corporate SOCKS 4A gateway to
2399 forward-socks4a / socks-gw.example.com:1080 www-cache.isp.example.net:8080
2400 forward .example.com .
2402 A rule that uses a SOCKS 4 gateway for all destinations but no
2403 HTTP parent looks like this:
2405 forward-socks4 / socks-gw.example.com:1080 .
2407 To chain Privoxy and Tor, both running on the same system, you
2408 would use something like:
2410 forward-socks4a / 127.0.0.1:9050 .
2412 The public Tor network can't be used to reach your local network,
2413 if you need to access local servers you therefore might want to
2414 make some exceptions:
2416 forward 192.168.*.*/ .
2418 forward 127.*.*.*/ .
2420 Unencrypted connections to systems in these address ranges will be
2421 as (un)secure as the local network is, but the alternative is that
2422 you can't reach the local network through Privoxy at all. Of
2423 course this may actually be desired and there is no reason to make
2424 these exceptions if you aren't sure you need them.
2426 If you also want to be able to reach servers in your local network
2427 by using their names, you will need additional exceptions that
2430 forward localhost/ .
2432 --------------------------------------------------------------------------
2434 7.5.3. Advanced Forwarding Examples
2436 If you have links to multiple ISPs that provide various special content
2437 only to their subscribers, you can configure multiple Privoxies which have
2438 connections to the respective ISPs to act as forwarders to each other, so
2439 that your users can see the internal content of all ISPs.
2441 Assume that host-a has a PPP connection to isp-a.example.net. And host-b
2442 has a PPP connection to isp-b.example.org. Both run Privoxy. Their
2443 forwarding configuration can look like this:
2448 forward .isp-b.example.net host-b:8118
2453 forward .isp-a.example.org host-a:8118
2455 Now, your users can set their browser's proxy to use either host-a or
2456 host-b and be able to browse the internal content of both isp-a and isp-b.
2458 If you intend to chain Privoxy and squid locally, then chaining as browser
2459 -> squid -> privoxy is the recommended way.
2461 Assuming that Privoxy and squid run on the same box, your squid
2462 configuration could then look like this:
2464 # Define Privoxy as parent proxy (without ICP)
2465 cache_peer 127.0.0.1 parent 8118 7 no-query
2467 # Define ACL for protocol FTP
2470 # Do not forward FTP requests to Privoxy
2471 always_direct allow ftp
2473 # Forward all the rest to Privoxy
2474 never_direct allow all
2476 You would then need to change your browser's proxy settings to squid's
2477 address and port. Squid normally uses port 3128. If unsure consult
2478 http_port in squid.conf.
2480 You could just as well decide to only forward requests you suspect of
2481 leading to Windows executables through a virus-scanning parent proxy, say,
2482 on antivir.example.com, port 8010:
2485 forward /.*\.(exe|com|dll|zip)$ antivir.example.com:8010
2487 --------------------------------------------------------------------------
2489 7.5.4. forwarded-connect-retries
2493 How often Privoxy retries if a forwarded connection request fails.
2505 Connections forwarded through other proxies are treated like
2506 direct connections and no retry attempts are made.
2510 forwarded-connect-retries is mainly interesting for socks4a
2511 connections, where Privoxy can't detect why the connections
2512 failed. The connection might have failed because of a DNS timeout
2513 in which case a retry makes sense, but it might also have failed
2514 because the server doesn't exist or isn't reachable. In this case
2515 the retry will just delay the appearance of Privoxy's error
2518 Note that in the context of this option, "forwarded connections"
2519 includes all connections that Privoxy forwards through other
2520 proxies. This option is not limited to the HTTP CONNECT method.
2522 Only use this option, if you are getting lots of
2523 forwarding-related error messages that go away when you try again
2524 manually. Start with a small value and check Privoxy's logfile
2525 from time to time, to see how many retries are usually needed.
2529 forwarded-connect-retries 1
2531 --------------------------------------------------------------------------
2533 7.5.5. accept-intercepted-requests
2537 Whether intercepted requests should be treated as valid.
2549 Only proxy requests are accepted, intercepted requests are treated
2554 If you don't trust your clients and want to force them to use
2555 Privoxy, enable this option and configure your packet filter to
2556 redirect outgoing HTTP connections into Privoxy.
2558 Make sure that Privoxy's own requests aren't redirected as well.
2559 Additionally take care that Privoxy can't intentionally connect to
2560 itself, otherwise you could run into redirection loops if
2561 Privoxy's listening port is reachable by the outside or an
2562 attacker has access to the pages you visit.
2566 accept-intercepted-requests 1
2568 --------------------------------------------------------------------------
2570 7.5.6. allow-cgi-request-crunching
2574 Whether requests to Privoxy's CGI pages can be blocked or
2587 Privoxy ignores block and redirect actions for its CGI pages.
2591 By default Privoxy ignores block or redirect actions for its CGI
2592 pages. Intercepting these requests can be useful in multi-user
2593 setups to implement fine-grained access control, but it can also
2594 render the complete web interface useless and make debugging
2595 problems painful if done without care.
2597 Don't enable this option unless you're sure that you really need
2602 allow-cgi-request-crunching 1
2604 --------------------------------------------------------------------------
2606 7.5.7. split-large-forms
2610 Whether the CGI interface should stay compatible with broken HTTP
2623 The CGI form generate long GET URLs.
2627 Privoxy's CGI forms can lead to rather long URLs. This isn't a
2628 problem as far as the HTTP standard is concerned, but it can
2629 confuse clients with arbitrary URL length limitations.
2631 Enabling split-large-forms causes Privoxy to divide big forms into
2632 smaller ones to keep the URL length down. It makes editing a lot
2633 less convenient and you can no longer submit all changes at once,
2634 but at least it works around this browser bug.
2636 If you don't notice any editing problems, there is no reason to
2637 enable this option, but if one of the submit buttons appears to be
2638 broken, you should give it a try.
2644 --------------------------------------------------------------------------
2646 7.6. Windows GUI Options
2648 Privoxy has a number of options specific to the Windows GUI interface:
2650 If "activity-animation" is set to 1, the Privoxy icon will animate when
2651 "Privoxy" is active. To turn off, set to 0.
2653 activity-animation 1
2656 If "log-messages" is set to 1, Privoxy will log messages to the console
2662 If "log-buffer-size" is set to 1, the size of the log buffer, i.e. the
2663 amount of memory used for the log messages displayed in the console
2664 window, will be limited to "log-max-lines" (see below).
2666 Warning: Setting this to 0 will result in the buffer to grow infinitely
2667 and eat up all your memory!
2672 log-max-lines is the maximum number of lines held in the log buffer. See
2678 If "log-highlight-messages" is set to 1, Privoxy will highlight portions
2679 of the log messages with a bold-faced font:
2681 log-highlight-messages 1
2684 The font used in the console window:
2686 log-font-name Comic Sans MS
2689 Font size used in the console window:
2694 "show-on-task-bar" controls whether or not Privoxy will appear as a button
2695 on the Task bar when minimized:
2700 If "close-button-minimizes" is set to 1, the Windows close button will
2701 minimize Privoxy instead of closing the program (close with the exit
2702 option on the File menu).
2704 close-button-minimizes 1
2707 The "hide-console" option is specific to the MS-Win console version of
2708 Privoxy. If this option is used, Privoxy will disconnect from and hide the
2714 --------------------------------------------------------------------------
2718 The actions files are used to define what actions Privoxy takes for which
2719 URLs, and thus determines how ad images, cookies and various other aspects
2720 of HTTP content and transactions are handled, and on which sites (or even
2721 parts thereof). There are a number of such actions, with a wide range of
2722 functionality. Each action does something a little different. These
2723 actions give us a veritable arsenal of tools with which to exert our
2724 control, preferences and independence. Actions can be combined so that
2725 their effects are aggregated when applied against a given set of URLs.
2727 There are three action files included with Privoxy with differing
2730 * default.action - is the primary action file that sets the initial
2731 values for all actions. It is intended to provide a base level of
2732 functionality for Privoxy's array of features. So it is a set of broad
2733 rules that should work reasonably well as-is for most users. This is
2734 the file that the developers are keeping updated, and making available
2735 to users. The user's preferences as set in standard.action, e.g.
2736 either Cautious (the default), Medium, or Advanced (see below).
2738 * user.action - is intended to be for local site preferences and
2739 exceptions. As an example, if your ISP or your bank has specific
2740 requirements, and need special handling, this kind of thing should go
2741 here. This file will not be upgraded.
2743 * standard.action - is used only by the web based editor at
2744 http://config.privoxy.org/edit-actions-list?f=default, to set various
2745 pre-defined sets of rules for the default actions section in
2748 Edit Set to Cautious Set to Medium Set to Advanced
2750 These have increasing levels of aggressiveness and have no influence
2751 on your browsing unless you select them explicitly in the editor. A
2752 default installation should be pre-set to Cautious (versions prior to
2753 3.0.5 were set to Medium). New users should try this for a while
2754 before adjusting the settings to more aggressive levels. The more
2755 aggressive the settings, then the more likelihood there is of problems
2756 such as sites not working as they should.
2758 The Edit button allows you to turn each action on/off individually for
2759 fine-tuning. The Cautious button changes the actions list to low/safe
2760 settings which will activate ad blocking and a minimal set of
2761 Privoxy's features, and subsequently there will be less of a chance
2762 for accidental problems. The Medium button sets the list to a medium
2763 level of other features and a low level set of privacy features. The
2764 Advanced button sets the list to a high level of ad blocking and
2765 medium level of privacy. See the chart below. The latter three buttons
2766 over-ride any changes via with the Edit button. More fine-tuning can
2767 be done in the lower sections of this internal page.
2769 It is not recommend to edit the standard.action file itself.
2771 The default profiles, and their associated actions, as pre-defined in
2772 standard.action are:
2774 Table 1. Default Configurations
2776 +--------------------------------------------------------------------+
2777 | Feature | Cautious | Medium | Advanced |
2778 |-------------------------+-------------+--------------+-------------|
2779 | Ad-blocking | medium | high | high |
2780 | Aggressiveness | | | |
2781 |-------------------------+-------------+--------------+-------------|
2782 | Ad-filtering by size | no | yes | yes |
2783 |-------------------------+-------------+--------------+-------------|
2784 | Ad-filtering by link | no | no | yes |
2785 |-------------------------+-------------+--------------+-------------|
2786 | Pop-up killing | blocks only | blocks only | blocks only |
2787 |-------------------------+-------------+--------------+-------------|
2788 | Privacy Features | low | medium | medium/high |
2789 |-------------------------+-------------+--------------+-------------|
2790 | Cookie handling | none | session-only | kill |
2791 |-------------------------+-------------+--------------+-------------|
2792 | Referer forging | no | yes | yes |
2793 |-------------------------+-------------+--------------+-------------|
2794 | GIF de-animation | no | yes | yes |
2795 |-------------------------+-------------+--------------+-------------|
2796 | Fast redirects | no | no | yes |
2797 |-------------------------+-------------+--------------+-------------|
2798 | HTML taming | no | no | yes |
2799 |-------------------------+-------------+--------------+-------------|
2800 | JavaScript taming | no | no | yes |
2801 |-------------------------+-------------+--------------+-------------|
2802 | Web-bug killing | no | yes | yes |
2803 |-------------------------+-------------+--------------+-------------|
2804 | Image tag reordering | no | no | yes |
2805 +--------------------------------------------------------------------+
2807 The list of actions files to be used are defined in the main configuration
2808 file, and are processed in the order they are defined (e.g. default.action
2809 is typically processed before user.action). The content of these can all
2810 be viewed and edited from http://config.privoxy.org/show-status. The
2811 over-riding principle when applying actions, is that the last action that
2812 matches a given URL wins. The broadest, most general rules go first
2813 (defined in default.action), followed by any exceptions (typically also in
2814 default.action), which are then followed lastly by any local preferences
2815 (typically in user.action). Generally, user.action has the last word.
2817 An actions file typically has multiple sections. If you want to use
2818 "aliases" in an actions file, you have to place the (optional) alias
2819 section at the top of that file. Then comes the default set of rules which
2820 will apply universally to all sites and pages (be very careful with using
2821 such a universal set in user.action or any other actions file after
2822 default.action, because it will override the result from consulting any
2823 previous file). And then below that, exceptions to the defined universal
2824 policies. You can regard user.action as an appendix to default.action,
2825 with the advantage that it is a separate file, which makes preserving your
2826 personal settings across Privoxy upgrades easier.
2828 Actions can be used to block anything you want, including ads, banners, or
2829 just some obnoxious URL whose content you would rather not see. Cookies
2830 can be accepted or rejected, or accepted only during the current browser
2831 session (i.e. not written to disk), content can be modified, some
2832 JavaScripts tamed, user-tracking fooled, and much more. See below for a
2833 complete list of actions.
2835 --------------------------------------------------------------------------
2837 8.1. Finding the Right Mix
2839 Note that some actions, like cookie suppression or script disabling, may
2840 render some sites unusable that rely on these techniques to work properly.
2841 Finding the right mix of actions is not always easy and certainly a matter
2842 of personal taste. And, things can always change, requiring refinements in
2843 the configuration. In general, it can be said that the more "aggressive"
2844 your default settings (in the top section of the actions file) are, the
2845 more exceptions for "trusted" sites you will have to make later. If, for
2846 example, you want to crunch all cookies per default, you'll have to make
2847 exceptions from that rule for sites that you regularly use and that
2848 require cookies for actually useful purposes, like maybe your bank,
2849 favorite shop, or newspaper.
2851 We have tried to provide you with reasonable rules to start from in the
2852 distribution actions files. But there is no general rule of thumb on these
2853 things. There just are too many variables, and sites are constantly
2854 changing. Sooner or later you will want to change the rules (and read this
2857 --------------------------------------------------------------------------
2861 The easiest way to edit the actions files is with a browser by using our
2862 browser-based editor, which can be reached from
2863 http://config.privoxy.org/show-status. Note: the config file option
2864 enable-edit-actions must be enabled for this to work. The editor allows
2865 both fine-grained control over every single feature on a per-URL basis,
2866 and easy choosing from wholesale sets of defaults like "Cautious",
2867 "Medium" or "Advanced". Warning: the "Advanced" setting is more
2868 aggressive, and will be more likely to cause problems for some sites.
2869 Experienced users only!
2871 If you prefer plain text editing to GUIs, you can of course also directly
2872 edit the the actions files with your favorite text editor. Look at
2873 default.action which is richly commented with many good examples.
2875 --------------------------------------------------------------------------
2877 8.3. How Actions are Applied to Requests
2879 Actions files are divided into sections. There are special sections, like
2880 the "alias" sections which will be discussed later. For now let's
2881 concentrate on regular sections: They have a heading line (often split up
2882 to multiple lines for readability) which consist of a list of actions,
2883 separated by whitespace and enclosed in curly braces. Below that, there is
2884 a list of URL and tag patterns, each on a separate line.
2886 To determine which actions apply to a request, the URL of the request is
2887 compared to all URL patterns in each "action file". Every time it matches,
2888 the list of applicable actions for the request is incrementally updated,
2889 using the heading of the section in which the pattern is located. The same
2890 is done again for tags and tag patterns later on.
2892 If multiple applying sections set the same action differently, the last
2893 match wins. If not, the effects are aggregated. E.g. a URL might match a
2894 regular section with a heading line of { +handle-as-image }, then later
2895 another one with just { +block }, resulting in both actions to apply. And
2896 there may well be cases where you will want to combine actions together.
2897 Such a section then might look like:
2899 { +handle-as-image +block }
2900 # Block these as if they were images. Send no block page.
2902 media.example.com/.*banners
2903 .example.com/images/ads/
2905 You can trace this process for URL patterns and any given URL by visiting
2906 http://config.privoxy.org/show-url-info.
2908 Examples and more detail on this is provided in the Appendix,
2909 Troubleshooting: Anatomy of an Action section.
2911 --------------------------------------------------------------------------
2915 As mentioned, Privoxy uses "patterns" to determine what actions might
2916 apply to which sites and pages your browser attempts to access. These
2917 "patterns" use wild card type pattern matching to achieve a high degree of
2918 flexibility. This allows one expression to be expanded and potentially
2919 match against many similar patterns.
2921 Generally, an URL pattern has the form <domain>/<path>, where both the
2922 <domain> and <path> are optional. (This is why the special / pattern
2923 matches all URLs). Note that the protocol portion of the URL pattern (e.g.
2924 http://) should not be included in the pattern. This is assumed already!
2926 The pattern matching syntax is different for the domain and path parts of
2927 the URL. The domain part uses a simple globbing type matching technique,
2928 while the path part uses a more flexible "Regular Expressions (PCRE)"
2933 is a domain-only pattern and will match any request to
2934 www.example.com, regardless of which document on that server is
2935 requested. So ALL pages in this domain would be covered by the
2936 scope of this action. Note that a simple example.com is different
2937 and would NOT match.
2941 means exactly the same. For domain-only patterns, the trailing /
2944 www.example.com/index.html$
2946 matches all the documents on www.example.com whose name starts
2949 www.example.com/index.html$
2951 matches only the single document /index.html on www.example.com.
2955 matches the document /index.html, regardless of the domain, i.e.
2956 on any web server anywhere.
2960 matches nothing, since it would be interpreted as a domain name
2961 and there is no top-level domain called .html. So its a mistake.
2963 --------------------------------------------------------------------------
2965 8.4.1. The Domain Pattern
2967 The matching of the domain part offers some flexible options: if the
2968 domain starts or ends with a dot, it becomes unanchored at that end. For
2973 matches any domain with first-level domain com and second-level
2974 domain example. For example www.example.com, example.com and
2975 foo.bar.baz.example.com. Note that it wouldn't match if the
2976 second-level domain was another-example.
2980 matches any domain that STARTS with www. (It also matches the
2981 domain www but most of the time that doesn't matter.)
2985 matches any domain that CONTAINS .example.. And, by the way, also
2986 included would be any files or documents that exist within that
2987 domain since no path limitations are specified. (Correctly
2988 speaking: It matches any FQDN that contains example as a domain.)
2989 This might be www.example.com, news.example.de, or
2990 www.example.net/cgi/testing.pl for instance. All these cases are
2993 Additionally, there are wild-cards that you can use in the domain names
2994 themselves. These work similarly to shell globbing type wild-cards: "*"
2995 represents zero or more arbitrary characters (this is equivalent to the
2996 "Regular Expression" based syntax of ".*"), "?" represents any single
2997 character (this is equivalent to the regular expression syntax of a simple
2998 "."), and you can define "character classes" in square brackets which is
2999 similar to the same regular expression technique. All of this can be
3004 matches "adserver.example.com", "ads.example.com", etc but not
3009 matches all of the above, and then some.
3013 matches www.ipix.com, pictures.epix.com, a.b.c.d.e.upix.com etc.
3015 www[1-9a-ez].example.c*
3017 matches www1.example.com, www4.example.cc, wwwd.example.cy,
3018 wwwz.example.com etc., but not wwww.example.com.
3020 While flexible, this is not the sophistication of full regular expression
3023 --------------------------------------------------------------------------
3025 8.4.2. The Path Pattern
3027 Privoxy uses Perl compatible (PCRE) "Regular Expression" based syntax
3028 (through the PCRE library) for matching the path portion (after the
3029 slash), and is thus more flexible.
3031 There is an Appendix with a brief quick-start into regular expressions,
3032 and full (very technical) documentation on PCRE regex syntax is available
3033 on-line at http://www.pcre.org/man.txt. You might also find the Perl man
3034 page on regular expressions (man perlre) useful, which is available
3035 on-line at http://perldoc.perl.org/perlre.html.
3037 Note that the path pattern is automatically left-anchored at the "/", i.e.
3038 it matches as if it would start with a "^" (regular expression speak for
3039 the beginning of a line).
3041 Please also note that matching in the path is CASE INSENSITIVE by default,
3042 but you can switch to case sensitive at any point in the pattern by using
3043 the "(?-i)" switch: www.example.com/(?-i)PaTtErN.* will match only
3044 documents whose path starts with PaTtErN in exactly this capitalization.
3048 Is equivalent to just ".example.com", since any documents within
3049 that domain are matched with or without the ".*" regular
3050 expression. This is redundant
3052 .example.com/.*/index.html$
3054 Will match any page in the domain of "example.com" that is named
3055 "index.html", and that is part of some path. For example, it
3056 matches "www.example.com/testing/index.html" but NOT
3057 "www.example.com/index.html" because the regular expression called
3058 for at least two "/'s", thus the path requirement. It also would
3059 match "www.example.com/testing/index_html", because of the special
3062 .example.com/(.*/)?index\.html$
3064 This regular expression is conditional so it will match any page
3065 named "index.html" regardless of path which in this case can have
3066 one or more "/'s". And this one must contain exactly ".html" (but
3067 does not have to end with that!).
3069 .example.com/(.*/)(ads|banners?|junk)
3071 This regular expression will match any path of "example.com" that
3072 contains any of the words "ads", "banner", "banners" (because of
3073 the "?") or "junk". The path does not have to end in these words,
3076 .example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$
3078 This is very much the same as above, except now it must end in
3079 either ".jpg", ".jpeg", ".gif" or ".png". So this one is limited
3080 to common image formats.
3082 There are many, many good examples to be found in default.action, and more
3083 tutorials below in Appendix on regular expressions.
3085 --------------------------------------------------------------------------
3087 8.4.3. The Tag Pattern
3089 Tag patterns are used to change the applying actions based on the
3090 request's tags. Tags can be created with either the client-header-tagger
3091 or the server-header-tagger action.
3093 Tag patterns have to start with "TAG:", so Privoxy can tell them apart
3094 from URL patterns. Everything after the colon including white space, is
3095 interpreted as a regular expression with path pattern syntax, except that
3096 tag patterns aren't left-anchored automatically (Privoxy doesn't silently
3097 add a "^", you have to do it yourself if you need it).
3099 To match all requests that are tagged with "foo" your pattern line should
3100 be "TAG:^foo$", "TAG:foo" would work as well, but it would also match
3101 requests whose tags contain "foo" somewhere. "TAG: foo" wouldn't work as
3102 it requires white space.
3104 Sections can contain URL and tag patterns at the same time, but tag
3105 patterns are checked after the URL patterns and thus always overrule them,
3106 even if they are located before the URL patterns.
3108 Once a new tag is added, Privoxy checks right away if it's matched by one
3109 of the tag patterns and updates the action settings accordingly. As a
3110 result tags can be used to activate other tagger actions, as long as these
3111 other taggers look for headers that haven't already be parsed.
3113 For example you could tag client requests which use the POST method, then
3114 use this tag to activate another tagger that adds a tag if cookies are
3115 sent, and then use a block action based on the cookie tag. This allows the
3116 outcome of one action, to be input into a subsequent action. However if
3117 you'd reverse the position of the described taggers, and activated the
3118 method tagger based on the cookie tagger, no method tags would be created.
3119 The method tagger would look for the request line, but at the time the
3120 cookie tag is created, the request line has already been parsed.
3122 While this is a limitation you should be aware of, this kind of
3123 indirection is seldom needed anyway and even the example doesn't make too
3126 --------------------------------------------------------------------------
3130 All actions are disabled by default, until they are explicitly enabled
3131 somewhere in an actions file. Actions are turned on if preceded with a
3132 "+", and turned off if preceded with a "-". So a +action means "do that
3133 action", e.g. +block means "please block URLs that match the following
3134 patterns", and -block means "don't block URLs that match the following
3135 patterns, even if +block previously applied."
3137 Again, actions are invoked by placing them on a line, enclosed in curly
3138 braces and separated by whitespace, like in {+some-action
3139 -some-other-action{some-parameter}}, followed by a list of URL patterns,
3140 one per line, to which they apply. Together, the actions line and the
3141 following pattern lines make up a section of the actions file.
3143 Actions fall into three categories:
3145 * Boolean, i.e the action can only be "enabled" or "disabled". Syntax:
3147 +name # enable action name
3148 -name # disable action name
3152 * Parameterized, where some value is required in order to enable this
3153 type of action. Syntax:
3155 +name{param} # enable action and set parameter to param,
3156 # overwriting parameter from previous match if necessary
3157 -name # disable action. The parameter can be omitted
3159 Note that if the URL matches multiple positive forms of a
3160 parameterized action, the last match wins, i.e. the params from
3161 earlier matches are simply ignored.
3163 Example: +hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD i386; en-US;
3164 rv:1.8.1.4) Gecko/20070602 Firefox/2.0.0.4}
3166 * Multi-value. These look exactly like parameterized actions, but they
3167 behave differently: If the action applies multiple times to the same
3168 URL, but with different parameters, all the parameters from all
3169 matches are remembered. This is used for actions that can be executed
3170 for the same request repeatedly, like adding multiple headers, or
3171 filtering through multiple filters. Syntax:
3173 +name{param} # enable action and add param to the list of parameters
3174 -name{param} # remove the parameter param from the list of parameters
3175 # If it was the last one left, disable the action.
3176 -name # disable this action completely and remove all parameters from the list
3178 Examples: +add-header{X-Fun-Header: Some text} and
3179 +filter{html-annoyances}
3181 If nothing is specified in any actions file, no "actions" are taken. So in
3182 this case Privoxy would just be a normal, non-blocking, non-filtering
3183 proxy. You must specifically enable the privacy and blocking features you
3184 need (although the provided default actions files will give a good
3187 Later defined action sections always over-ride earlier ones of the same
3188 type. So exceptions to any rules you make, should come in the latter part
3189 of the file (or in a file that is processed later when using multiple
3190 actions files such as user.action). For multi-valued actions, the actions
3191 are applied in the order they are specified. Actions files are processed
3192 in the order they are defined in config (the default installation has
3193 three actions files). It also quite possible for any given URL to match
3194 more than one "pattern" (because of wildcards and regular expressions),
3195 and thus to trigger more than one set of actions! Last match wins.
3197 The list of valid Privoxy actions are:
3199 --------------------------------------------------------------------------
3205 Confuse log analysis, custom applications
3209 Sends a user defined HTTP header to the web server.
3217 Any string value is possible. Validity of the defined HTTP headers
3218 is not checked. It is recommended that you use the "X-" prefix for
3223 This action may be specified multiple times, in order to define
3224 multiple headers. This is rarely needed for the typical user. If
3225 you don't know what "HTTP headers" are, you definitely don't need
3226 to worry about this one.
3230 +add-header{X-User-Tracking: sucks}
3232 --------------------------------------------------------------------------
3238 Block ads or other unwanted content
3242 Requests for URLs to which this action applies are blocked, i.e.
3243 the requests are trapped by Privoxy and the requested URL is never
3244 retrieved, but is answered locally with a substitute page or
3245 image, as determined by the handle-as-image, set-image-blocker,
3246 and handle-as-empty-document actions.
3258 Privoxy sends a special "BLOCKED" page for requests to blocked
3259 pages. This page contains links to find out why the request was
3260 blocked, and a click-through to the blocked content (the latter
3261 only if compiled with the force feature enabled). The "BLOCKED"
3262 page adapts to the available screen space -- it displays
3263 full-blown if space allows, or miniaturized and text-only if
3264 loaded into a small frame or window. If you are using Privoxy
3265 right now, you can take a look at the "BLOCKED" page.
3267 A very important exception occurs if both block and
3268 handle-as-image, apply to the same request: it will then be
3269 replaced by an image. If set-image-blocker (see below) also
3270 applies, the type of image will be determined by its parameter, if
3271 not, the standard checkerboard pattern is sent.
3273 It is important to understand this process, in order to understand
3274 how Privoxy deals with ads and other unwanted content. Blocking is
3275 a core feature, and one upon which various other features depend.
3277 The filter action can perform a very similar task, by "blocking"
3278 banner images and other content through rewriting the relevant
3279 URLs in the document's HTML source, so they don't get requested in
3280 the first place. Note that this is a totally different technique,
3281 and it's easy to confuse the two.
3283 Example usage (section):
3286 # Block and replace with "blocked" page
3287 .nasty-stuff.example.com
3289 {+block +handle-as-image}
3290 # Block and replace with image
3294 {+block +handle-as-empty-document}
3295 # Block and then ignore
3296 adserver.exampleclick.net/.*\.js$
3298 --------------------------------------------------------------------------
3300 8.5.3. client-header-filter
3304 Rewrite or remove single client headers.
3308 All client headers to which this action applies are filtered
3309 on-the-fly through the specified regular expression based
3318 The name of a client-header filter, as defined in one of the
3323 Client-header filters are applied to each header on its own, not
3324 to all at once. This makes it easier to diagnose problems, but on
3325 the downside you can't write filters that only change header x if
3326 header y's value is z. You can do that by using tags though.
3328 Client-header filters are executed after the other header actions
3329 have finished and use their output as input.
3331 If the request URL gets changed, Privoxy will detect that and use
3332 the new one. This can be used to rewrite the request destination
3333 behind the client's back, for example to specify a Tor exit relay
3334 for certain requests.
3336 Please refer to the filter file chapter to learn which
3337 client-header filters are available by default, and how to create
3340 Example usage (section):
3342 {+client-header-filter{hide-tor-exit-notation}}
3346 --------------------------------------------------------------------------
3348 8.5.4. client-header-tagger
3352 Block requests based on their headers.
3356 Client headers to which this action applies are filtered
3357 on-the-fly through the specified regular expression based
3358 substitutions, the result is used as tag.
3366 The name of a client-header tagger, as defined in one of the
3371 Client-header taggers are applied to each header on its own, and
3372 as the header isn't modified, each tagger "sees" the original.
3374 Client-header taggers are the first actions that are executed and
3375 their tags can be used to control every other action.
3377 Example usage (section):
3379 # Tag every request with the User-Agent header
3380 {+client-header-tagger{user-agent}}
3384 --------------------------------------------------------------------------
3386 8.5.5. content-type-overwrite
3390 Stop useless download menus from popping up, or change the
3391 browser's rendering mode
3395 Replaces the "Content-Type:" HTTP server header.
3407 The "Content-Type:" HTTP server header is used by the browser to
3408 decide what to do with the document. The value of this header can
3409 cause the browser to open a download menu instead of displaying
3410 the document by itself, even if the document's format is supported
3413 The declared content type can also affect which rendering mode the
3414 browser chooses. If XHTML is delivered as "text/html", many
3415 browsers treat it as yet another broken HTML document. If it is
3416 send as "application/xml", browsers with XHTML support will only
3417 display it, if the syntax is correct.
3419 If you see a web site that proudly uses XHTML buttons, but sets
3420 "Content-Type: text/html", you can use Privoxy to overwrite it
3421 with "application/xml" and validate the web master's claim inside
3422 your XHTML-supporting browser. If the syntax is incorrect, the
3423 browser will complain loudly.
3425 You can also go the opposite direction: if your browser prints
3426 error messages instead of rendering a document falsely declared as
3427 XHTML, you can overwrite the content type with "text/html" and
3428 have it rendered as broken HTML document.
3430 By default content-type-overwrite only replaces "Content-Type:"
3431 headers that look like some kind of text. If you want to overwrite
3432 it unconditionally, you have to combine it with force-text-mode.
3433 This limitation exists for a reason, think twice before
3436 Most of the time it's easier to replace this action with a custom
3437 server-header filter. It allows you to activate it for every
3438 document of a certain site and it will still only replace the
3439 content types you aimed at.
3441 Of course you can apply content-type-overwrite to a whole site and
3442 then make URL based exceptions, but it's a lot more work to get
3445 Example usage (sections):
3447 # Check if www.example.net/ really uses valid XHTML
3448 { +content-type-overwrite{application/xml} }
3451 # but leave the content type unmodified if the URL looks like a style sheet
3452 {-content-type-overwrite}
3453 www.example.net/.*\.css$
3454 www.example.net/.*style
3456 --------------------------------------------------------------------------
3458 8.5.6. crunch-client-header
3462 Remove a client header Privoxy has no dedicated action for.
3466 Deletes every header sent by the client that contains the string
3467 the user supplied as parameter.
3479 This action allows you to block client headers for which no
3480 dedicated Privoxy action exists. Privoxy will remove every client
3481 header that contains the string you supplied as parameter.
3483 Regular expressions are not supported and you can't use this
3484 action to block different headers in the same request, unless they
3485 contain the same string.
3487 crunch-client-header is only meant for quick tests. If you have to
3488 block several different headers, or only want to modify parts of
3489 them, you should use a client-header filter.
3491 +---------------------------------------------------------+
3493 |---------------------------------------------------------|
3494 | Don't block any header without understanding the |
3496 +---------------------------------------------------------+
3498 Example usage (section):
3500 # Block the non-existent "Privacy-Violation:" client header
3501 { +crunch-client-header{Privacy-Violation:} }
3505 --------------------------------------------------------------------------
3507 8.5.7. crunch-if-none-match
3511 Prevent yet another way to track the user's steps between
3516 Deletes the "If-None-Match:" HTTP client header.
3528 Removing the "If-None-Match:" HTTP client header is useful for
3529 filter testing, where you want to force a real reload instead of
3530 getting status code "304" which would cause the browser to use a
3531 cached copy of the page.
3533 It is also useful to make sure the header isn't used as a cookie
3534 replacement (unlikely but possible).
3536 Blocking the "If-None-Match:" header shouldn't cause any caching
3537 problems, as long as the "If-Modified-Since:" header isn't blocked
3540 It is recommended to use this action together with
3541 hide-if-modified-since and overwrite-last-modified.
3543 Example usage (section):
3545 # Let the browser revalidate cached documents but don't
3546 # allow the server to use the revalidation headers for user tracking.
3547 {+hide-if-modified-since{-60} \
3548 +overwrite-last-modified{randomize} \
3549 +crunch-if-none-match}
3552 --------------------------------------------------------------------------
3554 8.5.8. crunch-incoming-cookies
3558 Prevent the web server from setting HTTP cookies on your system
3562 Deletes any "Set-Cookie:" HTTP headers from server replies.
3574 This action is only concerned with incoming HTTP cookies. For
3575 outgoing HTTP cookies, use crunch-outgoing-cookies. Use both to
3576 disable HTTP cookies completely.
3578 It makes no sense at all to use this action in conjunction with
3579 the session-cookies-only action, since it would prevent the
3580 session cookies from being set. See also filter-content-cookies.
3584 +crunch-incoming-cookies
3586 --------------------------------------------------------------------------
3588 8.5.9. crunch-server-header
3592 Remove a server header Privoxy has no dedicated action for.
3596 Deletes every header sent by the server that contains the string
3597 the user supplied as parameter.
3609 This action allows you to block server headers for which no
3610 dedicated Privoxy action exists. Privoxy will remove every server
3611 header that contains the string you supplied as parameter.
3613 Regular expressions are not supported and you can't use this
3614 action to block different headers in the same request, unless they
3615 contain the same string.
3617 crunch-server-header is only meant for quick tests. If you have to
3618 block several different headers, or only want to modify parts of
3619 them, you should use a custom server-header filter.
3621 +---------------------------------------------------------+
3623 |---------------------------------------------------------|
3624 | Don't block any header without understanding the |
3626 +---------------------------------------------------------+
3628 Example usage (section):
3630 # Crunch server headers that try to prevent caching
3631 { +crunch-server-header{no-cache} }
3634 --------------------------------------------------------------------------
3636 8.5.10. crunch-outgoing-cookies
3640 Prevent the web server from reading any HTTP cookies from your
3645 Deletes any "Cookie:" HTTP headers from client requests.
3657 This action is only concerned with outgoing HTTP cookies. For
3658 incoming HTTP cookies, use crunch-incoming-cookies. Use both to
3659 disable HTTP cookies completely.
3661 It makes no sense at all to use this action in conjunction with
3662 the session-cookies-only action, since it would prevent the
3663 session cookies from being read.
3667 +crunch-outgoing-cookies
3669 --------------------------------------------------------------------------
3671 8.5.11. deanimate-gifs
3675 Stop those annoying, distracting animated GIF images.
3679 De-animate GIF animations, i.e. reduce them to their first or last
3692 This will also shrink the images considerably (in bytes, not
3693 pixels!). If the option "first" is given, the first frame of the
3694 animation is used as the replacement. If "last" is given, the last
3695 frame of the animation is used instead, which probably makes more
3696 sense for most banner animations, but also has the risk of not
3697 showing the entire last frame (if it is only a delta to an earlier
3700 You can safely use this action with patterns that will also match
3701 non-GIF objects, because no attempt will be made at anything that
3702 doesn't look like a GIF.
3706 +deanimate-gifs{last}
3708 --------------------------------------------------------------------------
3710 8.5.12. downgrade-http-version
3714 Work around (very rare) problems with HTTP/1.1
3718 Downgrades HTTP/1.1 client requests and server replies to
3731 This is a left-over from the time when Privoxy didn't support
3732 important HTTP/1.1 features well. It is left here for the unlikely
3733 case that you experience HTTP/1.1 related problems with some
3734 server out there. Not all HTTP/1.1 features and requirements are
3735 supported yet, so there is a chance you might need this action.
3737 Example usage (section):
3739 {+downgrade-http-version}
3740 problem-host.example.com
3742 --------------------------------------------------------------------------
3744 8.5.13. fast-redirects
3748 Fool some click-tracking scripts and speed up indirect links.
3752 Detects redirection URLs and redirects the browser without
3753 contacting the redirection server first.
3761 * "simple-check" to just search for the string "http://" to
3762 detect redirection URLs.
3764 * "check-decoded-url" to decode URLs (if necessary) before
3765 searching for redirection URLs.
3769 Many sites, like yahoo.com, don't just link to other sites.
3770 Instead, they will link to some script on their own servers,
3771 giving the destination as a parameter, which will then redirect
3772 you to the final target. URLs resulting from this scheme typically
3774 "http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/".
3776 Sometimes, there are even multiple consecutive redirects encoded
3777 in the URL. These redirections via scripts make your web browsing
3778 more traceable, since the server from which you follow such a link
3779 can see where you go to. Apart from that, valuable bandwidth and
3780 time is wasted, while your browser asks the server for one
3781 redirect after the other. Plus, it feeds the advertisers.
3783 This feature is currently not very smart and is scheduled for
3784 improvement. If it is enabled by default, you will have to create
3785 some exceptions to this action. It can lead to failures in several
3788 Not every URLs with other URLs as parameters is evil. Some sites
3789 offer a real service that requires this information to work. For
3790 example a validation service needs to know, which document to
3791 validate. fast-redirects assumes that every URL parameter that
3792 looks like another URL is a redirection target, and will always
3793 redirect to the last one. Most of the time the assumption is
3794 correct, but if it isn't, the user gets redirected anyway.
3796 Another failure occurs if the URL contains other parameters after
3797 the URL parameter. The URL:
3798 "http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar".
3799 contains the redirection URL "http://www.example.net/", followed
3800 by another parameter. fast-redirects doesn't know that and will
3801 cause a redirect to "http://www.example.net/&foo=bar". Depending
3802 on the target server configuration, the parameter will be silently
3803 ignored or lead to a "page not found" error. You can prevent this
3804 problem by first using the redirect action to remove the last part
3805 of the URL, but it requires a little effort.
3807 To detect a redirection URL, fast-redirects only looks for the
3808 string "http://", either in plain text (invalid but often used) or
3809 encoded as "http%3a//". Some sites use their own URL encoding
3810 scheme, encrypt the address of the target server or replace it
3811 with a database id. In theses cases fast-redirects is fooled and
3812 the request reaches the redirection server where it probably gets
3817 { +fast-redirects{simple-check} }
3820 { +fast-redirects{check-decoded-url} }
3821 another.example.com/testing
3823 --------------------------------------------------------------------------
3829 Get rid of HTML and JavaScript annoyances, banner advertisements
3830 (by size), do fun text replacements, add personalized effects,
3835 All instances of text-based type, most notably HTML and
3836 JavaScript, to which this action applies, can be filtered
3837 on-the-fly through the specified regular expression based
3838 substitutions. (Note: as of version 3.0.3 plain text documents are
3839 exempted from filtering, because web servers often use the
3840 text/plain MIME type for all files whose type they don't know.)
3848 The name of a content filter, as defined in the filter file.
3849 Filters can be defined in one or more files as defined by the
3850 filterfile option in the config file. default.filter is the
3851 collection of filters supplied by the developers. Locally defined
3852 filters should go in their own file, such as user.filter.
3854 When used in its negative form, and without parameters, all
3855 filtering is completely disabled.
3859 For your convenience, there are a number of pre-defined filters
3860 available in the distribution filter file that you can use. See
3861 the examples below for a list.
3863 Filtering requires buffering the page content, which may appear to
3864 slow down page rendering since nothing is displayed until all
3865 content has passed the filters. (It does not really take longer,
3866 but seems that way since the page is not incrementally displayed.)
3867 This effect will be more noticeable on slower connections.
3869 "Rolling your own" filters requires a knowledge of "Regular
3870 Expressions" and "HTML". This is very powerful feature, and
3871 potentially very intrusive. Filters should be used with caution,
3872 and where an equivalent "action" is not available.
3874 The amount of data that can be filtered is limited to the
3875 buffer-limit option in the main config file. The default is 4096
3876 KB (4 Megs). Once this limit is exceeded, the buffered data, and
3877 all pending data, is passed through unfiltered.
3879 Inappropriate MIME types, such as zipped files, are not filtered
3880 at all. (Again, only text-based types except plain text).
3881 Encrypted SSL data (from HTTPS servers) cannot be filtered either,
3882 since this would violate the integrity of the secure transaction.
3883 In some situations it might be necessary to protect certain text,
3884 like source code, from filtering by defining appropriate -filter
3887 Compressed content can't be filtered either, unless Privoxy is
3888 compiled with zlib support (requires at least Privoxy 3.0.7), in
3889 which case Privoxy will decompress the content before filtering
3892 If you use a Privoxy version without zlib support, but want
3893 filtering to work on as much documents as possible, even those
3894 that would normally be sent compressed, you must use the
3895 prevent-compression action in conjunction with filter.
3897 Content filtering can achieve some of the same effects as the
3898 block action, i.e. it can be used to block ads and banners. But
3899 the mechanism works quite differently. One effective use, is to
3900 block ad banners based on their size (see below), since many of
3901 these seem to be somewhat standardized.
3903 Feedback with suggestions for new or improved filters is
3904 particularly welcome!
3906 The below list has only the names and a one-line description of
3907 each predefined filter. There are more verbose explanations of
3908 what these filters do in the filter file chapter.
3910 Example usage (with filters from the distribution default.filter file).
3911 See the Predefined Filters section for more explanation on each:
3913 +filter{js-annoyances} # Get rid of particularly annoying JavaScript abuse
3915 +filter{js-events} # Kill all JS event bindings (Radically destructive! Only for extra nasty sites)
3917 +filter{html-annoyances} # Get rid of particularly annoying HTML abuse
3919 +filter{content-cookies} # Kill cookies that come in the HTML or JS content
3921 +filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups)
3923 +filter{unsolicited-popups} # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.
3925 +filter{all-popups} # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.
3927 +filter{img-reorder} # Reorder attributes in <img> tags to make the banners-by-* filters more effective
3929 +filter{banners-by-size} # Kill banners by size
3931 +filter{banners-by-link} # Kill banners by their links to known clicktrackers
3933 +filter{webbugs} # Squish WebBugs (1x1 invisible GIFs used for user tracking)
3935 +filter{tiny-textforms} # Extend those tiny textareas up to 40x80 and kill the hard wrap
3937 +filter{jumping-windows} # Prevent windows from resizing and moving themselves
3939 +filter{frameset-borders} # Give frames a border and make them resizeable
3941 +filter{demoronizer} # Fix MS's non-standard use of standard charsets
3943 +filter{shockwave-flash} # Kill embedded Shockwave Flash objects
3945 +filter{quicktime-kioskmode} # Make Quicktime movies savable
3947 +filter{fun} # Text replacements for subversive browsing fun!
3949 +filter{crude-parental} # Crude parental filtering (demo only)
3951 +filter{ie-exploits} # Disable a known Internet Explorer bug exploits
3953 +filter{site-specifics} # Custom filters for specific site related problems
3955 +filter{google} # Removes text ads and other Google specific improvements
3957 +filter{yahoo} # Removes text ads and other Yahoo specific improvements
3959 +filter{msn} # Removes text ads and other MSN specific improvements
3961 +filter{blogspot} # Cleans up Blogspot blogs
3963 +filter{no-ping} # Removes non-standard ping attributes from anchor and area tags
3965 --------------------------------------------------------------------------
3967 8.5.15. force-text-mode
3971 Force Privoxy to treat a document as if it was in some kind of
3976 Declares a document as text, even if the "Content-Type:" isn't
3989 As explained above, Privoxy tries to only filter files that are in
3990 some kind of text format. The same restrictions apply to
3991 content-type-overwrite. force-text-mode declares a document as
3992 text, without looking at the "Content-Type:" first.
3994 +---------------------------------------------------------+
3996 |---------------------------------------------------------|
3997 | Think twice before activating this action. Filtering |
3998 | binary data with regular expressions can cause file |
4000 +---------------------------------------------------------+
4007 --------------------------------------------------------------------------
4009 8.5.16. forward-override
4013 Change the forwarding settings based on User-Agent or request
4018 Overrules the forward directives in the configuration file.
4026 * "forward ." to use a direct connection without any additional
4029 * "forward 127.0.0.1:8123" to use the HTTP proxy listening at
4030 127.0.0.1 port 8123.
4032 * "forward-socks4a 127.0.0.1:9050 ." to use the socks4a proxy
4033 listening at 127.0.0.1 port 9050. Replace "forward-socks4a"
4034 with "forward-socks4" to use a socks4 connection (with local
4035 DNS resolution) instead.
4037 * "forward-socks4a 127.0.0.1:9050 proxy.example.org:8000" to
4038 use the socks4a proxy listening at 127.0.0.1 port 9050 to
4039 reach the HTTP proxy listening at proxy.example.org port
4040 8000. Replace "forward-socks4a" with "forward-socks4" to use
4041 a socks4 connection (with local DNS resolution) instead.
4045 This action takes parameters similar to the forward directives in
4046 the configuration file, but without the URL pattern. It can be
4047 used as replacement, but normally it's only used in cases where
4048 matching based on the request URL isn't sufficient.
4050 +---------------------------------------------------------+
4052 |---------------------------------------------------------|
4053 | Please read the description for the forward directives |
4054 | before using this action. Forwarding to the wrong |
4055 | people will reduce your privacy and increase the |
4056 | chances of man-in-the-middle attacks. |
4058 | If the ports are missing or invalid, default values |
4059 | will be used. This might change in the future and you |
4060 | shouldn't rely on it. Otherwise incorrect syntax causes |
4061 | Privoxy to exit. |
4063 | Use the show-url-info CGI page to verify that your |
4064 | forward settings do what you thought the do. |
4065 +---------------------------------------------------------+
4069 # Always use direct connections for requests previously tagged as
4070 # "User-Agent: fetch libfetch/2.0" and make sure
4071 # resuming downloads continues to work.
4072 # This way you can continue to use Tor for your normal browsing,
4073 # without overloading the Tor network with your FreeBSD ports updates
4074 # or downloads of bigger files like ISOs.
4075 # Note that HTTP headers are easy to fake and therefore their
4076 # values are as (un)trustworthy as your clients and users.
4077 {+forward-override{forward .} \
4078 -hide-if-modified-since \
4079 -overwrite-last-modified \
4081 TAG:^User-Agent: fetch libfetch/2\.0$
4084 --------------------------------------------------------------------------
4086 8.5.17. handle-as-empty-document
4090 Mark URLs that should be replaced by empty documents if they get
4095 This action alone doesn't do anything noticeable. It just marks
4096 URLs. If the block action also applies, the presence or absence of
4097 this mark decides whether an HTML "BLOCKED" page, or an empty
4098 document will be sent to the client as a substitute for the
4099 blocked content. The empty document isn't literally empty, but
4100 actually contains a single space.
4112 Some browsers complain about syntax errors if JavaScript documents
4113 are blocked with Privoxy's default HTML page; this option can be
4114 used to silence them. And of course this action can also be used
4115 to eliminate the Privoxy BLOCKED message in frames.
4117 The content type for the empty document can be specified with
4118 content-type-overwrite{}, but usually this isn't necessary.
4122 # Block all documents on example.org that end with ".js",
4123 # but send an empty document instead of the usual HTML message.
4124 {+block +handle-as-empty-document}
4128 --------------------------------------------------------------------------
4130 8.5.18. handle-as-image
4134 Mark URLs as belonging to images (so they'll be replaced by images
4135 if they do get blocked, rather than HTML pages)
4139 This action alone doesn't do anything noticeable. It just marks
4140 URLs as images. If the block action also applies, the presence or
4141 absence of this mark decides whether an HTML "blocked" page, or a
4142 replacement image (as determined by the set-image-blocker action)
4143 will be sent to the client as a substitute for the blocked
4156 The below generic example section is actually part of
4157 default.action. It marks all URLs with well-known image file name
4158 extensions as images and should be left intact.
4160 Users will probably only want to use the handle-as-image action in
4161 conjunction with block, to block sources of banners, whose URLs
4162 don't reflect the file type, like in the second example section.
4164 Note that you cannot treat HTML pages as images in most cases. For
4165 instance, (in-line) ad frames require an HTML page to be sent, or
4166 they won't display properly. Forcing handle-as-image in this
4167 situation will not replace the ad frame with an image, but lead to
4170 Example usage (sections):
4172 # Generic image extensions:
4175 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
4177 # These don't look like images, but they're banners and should be
4178 # blocked as images:
4180 {+block +handle-as-image}
4181 some.nasty-banner-server.com/junk.cgi\?output=trash
4183 # Banner source! Who cares if they also have non-image content?
4186 --------------------------------------------------------------------------
4188 8.5.19. hide-accept-language
4192 Pretend to use different language settings.
4196 Deletes or replaces the "Accept-Language:" HTTP header in client
4205 Keyword: "block", or any user defined value.
4209 Faking the browser's language settings can be useful to make a
4210 foreign User-Agent set with hide-user-agent more believable.
4212 However some sites with content in different languages check the
4213 "Accept-Language:" to decide which one to take by default.
4214 Sometimes it isn't possible to later switch to another language
4215 without changing the "Accept-Language:" header first.
4217 Therefore it's a good idea to either only change the
4218 "Accept-Language:" header to languages you understand, or to
4219 languages that aren't wide spread.
4221 Before setting the "Accept-Language:" header to a rare language,
4222 you should consider that it helps to make your requests unique and
4223 thus easier to trace. If you don't plan to change this header
4224 frequently, you should stick to a common language.
4226 Example usage (section):
4228 # Pretend to use Canadian language settings.
4229 {+hide-accept-language{en-ca} \
4230 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
4234 --------------------------------------------------------------------------
4236 8.5.20. hide-content-disposition
4240 Prevent download menus for content you prefer to view inside the
4245 Deletes or replaces the "Content-Disposition:" HTTP header set by
4254 Keyword: "block", or any user defined value.
4258 Some servers set the "Content-Disposition:" HTTP header for
4259 documents they assume you want to save locally before viewing
4260 them. The "Content-Disposition:" header contains the file name the
4261 browser is supposed to use by default.
4263 In most browsers that understand this header, it makes it
4264 impossible to just view the document, without downloading it
4265 first, even if it's just a simple text file or an image.
4267 Removing the "Content-Disposition:" header helps to prevent this
4268 annoyance, but some browsers additionally check the
4269 "Content-Type:" header, before they decide if they can display a
4270 document without saving it first. In these cases, you have to
4271 change this header as well, before the browser stops displaying
4274 It is also possible to change the server's file name suggestion to
4275 another one, but in most cases it isn't worth the time to set it
4278 This action will probably be removed in the future, use
4279 server-header filters instead.
4283 # Disarm the download link in Sourceforge's patch tracker
4285 +content-type-overwrite{text/plain}\
4286 +hide-content-disposition{block} }
4287 .sourceforge.net/tracker/download\.php
4289 --------------------------------------------------------------------------
4291 8.5.21. hide-if-modified-since
4295 Prevent yet another way to track the user's steps between
4300 Deletes the "If-Modified-Since:" HTTP client header or modifies
4309 Keyword: "block", or a user defined value that specifies a range
4314 Removing this header is useful for filter testing, where you want
4315 to force a real reload instead of getting status code "304", which
4316 would cause the browser to use a cached copy of the page.
4318 Instead of removing the header, hide-if-modified-since can also
4319 add or subtract a random amount of time to/from the header's
4320 value. You specify a range of minutes where the random factor
4321 should be chosen from and Privoxy does the rest. A negative value
4322 means subtracting, a positive value adding.
4324 Randomizing the value of the "If-Modified-Since:" makes it less
4325 likely that the server can use the time as a cookie replacement,
4326 but you will run into caching problems if the random range is too
4329 It is a good idea to only use a small negative value and let
4330 overwrite-last-modified handle the greater changes.
4332 It is also recommended to use this action together with
4333 crunch-if-none-match, otherwise it's more or less pointless.
4335 Example usage (section):
4337 # Let the browser revalidate but make tracking based on the time less likely.
4338 {+hide-if-modified-since{-60} \
4339 +overwrite-last-modified{randomize} \
4340 +crunch-if-none-match}
4343 --------------------------------------------------------------------------
4345 8.5.22. hide-forwarded-for-headers
4349 Improve privacy by not forwarding the source of the request in the
4354 Deletes any existing "X-Forwarded-for:" HTTP header from client
4367 It is safe and recommended to leave this on.
4371 +hide-forwarded-for-headers
4373 --------------------------------------------------------------------------
4375 8.5.23. hide-from-header
4379 Keep your (old and ill) browser from telling web servers your
4384 Deletes any existing "From:" HTTP header, or replaces it with the
4393 Keyword: "block", or any user defined value.
4397 The keyword "block" will completely remove the header (not to be
4398 confused with the block action).
4400 Alternately, you can specify any value you prefer to be sent to
4401 the web server. If you do, it is a matter of fairness not to use
4402 any address that is actually used by a real person.
4404 This action is rarely needed, as modern web browsers don't send
4405 "From:" headers anymore.
4409 +hide-from-header{block}
4413 +hide-from-header{spam-me-senseless@sittingduck.example.com}
4415 --------------------------------------------------------------------------
4417 8.5.24. hide-referrer
4421 Conceal which link you followed to get to a particular site
4425 Deletes the "Referer:" (sic) HTTP header from the client request,
4426 or replaces it with a forged one.
4434 * "conditional-block" to delete the header completely if the
4437 * "conditional-forge" to forge the header if the host has
4440 * "block" to delete the header unconditionally.
4442 * "forge" to pretend to be coming from the homepage of the
4443 server we are talking to.
4445 * Any other string to set a user defined referrer.
4449 conditional-block is the only parameter, that isn't easily
4450 detected in the server's log file. If it blocks the referrer, the
4451 request will look like the visitor used a bookmark or typed in the
4454 Leaving the referrer unmodified for requests on the same host
4455 allows the server owner to see the visitor's "click path", but in
4456 most cases she could also get that information by comparing other
4457 parts of the log file: for example the User-Agent if it isn't a
4458 very common one, or the user's IP address if it doesn't change
4459 between different requests.
4461 Always blocking the referrer, or using a custom one, can lead to
4462 failures on servers that check the referrer before they answer any
4463 requests, in an attempt to prevent their content from being
4464 embedded or linked to elsewhere.
4466 Both conditional-block and forge will work with referrer checks,
4467 as long as content and valid referring page are on the same host.
4468 Most of the time that's the case.
4470 hide-referer is an alternate spelling of hide-referrer and the two
4471 can be can be freely substituted with each other. ("referrer" is
4472 the correct English spelling, however the HTTP specification has a
4473 bug - it requires it to be spelled as "referer".)
4477 +hide-referrer{forge}
4481 +hide-referrer{http://www.yahoo.com/}
4483 --------------------------------------------------------------------------
4485 8.5.25. hide-user-agent
4489 Try to conceal your type of browser and client operating system
4493 Replaces the value of the "User-Agent:" HTTP header in client
4494 requests with the specified value.
4502 Any user-defined string.
4506 +---------------------------------------------------------+
4508 |---------------------------------------------------------|
4509 | This can lead to problems on web sites that depend on |
4510 | looking at this header in order to customize their |
4511 | content for different browsers (which, by the way, is |
4512 | NOT the right thing to do: good web sites work |
4513 | browser-independently). |
4514 +---------------------------------------------------------+
4516 Using this action in multi-user setups or wherever different types
4517 of browsers will access the same Privoxy is not recommended. In
4518 single-user, single-browser setups, you might use it to delete
4519 your OS version information from the headers, because it is an
4520 invitation to exploit known bugs for your OS. It is also
4521 occasionally useful to forge this in order to access sites that
4522 won't let you in otherwise (though there may be a good reason in
4523 some cases). Example of this: some MSN sites will not let Mozilla
4524 enter, yet forging to a Netscape 6.1 user-agent works just fine.
4525 (Must be just a silly MS goof, I'm sure :-).
4527 More information on known user-agent strings can be found at
4528 http://www.user-agents.org/ and
4529 http://en.wikipedia.org/wiki/User_agent.
4533 +hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}
4535 --------------------------------------------------------------------------
4537 8.5.26. inspect-jpegs
4541 Try to protect against a MS buffer over-run in JPEG processing
4545 Protect against a known exploit
4557 See Microsoft Security Bulletin MS04-028. JPEG images are one of
4558 the most common image types found across the Internet. The exploit
4559 as described can allow execution of code on the target system,
4560 giving an attacker access to the system in question by merely
4561 planting an altered JPEG image, which would have no obvious
4562 indications of what lurks inside. This action tries to prevent
4563 this exploit if delivered through unencrypted HTTP.
4565 Note that the exploit mentioned is several years old and it's
4566 unlikely that your client is still vulnerable against it. This
4567 action may be removed in one of the next releases.
4573 --------------------------------------------------------------------------
4579 Eliminate those annoying pop-up windows (deprecated)
4583 While loading the document, replace JavaScript code that opens
4584 pop-up windows with (syntactically neutral) dummy code on the fly.
4596 This action is basically a built-in, hardwired special-purpose
4597 filter action, but there are important differences: For
4598 kill-popups, the document need not be buffered, so it can be
4599 incrementally rendered while downloading. But kill-popups doesn't
4600 catch as many pop-ups as filter{all-popups} does and is not as
4601 smart as filter{unsolicited-popups} is.
4603 Think of it as a fast and efficient replacement for a filter that
4604 you can use if you don't want any filtering at all. Note that it
4605 doesn't make sense to combine it with any filter action, since as
4606 soon as one filter applies, the whole document needs to be
4607 buffered anyway, which destroys the advantage of the kill-popups
4608 action over its filter equivalent.
4610 Killing all pop-ups unconditionally is problematic. Many shops and
4611 banks rely on pop-ups to display forms, shopping carts etc, and
4612 the filter{unsolicited-popups} does a better job of catching only
4615 If the only kind of pop-ups that you want to kill are exit
4616 consoles (those really nasty windows that appear when you close an
4617 other one), you might want to use filter{js-annoyances} instead.
4619 This action is most appropriate for browsers that don't have any
4620 controls for unwanted pop-ups. Not recommended for general usage.
4622 This action doesn't work very reliable and may be removed in
4629 --------------------------------------------------------------------------
4631 8.5.28. limit-connect
4635 Prevent abuse of Privoxy as a TCP proxy relay or disable SSL for
4640 Specifies to which ports HTTP CONNECT requests are allowable.
4648 A comma-separated list of ports or port ranges (the latter using
4649 dashes, with the minimum defaulting to 0 and the maximum to 65K).
4653 By default, i.e. if no limit-connect action applies, Privoxy only
4654 allows HTTP CONNECT requests to port 443 (the standard, secure
4655 HTTPS port). Use limit-connect if more fine-grained control is
4656 desired for some or all destinations.
4658 The CONNECT methods exists in HTTP to allow access to secure
4659 websites ("https://" URLs) through proxies. It works very simply:
4660 the proxy connects to the server on the specified port, and then
4661 short-circuits its connections to the client and to the remote
4662 server. This means CONNECT-enabled proxies can be used as TCP
4665 Privoxy relays HTTPS traffic without seeing the decoded content.
4666 Websites can leverage this limitation to circumvent Privoxy's
4667 filters. By specifying an invalid port range you can disable HTTPS
4668 entirely. If you plan to disable SSL by default, consider enabling
4669 treat-forbidden-connects-like-blocks as well, to be able to
4670 quickly create exceptions.
4674 +limit-connect{443} # This is the default and need not be specified.
4675 +limit-connect{80,443} # Ports 80 and 443 are OK.
4676 +limit-connect{-3, 7, 20-100, 500-} # Ports less than 3, 7, 20 to 100 and above 500 are OK.
4677 +limit-connect{-} # All ports are OK
4678 +limit-connect{,} # No HTTPS/SSL traffic is allowed
4680 --------------------------------------------------------------------------
4682 8.5.29. prevent-compression
4686 Ensure that servers send the content uncompressed, so it can be
4687 passed through filters.
4691 Removes the Accept-Encoding header which can be used to ask for
4692 compressed transfer.
4704 More and more websites send their content compressed by default,
4705 which is generally a good idea and saves bandwidth. But the
4706 filter, deanimate-gifs and kill-popups actions need access to the
4709 When compiled with zlib support (available since Privoxy 3.0.7),
4710 content that should be filtered is decompressed on-the-fly and you
4711 don't have to worry about this action. If you are using an older
4712 Privoxy version, or one that hasn't been compiled with zlib
4713 support, this action can be used to convince the server to send
4714 the content uncompressed.
4716 Most text-based instances compress very well, the size is seldom
4717 decreased by less than 50%, for markup-heavy instances like news
4718 feeds saving more than 90% of the original size isn't unusual.
4720 Not using compression will therefore slow down the transfer, and
4721 you should only enable this action if you really need it. As of
4722 Privoxy 3.0.7 it's disabled in all predefined action settings.
4724 Note that some (rare) ill-configured sites don't handle requests
4725 for uncompressed documents correctly. Broken PHP applications tend
4726 to send an empty document body, some IIS versions only send the
4727 beginning of the content. If you enable prevent-compression per
4728 default, you might want to add exceptions for those sites. See the
4729 example for how to do that.
4731 Example usage (sections):
4733 # Selectively turn off compression, and enable a filter
4735 { +filter{tiny-textforms} +prevent-compression }
4736 # Match only these sites
4741 # Or instead, we could set a universal default:
4743 { +prevent-compression }
4746 # Then maybe make exceptions for broken sites:
4748 { -prevent-compression }
4751 --------------------------------------------------------------------------
4753 8.5.30. overwrite-last-modified
4757 Prevent yet another way to track the user's steps between
4762 Deletes the "Last-Modified:" HTTP server header or modifies its
4771 One of the keywords: "block", "reset-to-request-time" and
4776 Removing the "Last-Modified:" header is useful for filter testing,
4777 where you want to force a real reload instead of getting status
4778 code "304", which would cause the browser to reuse the old version
4781 The "randomize" option overwrites the value of the
4782 "Last-Modified:" header with a randomly chosen time between the
4783 original value and the current time. In theory the server could
4784 send each document with a different "Last-Modified:" header to
4785 track visits without using cookies. "Randomize" makes it
4786 impossible and the browser can still revalidate cached documents.
4788 "reset-to-request-time" overwrites the value of the
4789 "Last-Modified:" header with the current time. You could use this
4790 option together with hided-if-modified-since to further customize
4793 The preferred parameter here is "randomize". It is safe to use, as
4794 long as the time settings are more or less correct. If the server
4795 sets the "Last-Modified:" header to the time of the request, the
4796 random range becomes zero and the value stays the same. Therefore
4797 you should later randomize it a second time with
4798 hided-if-modified-since, just to be sure.
4800 It is also recommended to use this action together with
4801 crunch-if-none-match.
4805 # Let the browser revalidate without being tracked across sessions
4806 { +hide-if-modified-since{-60} \
4807 +overwrite-last-modified{randomize} \
4808 +crunch-if-none-match}
4811 --------------------------------------------------------------------------
4817 Redirect requests to other sites.
4821 Convinces the browser that the requested document has been moved
4822 to another location and the browser should get it from there.
4830 An absolute URL or a single pcrs command.
4834 Requests to which this action applies are answered with a HTTP
4835 redirect to URLs of your choosing. The new URL is either provided
4836 as parameter, or derived by applying a single pcrs command to the
4839 This action will be ignored if you use it together with block. It
4840 can be combined with fast-redirects{check-decoded-url} to redirect
4841 to a decoded version of a rewritten URL.
4843 Use this action carefully, make sure not to create redirection
4844 loops and be aware that using your own redirects might make it
4845 possible to fingerprint your requests.
4849 # Replace example.com's style sheet with another one
4850 { +redirect{http://localhost/css-replacements/example.com.css} }
4851 example.com/stylesheet\.css
4853 # Create a short, easy to remember nickname for a favorite site
4854 # (relies on the browser accept and forward invalid URLs to Privoxy)
4855 { +redirect{http://www.privoxy.org/user-manual/actions-file.html} }
4858 # Always use the expanded view for Undeadly.org articles
4859 # (Note the $ at the end of the URL pattern to make sure
4860 # the request for the rewritten URL isn't redirected as well)
4861 {+redirect{s@$@&mode=expanded@}}
4862 undeadly.org/cgi\?action=article&sid=\d*$
4864 --------------------------------------------------------------------------
4866 8.5.32. send-vanilla-wafer
4870 Feed log analysis scripts with useless data.
4874 Sends a cookie with each request stating that you do not accept
4875 any copyright on cookies sent to you, and asking the site operator
4888 The vanilla wafer is a (relatively) unique header and could
4889 conceivably be used to track you.
4891 This action is rarely used and not enabled in the default
4898 --------------------------------------------------------------------------
4904 Send custom cookies or feed log analysis scripts with even more
4909 Sends a custom, user-defined cookie with each request.
4917 A string of the form "name=value".
4921 Being multi-valued, multiple instances of this action can apply to
4922 the same request, resulting in multiple cookies being sent.
4924 This action is rarely used and not enabled in the default
4927 Example usage (section):
4929 {+send-wafer{UsingPrivoxy=true}}
4930 my-internal-testing-server.void
4932 --------------------------------------------------------------------------
4934 8.5.34. server-header-filter
4938 Rewrite or remove single server headers.
4942 All server headers to which this action applies are filtered
4943 on-the-fly through the specified regular expression based
4952 The name of a server-header filter, as defined in one of the
4957 Server-header filters are applied to each header on its own, not
4958 to all at once. This makes it easier to diagnose problems, but on
4959 the downside you can't write filters that only change header x if
4960 header y's value is z. You can do that by using tags though.
4962 Server-header filters are executed after the other header actions
4963 have finished and use their output as input.
4965 Please refer to the filter file chapter to learn which
4966 server-header filters are available by default, and how to create
4969 Example usage (section):
4971 {+server-header-filter{html-to-xml}}
4972 example.org/xml-instance-that-is-delivered-as-html
4974 {+server-header-filter{xml-to-html}}
4975 example.org/instance-that-is-delivered-as-xml-but-is-not
4978 --------------------------------------------------------------------------
4980 8.5.35. server-header-tagger
4984 Enable or disable filters based on the Content-Type header.
4988 Server headers to which this action applies are filtered
4989 on-the-fly through the specified regular expression based
4990 substitutions, the result is used as tag.
4998 The name of a server-header tagger, as defined in one of the
5003 Server-header taggers are applied to each header on its own, and
5004 as the header isn't modified, each tagger "sees" the original.
5006 Server-header taggers are executed before all other header actions
5007 that modify server headers. Their tags can be used to control all
5008 of the other server-header actions, the content filters and the
5009 crunch actions (redirect and block).
5011 Obviously crunching based on tags created by server-header taggers
5012 doesn't prevent the request from showing up in the server's log
5015 Example usage (section):
5017 # Tag every request with the content type declared by the server
5018 {+server-header-tagger{content-type}}
5022 --------------------------------------------------------------------------
5024 8.5.36. session-cookies-only
5028 Allow only temporary "session" cookies (for the current browser
5033 Deletes the "expires" field from "Set-Cookie:" server headers.
5034 Most browsers will not store such cookies permanently and forget
5035 them in between sessions.
5047 This is less strict than crunch-incoming-cookies /
5048 crunch-outgoing-cookies and allows you to browse websites that
5049 insist or rely on setting cookies, without compromising your
5052 Most browsers will not permanently store cookies that have been
5053 processed by session-cookies-only and will forget about them
5054 between sessions. This makes profiling cookies useless, but won't
5055 break sites which require cookies so that you can log in for
5056 transactions. This is generally turned on for all sites, and is
5057 the recommended setting.
5059 It makes no sense at all to use session-cookies-only together with
5060 crunch-incoming-cookies or crunch-outgoing-cookies. If you do,
5061 cookies will be plainly killed.
5063 Note that it is up to the browser how it handles such cookies
5064 without an "expires" field. If you use an exotic browser, you
5065 might want to try it out to be sure.
5067 This setting also has no effect on cookies that may have been
5068 stored previously by the browser before starting Privoxy. These
5069 would have to be removed manually.
5071 Privoxy also uses the content-cookies filter to block some types
5072 of cookies. Content cookies are not effected by
5073 session-cookies-only.
5077 +session-cookies-only
5079 --------------------------------------------------------------------------
5081 8.5.37. set-image-blocker
5085 Choose the replacement for blocked images
5089 This action alone doesn't do anything noticeable. If both block
5090 and handle-as-image also apply, i.e. if the request is to be
5091 blocked as an image, then the parameter of this action decides
5092 what will be sent as a replacement.
5100 * "pattern" to send a built-in checkerboard pattern image. The
5101 image is visually decent, scales very well, and makes it
5102 obvious where banners were busted.
5104 * "blank" to send a built-in transparent image. This makes
5105 banners disappear completely, but makes it hard to detect
5106 where Privoxy has blocked images on a given page and
5107 complicates troubleshooting if Privoxy has blocked innocent
5108 images, like navigation icons.
5110 * "target-url" to send a redirect to target-url. You can
5111 redirect to any image anywhere, even in your local filesystem
5112 via "file:///" URL. (But note that not all browsers support
5113 redirecting to a local file system).
5115 A good application of redirects is to use special
5116 Privoxy-built-in URLs, which send the built-in images, as
5117 target-url. This has the same visual effect as specifying
5118 "blank" or "pattern" in the first place, but enables your
5119 browser to cache the replacement image, instead of requesting
5120 it over and over again.
5124 The URLs for the built-in images are
5125 "http://config.privoxy.org/send-banner?type=type", where type is
5126 either "blank" or "pattern".
5128 There is a third (advanced) type, called "auto". It is NOT to be
5129 used in set-image-blocker, but meant for use from filters. Auto
5130 will select the type of image that would have applied to the
5131 referring page, had it been an image.
5137 +set-image-blocker{pattern}
5139 Redirect to the BSD daemon:
5141 +set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}
5143 Redirect to the built-in pattern for better caching:
5145 +set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}
5147 --------------------------------------------------------------------------
5149 8.5.38. treat-forbidden-connects-like-blocks
5153 Block forbidden connects with an easy to find error message.
5157 If this action is enabled, Privoxy no longer makes a difference
5158 between forbidden connects and ordinary blocks.
5170 By default Privoxy answers forbidden "Connect" requests with a
5171 short error message inside the headers. If the browser doesn't
5172 display headers (most don't), you just see an empty page.
5174 With this action enabled, Privoxy displays the message that is
5175 used for ordinary blocks instead. If you decide to make an
5176 exception for the page in question, you can do so by following the
5179 For "Connect" requests the clients tell Privoxy which host they
5180 are interested in, but not which document they plan to get later.
5181 As a result, the "Go there anyway" wouldn't work and is therefore
5186 +treat-forbidden-connects-like-blocks
5188 --------------------------------------------------------------------------
5192 Note that many of these actions have the potential to cause a page to
5193 misbehave, possibly even not to display at all. There are many ways a site
5194 designer may choose to design his site, and what HTTP header content, and
5195 other criteria, he may depend on. There is no way to have hard and fast
5196 rules for all sites. See the Appendix for a brief example on
5197 troubleshooting actions.
5199 --------------------------------------------------------------------------
5203 Custom "actions", known to Privoxy as "aliases", can be defined by
5204 combining other actions. These can in turn be invoked just like the
5205 built-in actions. Currently, an alias name can contain any character
5206 except space, tab, "=", "{" and "}", but we strongly recommend that you
5207 only use "a" to "z", "0" to "9", "+", and "-". Alias names are not case
5208 sensitive, and are not required to start with a "+" or "-" sign, since
5209 they are merely textually expanded.
5211 Aliases can be used throughout the actions file, but they must be defined
5212 in a special section at the top of the file! And there can only be one
5213 such section per actions file. Each actions file may have its own alias
5214 section, and the aliases defined in it are only visible within that file.
5216 There are two main reasons to use aliases: One is to save typing for
5217 frequently used combinations of actions, the other one is a gain in
5218 flexibility: If you decide once how you want to handle shops by defining
5219 an alias called "shop", you can later change your policy on shops in one
5220 place, and your changes will take effect everywhere in the actions file
5221 where the "shop" alias is used. Calling aliases by their purpose also
5222 makes your actions files more readable.
5224 Currently, there is one big drawback to using aliases, though: Privoxy's
5225 built-in web-based action file editor honors aliases when reading the
5226 actions files, but it expands them before writing. So the effects of your
5227 aliases are of course preserved, but the aliases themselves are lost when
5228 you edit sections that use aliases with it.
5230 Now let's define some aliases...
5232 # Useful custom aliases we can use later.
5234 # Note the (required!) section header line and that this section
5235 # must be at the top of the actions file!
5239 # These aliases just save typing later:
5240 # (Note that some already use other aliases!)
5242 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
5243 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
5244 +block-as-image = +block +handle-as-image
5245 allow-all-cookies = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
5247 # These aliases define combinations of actions
5248 # that are useful for certain types of sites:
5250 fragile = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -kill-popups -prevent-compression
5252 shop = -crunch-all-cookies -filter{all-popups} -kill-popups
5254 # Short names for other aliases, for really lazy people ;-)
5256 c0 = +crunch-all-cookies
5257 c1 = -crunch-all-cookies
5259 ...and put them to use. These sections would appear in the lower part of
5260 an actions file and define exceptions to the default actions (as specified
5261 further up for the "/" pattern):
5263 # These sites are either very complex or very keen on
5264 # user data and require minimal interference to work:
5267 .office.microsoft.com
5268 .windowsupdate.microsoft.com
5269 # Gmail is really mail.google.com, not gmail.com
5273 # Allow cookies (for setting and retrieving your customer data)
5277 .worldpay.com # for quietpc.com
5280 # These shops require pop-ups:
5282 {-kill-popups -filter{all-popups} -filter{unsolicited-popups}}
5286 Aliases like "shop" and "fragile" are typically used for "problem" sites
5287 that require more than one action to be disabled in order to function
5290 --------------------------------------------------------------------------
5292 8.7. Actions Files Tutorial
5294 The above chapters have shown which actions files there are and how they
5295 are organized, how actions are specified and applied to URLs, how patterns
5296 work, and how to define and use aliases. Now, let's look at an example
5297 default.action and user.action file and see how all these pieces come
5300 --------------------------------------------------------------------------
5302 8.7.1. default.action
5304 Every config file should start with a short comment stating its purpose:
5306 # Sample default.action file <ijbswa-developers@lists.sourceforge.net>
5308 Then, since this is the default.action file, the first section is a
5309 special section for internal use that you needn't change or worry about:
5311 ##########################################################################
5312 # Settings -- Don't change! For internal Privoxy use ONLY.
5313 ##########################################################################
5316 for-privoxy-version=3.0
5318 After that comes the (optional) alias section. We'll use the example
5319 section from the above chapter on aliases, that also explains why and how
5322 ##########################################################################
5324 ##########################################################################
5327 # These aliases just save typing later:
5328 # (Note that some already use other aliases!)
5330 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
5331 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
5332 +block-as-image = +block +handle-as-image
5333 mercy-for-cookies = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
5335 # These aliases define combinations of actions
5336 # that are useful for certain types of sites:
5338 fragile = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -kill-popups
5339 shop = -crunch-all-cookies -filter{all-popups} -kill-popups
5341 Now come the regular sections, i.e. sets of actions, accompanied by URL
5342 patterns to which they apply. Remember all actions are disabled when
5343 matching starts, so we have to explicitly enable the ones we want.
5345 The first regular section is probably the most important. It has only one
5346 pattern, "/", but this pattern matches all URLs. Therefore, the set of
5347 actions used in this "default" section will be applied to all requests as
5348 a start. It can be partly or wholly overridden by later matches further
5349 down this file, or in user.action, but it will still be largely
5350 responsible for your overall browsing experience.
5352 Again, at the start of matching, all actions are disabled, so there is no
5353 need to disable any actions here. (Remember: a "+" preceding the action
5354 name enables the action, a "-" disables!). Also note how this long line
5355 has been made more readable by splitting it into multiple lines with line
5358 ##########################################################################
5359 # "Defaults" section:
5360 ##########################################################################
5363 +filter{html-annoyances} \
5364 +filter{refresh-tags} \
5366 +filter{ie-exploits} \
5367 +hide-forwarded-for-headers \
5368 +hide-from-header{block} \
5369 +hide-referrer{forge} \
5370 +prevent-compression \
5371 +session-cookies-only \
5372 +set-image-blocker{pattern} \
5374 / # forward slash will match *all* potential URL patterns.
5376 The default behavior is now set.
5378 The first of our specialized sections is concerned with "fragile" sites,
5379 i.e. sites that require minimum interference, because they are either very
5380 complex or very keen on tracking you (and have mechanisms in place that
5381 make them unusable for people who avoid being tracked). We will simply use
5382 our pre-defined fragile alias instead of stating the list of actions
5385 ##########################################################################
5386 # Exceptions for sites that'll break under the default action set:
5387 ##########################################################################
5389 # "Fragile" Use a minimum set of actions for these sites (see alias above):
5392 .office.microsoft.com # surprise, surprise!
5393 .windowsupdate.microsoft.com
5396 Shopping sites are not as fragile, but they typically require cookies to
5397 log in, and pop-up windows for shopping carts or item details. Again,
5398 we'll use a pre-defined alias:
5404 .worldpay.com # for quietpc.com
5408 The fast-redirects action, which we enabled per default above, breaks some
5409 sites. So disable it for popular sites where we know it misbehaves:
5415 .altavista.com/.*(like|url|link):http
5416 .altavista.com/trans.*urltext=http
5419 It is important that Privoxy knows which URLs belong to images, so that if
5420 they are to be blocked, a substitute image can be sent, rather than an
5421 HTML page. Contacting the remote site to find out is not an option, since
5422 it would destroy the loading time advantage of banner blocking, and it
5423 would feed the advertisers (in terms of money and information). We can
5424 mark any URL as an image with the handle-as-image action, and marking all
5425 URLs that end in a known image file extension is a good start:
5427 ##########################################################################
5429 ##########################################################################
5431 # Define which file types will be treated as images, in case they get
5432 # blocked further down this file:
5434 { +handle-as-image }
5435 /.*\.(gif|jpe?g|png|bmp|ico)$
5437 And then there are known banner sources. They often use scripts to
5438 generate the banners, so it won't be visible from the URL that the request
5439 is for an image. Hence we block them and mark them as images in one go,
5440 with the help of our +block-as-image alias defined above. (We could of
5441 course just as well use +block +handle-as-image here.) Remember that the
5442 type of the replacement image is chosen by the set-image-blocker action.
5443 Since all URLs have matched the default section with its
5444 +set-image-blocker{pattern} action before, it still applies and needn't be
5447 # Known ad generators:
5452 .ad.*.doubleclick.net
5453 .a.yimg.com/(?:(?!/i/).)*$
5454 .a[0-9].yimg.com/(?:(?!/i/).)*$
5458 One of the most important jobs of Privoxy is to block banners. Many of
5459 these can be "blocked" by the filter{banners-by-size} action, which we
5460 enabled above, and which deletes the references to banner images from the
5461 pages while they are loaded, so the browser doesn't request them anymore,
5462 and hence they don't need to be blocked here. But this naturally doesn't
5463 catch all banners, and some people choose not to use filters, so we need a
5464 comprehensive list of patterns for banner URLs here, and apply the block
5467 First comes many generic patterns, which do most of the work, by matching
5468 typical domain and path name components of banners. Then comes a list of
5469 individual patterns for specific sites, which is omitted here to keep the
5472 ##########################################################################
5473 # Block these fine banners:
5474 ##########################################################################
5483 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
5484 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
5486 # Site-specific patterns (abbreviated):
5490 It's quite remarkable how many advertisers actually call their banner
5491 servers ads.company.com, or call the directory in which the banners are
5492 stored simply "banners". So the above generic patterns are surprisingly
5495 But being very generic, they necessarily also catch URLs that we don't
5496 want to block. The pattern .*ads. e.g. catches "nasty-ads.nasty-corp.com"
5497 as intended, but also "downloads.sourcefroge.net" or
5498 "adsl.some-provider.net." So here come some well-known exceptions to the
5499 +block section above.
5501 Note that these are exceptions to exceptions from the default! Consider
5502 the URL "downloads.sourcefroge.net": Initially, all actions are
5503 deactivated, so it wouldn't get blocked. Then comes the defaults section,
5504 which matches the URL, but just deactivates the block action once again.
5505 Then it matches .*ads., an exception to the general non-blocking policy,
5506 and suddenly +block applies. And now, it'll match .*loads., where -block
5507 applies, so (unless it matches again further down) it ends up with no
5508 block action applying.
5510 ##########################################################################
5511 # Save some innocent victims of the above generic block patterns:
5512 ##########################################################################
5517 adv[io]*. # (for advogato.org and advice.*)
5518 adsl. # (has nothing to do with ads)
5519 adobe. # (has nothing to do with ads either)
5520 ad[ud]*. # (adult.* and add.*)
5521 .edu # (universities don't host banners (yet!))
5522 .*loads. # (downloads, uploads etc)
5530 www.globalintersec.com/adv # (adv = advanced)
5531 www.ugu.com/sui/ugu/adv
5533 Filtering source code can have nasty side effects, so make an exception
5534 for our friends at sourceforge.net, and all paths with "cvs" in them. Note
5535 that -filter disables all filters in one fell swoop!
5537 # Don't filter code!
5546 The actual default.action is of course much more comprehensive, but we
5547 hope this example made clear how it works.
5549 --------------------------------------------------------------------------
5553 So far we are painting with a broad brush by setting general policies,
5554 which would be a reasonable starting point for many people. Now, you might
5555 want to be more specific and have customized rules that are more suitable
5556 to your personal habits and preferences. These would be for narrowly
5557 defined situations like your ISP or your bank, and should be placed in
5558 user.action, which is parsed after all other actions files and hence has
5559 the last word, over-riding any previously defined actions. user.action is
5560 also a safe place for your personal settings, since default.action is
5561 actively maintained by the Privoxy developers and you'll probably want to
5562 install updated versions from time to time.
5564 So let's look at a few examples of things that one might typically do in
5567 # My user.action file. <fred@example.com>
5569 As aliases are local to the actions file that they are defined in, you
5570 can't use the ones from default.action, unless you repeat them here:
5572 # Aliases are local to the file they are defined in.
5573 # (Re-)define aliases for this file:
5577 # These aliases just save typing later, and the alias names should
5578 # be self explanatory.
5580 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
5581 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
5582 allow-all-cookies = -crunch-all-cookies -session-cookies-only
5583 allow-popups = -filter{all-popups} -kill-popups
5584 +block-as-image = +block +handle-as-image
5585 -block-as-image = -block
5587 # These aliases define combinations of actions that are useful for
5588 # certain types of sites:
5590 fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer -kill-popups
5591 shop = -crunch-all-cookies allow-popups
5593 # Allow ads for selected useful free sites:
5595 allow-ads = -block -filter{banners-by-size} -filter{banners-by-link}
5597 # Alias for specific file types that are text, but might have conflicting
5598 # MIME types. We want the browser to force these to be text documents.
5599 handle-as-text = -filter +-content-type-overwrite{text/plain} +-force-text-mode -hide-content-disposition
5603 Say you have accounts on some sites that you visit regularly, and you
5604 don't want to have to log in manually each time. So you'd like to allow
5605 persistent cookies for these sites. The allow-all-cookies alias defined
5606 above does exactly that, i.e. it disables crunching of cookies in any
5607 direction, and the processing of cookies to make them only temporary.
5609 { allow-all-cookies }
5615 Your bank is allergic to some filter, but you don't know which, so you
5619 .your-home-banking-site.com
5621 Some file types you may not want to filter for various reasons:
5623 # Technical documentation is likely to contain strings that might
5624 # erroneously get altered by the JavaScript-oriented filters:
5629 # And this stupid host sends streaming video with a wrong MIME type,
5630 # so that Privoxy thinks it is getting HTML and starts filtering:
5632 stupid-server.example.com/
5634 Example of a simple block action. Say you've seen an ad on your favourite
5635 page on example.com that you want to get rid of. You have right-clicked
5636 the image, selected "copy image location" and pasted the URL below while
5637 removing the leading http://, into a { +block } section. Note that {
5638 +handle-as-image } need not be specified, since all URLs ending in .gif
5639 will be tagged as images by the general rules as set in default.action
5643 www.example.com/nasty-ads/sponsor\.gif
5644 another.example.net/more/junk/here/
5646 The URLs of dynamically generated banners, especially from large banner
5647 farms, often don't use the well-known image file name extensions, which
5648 makes it impossible for Privoxy to guess the file type just by looking at
5649 the URL. You can use the +block-as-image alias defined above for these
5650 cases. Note that objects which match this rule but then turn out NOT to be
5651 an image are typically rendered as a "broken image" icon by the browser.
5660 Now you noticed that the default configuration breaks Forbes Magazine, but
5661 you were too lazy to find out which action is the culprit, and you were
5662 again too lazy to give feedback, so you just used the fragile alias on the
5663 site, and -- whoa! -- it worked. The fragile aliases disables those
5664 actions that are most likely to break a site. Also, good for testing
5665 purposes to see if it is Privoxy that is causing the problem or not. We
5666 later find other regular sites that misbehave, and add those to our
5667 personalized list of troublemakers:
5674 You like the "fun" text replacements in default.filter, but it is disabled
5675 in the distributed actions file. So you'd like to turn it on in your
5676 private, update-safe config, once and for all:
5681 Note that the above is not really a good idea: There are exceptions to the
5682 filters in default.action for things that really shouldn't be filtered,
5683 like code on CVS->Web interfaces. Since user.action has the last word,
5684 these exceptions won't be valid for the "fun" filtering specified here.
5686 You might also worry about how your favourite free websites are funded,
5687 and find that they rely on displaying banner advertisements to survive. So
5688 you might want to specifically allow banners for those sites that you feel
5689 provide value to you:
5696 Note that allow-ads has been aliased to -block, -filter{banners-by-size},
5697 and -filter{banners-by-link} above.
5699 Invoke another alias here to force an over-ride of the MIME type
5700 application/x-sh which typically would open a download type dialog. In my
5701 case, I want to look at the shell script, and then I can save it should I
5707 user.action is generally the best place to define exceptions and additions
5708 to the default policies of default.action. Some actions are safe to have
5709 their default policies set here though. So let's set a default policy to
5710 have a "blank" image as opposed to the checkerboard pattern for ALL sites.
5711 "/" of course matches all URL paths and patterns:
5713 { +set-image-blocker{blank} }
5716 --------------------------------------------------------------------------
5720 On-the-fly text substitutions need to be defined in a "filter file". Once
5721 defined, they can then be invoked as an "action".
5723 Privoxy supports three different filter actions: filter to rewrite the
5724 content that is send to the client, client-header-filter to rewrite
5725 headers that are send by the client, and server-header-filter to rewrite
5726 headers that are send by the server.
5728 Privoxy also supports two tagger actions: client-header-tagger and
5729 server-header-tagger. Taggers and filters use the same syntax in the
5730 filter files, the difference is that taggers don't modify the text they
5731 are filtering, but use a rewritten version of the filtered text as tag.
5732 The tags can then be used to change the applying actions through sections
5735 Multiple filter files can be defined through the filterfile config
5736 directive. The filters as supplied by the developers are located in
5737 default.filter. It is recommended that any locally defined or modified
5738 filters go in a separately defined file such as user.filter.
5740 Common tasks for content filters are to eliminate common annoyances in
5741 HTML and JavaScript, such as pop-up windows, exit consoles, crippled
5742 windows without navigation tools, the infamous <BLINK> tag etc, to
5743 suppress images with certain width and height attributes (standard banner
5744 sizes or web-bugs), or just to have fun.
5746 Enabled content filters are applied to any content whose "Content Type"
5747 header is recognised as a sign of text-based content, with the exception
5748 of text/plain. Use the force-text-mode action to also filter other
5751 Substitutions are made at the source level, so if you want to "roll your
5752 own" filters, you should first be familiar with HTML syntax, and, of
5753 course, regular expressions.
5755 Just like the actions files, the filter file is organized in sections,
5756 which are called filters here. Each filter consists of a heading line,
5757 that starts with one of the keywords FILTER:, CLIENT-HEADER-FILTER: or
5758 SERVER-HEADER-FILTER: followed by the filter's name, and a short (one
5759 line) description of what it does. Below that line come the jobs, i.e.
5760 lines that define the actual text substitutions. By convention, the name
5761 of a filter should describe what the filter eliminates. The comment is
5762 used in the web-based user interface.
5764 Once a filter called name has been defined in the filter file, it can be
5765 invoked by using an action of the form +filter{name} in any actions file.
5767 Filter definitions start with a header line that contains the filter type,
5768 the filter name and the filter description. A content filter header line
5769 for a filter called "foo" could look like this:
5771 FILTER: foo Replace all "foo" with "bar"
5773 Below that line, and up to the next header line, come the jobs that define
5774 what text replacements the filter executes. They are specified in a syntax
5775 that imitates Perl's s/// operator. If you are familiar with Perl, you
5776 will find this to be quite intuitive, and may want to look at the PCRS
5777 documentation for the subtle differences to Perl behaviour. Most notably,
5778 the non-standard option letter U is supported, which turns the default to
5781 If you are new to "Regular Expressions", you might want to take a look at
5782 the Appendix on regular expressions, and see the Perl manual for the s///
5783 operator's syntax and Perl-style regular expressions in general. The below
5784 examples might also help to get you started.
5786 --------------------------------------------------------------------------
5788 9.1. Filter File Tutorial
5790 Now, let's complete our "foo" content filter. We have already defined the
5791 heading, but the jobs are still missing. Since all it does is to replace
5792 "foo" with "bar", there is only one (trivial) job needed:
5796 But wait! Didn't the comment say that all occurrences of "foo" should be
5797 replaced? Our current job will only take care of the first "foo" on each
5798 page. For global substitution, we'll need to add the g option:
5802 Our complete filter now looks like this:
5804 FILTER: foo Replace all "foo" with "bar"
5807 Let's look at some real filters for more interesting examples. Here you
5808 see a filter that protects against some common annoyances that arise from
5809 JavaScript abuse. Let's look at its jobs one after the other:
5811 FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse
5813 # Get rid of JavaScript referrer tracking. Test page: http://www.randomoddness.com/untitled.htm
5815 s|(<script.*)document\.referrer(.*</script>)|$1"Not Your Business!"$2|Usg
5817 Following the header line and a comment, you see the job. Note that it
5818 uses | as the delimiter instead of /, because the pattern contains a
5819 forward slash, which would otherwise have to be escaped by a backslash
5822 Now, let's examine the pattern: it starts with the text <script.* enclosed
5823 in parentheses. Since the dot matches any character, and * means: "Match
5824 an arbitrary number of the element left of myself", this matches
5825 "<script", followed by any text, i.e. it matches the whole page, from the
5826 start of the first <script> tag.
5828 That's more than we want, but the pattern continues: document\.referrer
5829 matches only the exact string "document.referrer". The dot needed to be
5830 escaped, i.e. preceded by a backslash, to take away its special meaning as
5831 a joker, and make it just a regular dot. So far, the meaning is: Match
5832 from the start of the first <script> tag in a the page, up to, and
5833 including, the text "document.referrer", if both are present in the page
5834 (and appear in that order).
5836 But there's still more pattern to go. The next element, again enclosed in
5837 parentheses, is .*</script>. You already know what .* means, so the whole
5838 pattern translates to: Match from the start of the first <script> tag in a
5839 page to the end of the last <script> tag, provided that the text
5840 "document.referrer" appears somewhere in between.
5842 This is still not the whole story, since we have ignored the options and
5843 the parentheses: The portions of the page matched by sub-patterns that are
5844 enclosed in parentheses, will be remembered and be available through the
5845 variables $1, $2, ... in the substitute. The U option switches to ungreedy
5846 matching, which means that the first .* in the pattern will only "eat up"
5847 all text in between "<script" and the first occurrence of
5848 "document.referrer", and that the second .* will only span the text up to
5849 the first "</script>" tag. Furthermore, the s option says that the match
5850 may span multiple lines in the page, and the g option again means that the
5851 substitution is global.
5853 So, to summarize, the pattern means: Match all scripts that contain the
5854 text "document.referrer". Remember the parts of the script from (and
5855 including) the start tag up to (and excluding) the string
5856 "document.referrer" as $1, and the part following that string, up to and
5857 including the closing tag, as $2.
5859 Now the pattern is deciphered, but wasn't this about substituting things?
5860 So lets look at the substitute: $1"Not Your Business!"$2 is easy to read:
5861 The text remembered as $1, followed by "Not Your Business!" (including the
5862 quotation marks!), followed by the text remembered as $2. This produces an
5863 exact copy of the original string, with the middle part (the
5864 "document.referrer") replaced by "Not Your Business!".
5866 The whole job now reads: Replace "document.referrer" by "Not Your
5867 Business!" wherever it appears inside a <script> tag. Note that this job
5868 won't break JavaScript syntax, since both the original and the replacement
5869 are syntactically valid string objects. The script just won't have access
5870 to the referrer information anymore.
5872 We'll show you two other jobs from the JavaScript taming department, but
5873 this time only point out the constructs of special interest:
5875 # The status bar is for displaying link targets, not pointless blahblah
5877 s/window\.status\s*=\s*(['"]).*?\1/dUmMy=1/ig
5879 \s stands for whitespace characters (space, tab, newline, carriage return,
5880 form feed), so that \s* means: "zero or more whitespace". The ? in .*?
5881 makes this matching of arbitrary text ungreedy. (Note that the U option is
5882 not set). The ['"] construct means: "a single or a double quote". Finally,
5883 \1 is a back-reference to the first parenthesis just like $1 above, with
5884 the difference that in the pattern, a backslash indicates a
5885 back-reference, whereas in the substitute, it's the dollar.
5887 So what does this job do? It replaces assignments of single- or
5888 double-quoted strings to the "window.status" object with a dummy
5889 assignment (using a variable name that is hopefully odd enough not to
5890 conflict with real variables in scripts). Thus, it catches many cases
5891 where e.g. pointless descriptions are displayed in the status bar instead
5892 of the link target when you move your mouse over links.
5894 # Kill OnUnload popups. Yummy. Test: http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html
5896 s/(<body [^>]*)onunload(.*>)/$1never$2/iU
5898 Including the OnUnload event binding in the HTML DOM was a CRIME. When I
5899 close a browser window, I want it to close and die. Basta. This job
5900 replaces the "onunload" attribute in "<body>" tags with the dummy word
5901 never. Note that the i option makes the pattern matching case-insensitive.
5902 Also note that ungreedy matching alone doesn't always guarantee a minimal
5903 match: In the first parenthesis, we had to use [^>]* instead of .* to
5904 prevent the match from exceeding the <body> tag if it doesn't contain
5905 "OnUnload", but the page's content does.
5907 The last example is from the fun department:
5909 FILTER: fun Fun text replacements
5911 # Spice the daily news:
5913 s/microsoft(?!\.com)/MicroSuck/ig
5915 Note the (?!\.com) part (a so-called negative lookahead) in the job's
5916 pattern, which means: Don't match, if the string ".com" appears directly
5917 following "microsoft" in the page. This prevents links to microsoft.com
5918 from being trashed, while still replacing the word everywhere else.
5920 # Buzzword Bingo (example for extended regex syntax)
5922 s* industry[ -]leading \
5924 | customer[ -]focused \
5925 | market[ -]driven \
5926 | award[ -]winning # Comments are OK, too! \
5927 | high[ -]performance \
5928 | solutions[ -]based \
5932 *<font color="red"><b>BINGO!</b></font> \
5935 The x option in this job turns on extended syntax, and allows for e.g. the
5936 liberal use of (non-interpreted!) whitespace for nicer formatting.
5940 --------------------------------------------------------------------------
5942 9.2. The Pre-defined Filters
5944 The distribution default.filter file contains a selection of pre-defined
5945 filters for your convenience:
5949 The purpose of this filter is to get rid of particularly annoying
5950 JavaScript abuse. To that end, it
5952 * replaces JavaScript references to the browser's referrer
5953 information with the string "Not Your Business!". This
5954 compliments the hide-referrer action on the content level.
5956 * removes the bindings to the DOM's unload event which we feel
5957 has no right to exist and is responsible for most "exit
5958 consoles", i.e. nasty windows that pop up when you close
5961 * removes code that causes new windows to be opened with
5962 undesired properties, such as being full-screen,
5963 non-resizeable, without location, status or menu bar etc.
5965 Use with caution. This is an aggressive filter, and can break
5966 sites that rely heavily on JavaScript.
5970 This is a very radical measure. It removes virtually all
5971 JavaScript event bindings, which means that scripts can not react
5972 to user actions such as mouse movements or clicks, window resizing
5973 etc, anymore. Use with caution!
5975 We strongly discourage using this filter as a default since it
5976 breaks many legitimate scripts. It is meant for use only on
5977 extra-nasty sites (should you really need to go there).
5981 This filter will undo many common instances of HTML based abuse.
5983 The BLINK and MARQUEE tags are neutralized (yeah baby!), and
5984 browser windows will be created as resizeable (as of course they
5985 should be!), and will have location, scroll and menu bars -- even
5986 if specified otherwise.
5990 Most cookies are set in the HTTP dialog, where they can be
5991 intercepted by the crunch-incoming-cookies and
5992 crunch-outgoing-cookies actions. But web sites increasingly make
5993 use of HTML meta tags and JavaScript to sneak cookies to the
5994 browser on the content level.
5996 This filter disables most HTML and JavaScript code that reads or
5997 sets cookies. It cannot detect all clever uses of these types of
5998 code, so it should not be relied on as an absolute fix. Use it
5999 wherever you would also use the cookie crunch actions.
6003 Disable any refresh tags if the interval is greater than nine
6004 seconds (so that redirections done via refresh tags are not
6005 destroyed). This is useful for dial-on-demand setups, or for those
6006 who find this HTML feature annoying.
6010 This filter attempts to prevent only "unsolicited" pop-up windows
6011 from opening, yet still allow pop-up windows that the user has
6012 explicitly chosen to open. It was added in version 3.0.1, as an
6013 improvement over earlier such filters.
6015 Technical note: The filter works by redefining the window.open
6016 JavaScript function to a dummy function, PrivoxyWindowOpen(),
6017 during the loading and rendering phase of each HTML page access,
6018 and restoring the function afterward.
6020 This is recommended only for browsers that cannot perform this
6021 function reliably themselves. And be aware that some sites require
6022 such windows in order to function normally. Use with caution.
6026 Attempt to prevent all pop-up windows from opening. Note this
6027 should be used with even more discretion than the above, since it
6028 is more likely to break some sites that require pop-ups for normal
6029 usage. Use with caution.
6033 This is a helper filter that has no value if used alone. It makes
6034 the banners-by-size and banners-by-link (see below) filters more
6035 effective and should be enabled together with them.
6039 This filter removes image tags purely based on what size they are.
6040 Fortunately for us, many ads and banner images tend to conform to
6041 certain standardized sizes, which makes this filter quite
6042 effective for ad stripping purposes.
6044 Occasionally this filter will cause false positives on images that
6045 are not ads, but just happen to be of one of the standard banner
6048 Recommended only for those who require extreme ad blocking. The
6049 default block rules should catch 95+% of all ads without this
6054 This is an experimental filter that attempts to kill any banners
6055 if their URLs seem to point to known or suspected click trackers.
6056 It is currently not of much value and is not recommended for use
6061 Webbugs are small, invisible images (technically 1X1 GIF images),
6062 that are used to track users across websites, and collect
6063 information on them. As an HTML page is loaded by the browser, an
6064 embedded image tag causes the browser to contact a third-party
6065 site, disclosing the tracking information through the requested
6066 URL and/or cookies for that third-party domain, without the user
6067 ever becoming aware of the interaction with the third-party site.
6068 HTML-ized spam also uses a similar technique to verify email
6071 This filter removes the HTML code that loads such "webbugs".
6075 A rather special-purpose filter that can be used to enlarge
6076 textareas (those multi-line text boxes in web forms) and turn off
6077 hard word wrap in them. It was written for the sourceforge.net
6078 tracker system where such boxes are a nuisance, but it can be
6079 handy on other sites, too.
6081 It is not recommended to use this filter as a default.
6085 Many consider windows that move, or resize themselves to be
6086 abusive. This filter neutralizes the related JavaScript code. Note
6087 that some sites might not display or behave as intended when using
6088 this filter. Use with caution.
6092 Some web designers seem to assume that everyone in the world will
6093 view their web sites using the same browser brand and version,
6094 screen resolution etc, because only that assumption could explain
6095 why they'd use static frame sizes, yet prevent their frames from
6096 being resized by the user, should they be too small to show their
6099 This filter removes the related HTML code. It should only be
6100 applied to sites which need it.
6104 Many Microsoft products that generate HTML use non-standard
6105 extensions (read: violations) of the ISO 8859-1 aka Latin-1
6106 character set. This can cause those HTML documents to display with
6107 errors on standard-compliant platforms.
6109 This filter translates the MS-only characters into Latin-1
6110 equivalents. It is not necessary when using MS products, and will
6111 cause corruption of all documents that use 8-bit character sets
6112 other than Latin-1. It's mostly worthwhile for Europeans on non-MS
6113 platforms, if weird garbage characters sometimes appear on some
6114 pages, or user agents that don't correct for this on the fly.
6118 A filter for shockwave haters. As the name suggests, this filter
6119 strips code out of web pages that is used to embed shockwave flash
6124 Change HTML code that embeds Quicktime objects so that kioskmode,
6125 which prevents saving, is disabled.
6129 Text replacements for subversive browsing fun. Make fun of your
6130 favorite Monopolist or play buzzword bingo.
6134 A demonstration-only filter that shows how Privoxy can be used to
6135 delete web content on a keyword basis.
6139 An experimental collection of text replacements to disable
6140 malicious HTML and JavaScript code that exploits known security
6141 holes in Internet Explorer.
6143 Presently, it only protects against Nimda and a cross-site
6144 scripting bug, and would need active maintenance to provide more
6145 substantial protection.
6149 Some web sites have very specific problems, the cure for which
6150 doesn't apply anywhere else, or could even cause damage on other
6153 This is a collection of such site-specific cures which should only
6154 be applied to the sites they were intended for, which is what the
6155 supplied default.action file does. Users shouldn't need to change
6156 anything regarding this filter.
6160 A CSS based block for Google text ads. Also removes a width
6161 limitation and the toolbar advertisement.
6165 Another CSS based block, this time for Yahoo text ads. And removes
6166 a width limitation as well.
6170 Another CSS based block, this time for MSN text ads. And removes
6171 tracking URLs, as well as a width limitation.
6175 Cleans up some Blogspot blogs. Read the fine print before using
6178 This filter also intentionally removes some navigation stuff and
6179 sets the page width to 100%. As a result, some rounded "corners"
6180 would appear to early or not at all and as fixing this would
6181 require a browser that understands background-size (CSS3), they
6182 are removed instead.
6186 Server-header filter to change the Content-Type from xml to html.
6190 Server-header filter to change the Content-Type from html to xml.
6194 Removes the non-standard ping attribute from anchor and area HTML
6197 hide-tor-exit-notation
6199 Client-header filter to remove the Tor exit node notation found in
6200 Host and Referer headers.
6202 If Privoxy and Tor are chained and Privoxy is configured to use
6203 socks4a, one can use "http://www.example.org.foobar.exit/" to
6204 access the host "www.example.org" through the Tor exit node
6207 As the HTTP client isn't aware of this notation, it treats the
6208 whole string "www.example.org.foobar.exit" as host and uses it for
6209 the "Host" and "Referer" headers. From the server's point of view
6210 the resulting headers are invalid and can cause problems.
6212 An invalid "Referer" header can trigger "hot-linking" protections,
6213 an invalid "Host" header will make it impossible for the server to
6214 find the right vhost (several domains hosted on the same IP
6217 This client-header filter removes the "foo.exit" part in those
6218 headers to prevent the mentioned problems. Note that it only
6219 modifies the HTTP headers, it doesn't make it impossible for the
6220 server to detect your Tor exit node based on the IP address the
6221 request is coming from.
6223 --------------------------------------------------------------------------
6225 10. Privoxy's Template Files
6227 All Privoxy built-in pages, i.e. error pages such as the "404 - No Such
6228 Domain" error page, the "BLOCKED" page and all pages of its web-based user
6229 interface, are generated from templates. (Privoxy must be running for the
6230 above links to work as intended.)
6232 These templates are stored in a subdirectory of the configuration
6233 directory called templates. On Unixish platforms, this is typically
6234 /etc/privoxy/templates/.
6236 The templates are basically normal HTML files, but with place-holders
6237 (called symbols or exports), which Privoxy fills at run time. It is
6238 possible to edit the templates with a normal text editor, should you want
6239 to customize them. (Not recommended for the casual user). Should you
6240 create your own custom templates, you should use the config setting
6241 templdir to specify an alternate location, so your templates do not get
6242 overwritten during upgrades.
6244 Note that just like in configuration files, lines starting with # are
6245 ignored when the templates are filled in.
6247 The place-holders are of the form @name@, and you will find a list of
6248 available symbols, which vary from template to template, in the comments
6249 at the start of each file. Note that these comments are not always
6250 accurate, and that it's probably best to look at the existing HTML code to
6251 find out which symbols are supported and what they are filled in with.
6253 A special application of this substitution mechanism is to make whole
6254 blocks of HTML code disappear when a specific symbol is set. We use this
6255 for many purposes, one of them being to include the beta warning in all
6256 our user interface (CGI) pages when Privoxy is in an alpha or beta
6259 <!-- @if-unstable-start -->
6261 ... beta warning HTML code goes here ...
6263 <!-- if-unstable-end@ -->
6265 If the "unstable" symbol is set, everything in between and including
6266 @if-unstable-start and if-unstable-end@ will disappear, leaving nothing
6267 but an empty comment:
6271 There's also an if-then-else construct and an #include mechanism, but
6272 you'll sure find out if you are inclined to edit the templates ;-)
6274 All templates refer to a style located at
6275 http://config.privoxy.org/send-stylesheet. This is, of course, locally
6276 served by Privoxy and the source for it can be found and edited in the
6277 cgi-style.css template.
6279 --------------------------------------------------------------------------
6281 11. Contacting the Developers, Bug Reporting and Feature Requests
6283 We value your feedback. In fact, we rely on it to improve Privoxy and its
6284 configuration. However, please note the following hints, so we can provide
6285 you with the best support:
6287 --------------------------------------------------------------------------
6291 For casual users, our support forum at SourceForge is probably best
6292 suited: http://sourceforge.net/tracker/?group_id=11118&atid=211118
6294 All users are of course welcome to discuss their issues on the users
6295 mailing list, where the developers also hang around.
6297 Note that the Privoxy mailing lists are moderated. Posts from unsubscribed
6298 addresses have to be accepted manually by a moderator. This may cause a
6299 delay of several days and if you use a subject that doesn't clearly
6300 mention Privoxy or one of its features, your message may be accidentally
6303 If you aren't subscribed, you should therefore spend a few seconds to come
6304 up with a proper subject. Additionally you should make it clear that you
6305 want to get CC'd. Otherwise some responses will be directed to the mailing
6306 list only, and you won't see them.
6308 --------------------------------------------------------------------------
6310 11.2. Reporting Problems
6312 "Problems" for our purposes, come in two forms:
6314 * Configuration issues, such as ads that slip through, or sites that
6315 don't function properly due to one Privoxy "action" or another being
6318 * "Bugs" in the programming code that makes up Privoxy, such as that
6319 might cause a crash.
6321 --------------------------------------------------------------------------
6323 11.2.1. Reporting Ads or Other Configuration Problems
6325 Please send feedback on ads that slipped through, innocent images that
6326 were blocked, sites that don't work properly, and other configuration
6327 related problem of default.action file, to
6328 http://sourceforge.net/tracker/?group_id=11118&atid=460288, the Actions
6331 New, improved default.action files may occasionally be made available
6332 based on your feedback. These will be announced on the ijbswa-announce
6333 list and available from our the files section of our project page.
6335 --------------------------------------------------------------------------
6337 11.2.2. Reporting Bugs
6339 Please report all bugs through our bug tracker:
6340 http://sourceforge.net/tracker/?group_id=11118&atid=111118.
6342 Before doing so, please make sure that the bug has not already been
6343 submitted and observe the additional hints at the top of the submit form.
6344 If already submitted, please feel free to add any info to the original
6345 report that might help to solve the issue.
6347 Please try to verify that it is a Privoxy bug, and not a browser or site
6348 bug or documented behaviour that just happens to be different than what
6349 you expected. If unsure, try toggling off Privoxy, and see if the problem
6352 If you are using your own custom configuration, please try the stock
6353 configs to see if the problem is configuration related. If you're having
6354 problems with a feature that is disabled by default, please ask around on
6355 the mailing list if others can reproduce the problem.
6357 If you aren't using the latest Privoxy version, the bug may have been
6358 found and fixed in the meantime. We would appreciate if you could take the
6359 time to upgrade to the latest version (or even the latest CVS snapshot)
6360 and verify that your bug still exists.
6362 Please be sure to provide the following information:
6364 * The exact Privoxy version you are using (if you got the source from
6365 CVS, please also provide the source code revisions as shown in
6366 http://config.privoxy.org/show-version).
6368 * The operating system and versions you run Privoxy on, (e.g. Windows XP
6369 SP2), if you are using a Unix flavor, sending the output of "uname -a"
6370 should do, in case of GNU/Linux, please also name the distribution.
6372 * The name, platform, and version of the browser you were using (e.g.
6373 Internet Explorer v5.5 for Mac).
6375 * The URL where the problem occurred, or some way for us to duplicate
6376 the problem (e.g. http://somesite.example.com/?somethingelse=123).
6378 * Whether your version of Privoxy is one supplied by the Privoxy
6379 developers via SourceForge, or if you got your copy somewhere else.
6381 * Whether you are using Privoxy in tandem with another proxy such as
6382 Tor. If so, please temporary disable the other proxy to see if the
6385 * Whether you are using a personal firewall product. If so, does Privoxy
6388 * Any other pertinent information to help identify the problem such as
6389 config or log file excerpts (yes, you should have log file entries for
6392 You don't have to tell us your actual name when filing a problem report,
6393 but please use a nickname so we can differentiate between your messages
6394 and the ones entered by other "anonymous" users that may respond to your
6395 request if they have the same problem or already found a solution.
6397 Please also check the status of your request a few days after submitting
6398 it, as we may request additional information. If you use a SF id, you
6399 should automatically get a mail when someone responds to your request.
6401 The appendix of the Privoxy User Manual also has helpful information on
6402 understanding actions, and action debugging.
6404 --------------------------------------------------------------------------
6406 11.3. Request New Features
6408 You are welcome to submit ideas on new features or other proposals for
6409 improvement through our feature request tracker at
6410 http://sourceforge.net/tracker/?atid=361118&group_id=11118.
6412 --------------------------------------------------------------------------
6416 For any other issues, feel free to use the mailing lists. Technically
6417 interested users and people who wish to contribute to the project are also
6418 welcome on the developers list! You can find an overview of all
6419 Privoxy-related mailing lists, including list archives, at:
6420 http://sourceforge.net/mail/?group_id=11118.
6422 --------------------------------------------------------------------------
6424 12. Privoxy Copyright, License and History
6426 Copyright (c) 2001-2008 by Privoxy Developers
6427 <ijbswa-developers@lists.sourceforge.net>
6429 Some source code is based on code Copyright (c) 1997 by Anonymous Coders
6430 and Junkbusters, Inc. and licensed under the GNU General Public License.
6432 --------------------------------------------------------------------------
6436 Privoxy is free software; you can redistribute it and/or modify it under
6437 the terms of the GNU General Public License, version 2, as published by
6438 the Free Software Foundation.
6440 This program is distributed in the hope that it will be useful, but
6441 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
6442 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6443 for more details, which is available from the Free Software Foundation,
6444 Inc, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
6446 You should have received a copy of the GNU General Public License along
6447 with this program; if not, write to the
6450 Foundation, Inc. 51 Franklin Street, Fifth Floor
6451 Boston, MA 02110-1301
6454 --------------------------------------------------------------------------
6458 A long time ago, there was the Internet Junkbuster, by Anonymous Coders
6459 and Junkbusters Corporation. This saved many users a lot of pain in the
6460 early days of web advertising and user tracking.
6462 But the web, its protocols and standards, and with it, the techniques for
6463 forcing ads on users, give up autonomy over their browsing, and for
6464 tracking them, keeps evolving. Unfortunately, the Internet Junkbuster did
6465 not. Version 2.0.2, published in 1998, was (and is) the last official
6466 release available from Junkbusters Corporation. Fortunately, it had been
6467 released under the GNU GPL, which allowed further development by others.
6469 So Stefan Waldherr started maintaining an improved version of the
6470 software, to which eventually a number of people contributed patches. It
6471 could already replace banners with a transparent image, and had a first
6472 version of pop-up killing, but it was still very closely based on the
6473 original, with all its limitations, such as the lack of HTTP/1.1 support,
6474 flexible per-site configuration, or content modification. The last release
6475 from this effort was version 2.0.2-10, published in 2000.
6477 Then, some developers picked up the thread, and started turning the
6478 software inside out, upside down, and then reassembled it, adding many new
6479 features along the way.
6481 The result of this is Privoxy, whose first stable version, 3.0, was
6482 released August, 2002.
6484 --------------------------------------------------------------------------
6488 Current Privoxy Team:
6490 Fabian Keil, lead developer
6491 David Schmidt, developer
6498 Former Privoxy Team Members:
6523 Thanks to the many people who have tested Privoxy, reported bugs, provided
6524 patches, made suggestions or contributed in some way. These include (in
6525 alphabetical order):
6581 Privoxy is based in part on code originally developed by Junkbusters Corp.
6582 and Anonymous Coders.
6584 Privoxy heavily relies on Philip Hazel's PCRE.
6586 The code to filter compressed content makes use of zlib which is written
6587 by Jean-loup Gailly and Mark Adler.
6589 On systems that lack snprintf(), Privoxy is using a version written by
6590 Mark Martinec. On systems that lack strptime(), Privoxy is using the one
6591 from the GNU C Library written by Ulrich Drepper.
6593 --------------------------------------------------------------------------
6597 Other references and sites of interest to Privoxy users:
6599 http://www.privoxy.org/, the Privoxy Home page.
6601 http://www.privoxy.org/faq/, the Privoxy FAQ.
6603 http://sourceforge.net/projects/ijbswa/, the Project Page for Privoxy on
6606 http://config.privoxy.org/, the web-based user interface. Privoxy must be
6607 running for this to work. Shortcut: http://p.p/
6609 http://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit
6610 "misses" and other configuration related suggestions to the developers.
6612 http://www.junkbusters.com/ht/en/cookies.html, an explanation how cookies
6613 are used to track web users.
6615 http://www.junkbusters.com/ijb.html, the original Internet Junkbuster.
6617 http://privacy.net/, a useful site to check what information about you is
6618 leaked while you browse the web.
6620 http://www.squid-cache.org/, a popular caching proxy, which is often used
6621 together with Privoxy.
6623 http://www.pps.jussieu.fr/~jch/software/polipo/, Polipo is a caching proxy
6624 with advanced features like pipelining, multiplexing and caching of
6625 partial instances. In many setups it can be used as Squid replacement.
6627 http://tor.eff.org/, Tor can help anonymize web browsing, web publishing,
6628 instant messaging, IRC, SSH, and other applications.
6630 http://www.privoxy.org/developer-manual/, the Privoxy developer manual.
6632 --------------------------------------------------------------------------
6636 14.1. Regular Expressions
6638 Privoxy uses Perl-style "regular expressions" in its actions files and
6639 filter file, through the PCRE and PCRS libraries.
6641 If you are reading this, you probably don't understand what "regular
6642 expressions" are, or what they can do. So this will be a very brief
6643 introduction only. A full explanation would require a book ;-)
6645 Regular expressions provide a language to describe patterns that can be
6646 run against strings of characters (letter, numbers, etc), to see if they
6647 match the string or not. The patterns are themselves (sometimes complex)
6648 strings of literal characters, combined with wild-cards, and other special
6649 characters, called meta-characters. The "meta-characters" have special
6650 meanings and are used to build complex patterns to be matched against.
6651 Perl Compatible Regular Expressions are an especially convenient "dialect"
6652 of the regular expression language.
6654 To make a simple analogy, we do something similar when we use wild-card
6655 characters when listing files with the dir command in DOS. *.* matches all
6656 filenames. The "special" character here is the asterisk which matches any
6657 and all characters. We can be more specific and use ? to match just
6658 individual characters. So "dir file?.text" would match "file1.txt",
6659 "file2.txt", etc. We are pattern matching, using a similar technique to
6660 "regular expressions"!
6662 Regular expressions do essentially the same thing, but are much, much more
6663 powerful. There are many more "special characters" and ways of building
6664 complex patterns however. Let's look at a few of the common ones, and then
6667 . - Matches any single character, e.g. "a", "A", "4", ":", or "@".
6669 ? - The preceding character or expression is matched ZERO or ONE times.
6672 + - The preceding character or expression is matched ONE or MORE times.
6674 * - The preceding character or expression is matched ZERO or MORE times.
6676 \ - The "escape" character denotes that the following character should be
6677 taken literally. This is used where one of the special characters (e.g.
6678 ".") needs to be taken literally and not as a special meta-character.
6679 Example: "example\.com", makes sure the period is recognized only as a
6680 period (and not expanded to its meta-character meaning of any single
6683 [ ] - Characters enclosed in brackets will be matched if any of the
6684 enclosed characters are encountered. For instance, "[0-9]" matches any
6685 numeric digit (zero through nine). As an example, we can combine this with
6686 "+" to match any digit one of more times: "[0-9]+".
6688 ( ) - parentheses are used to group a sub-expression, or multiple
6691 | - The "bar" character works like an "or" conditional statement. A match
6692 is successful if the sub-expression on either side of "|" matches. As an
6693 example: "/(this|that) example/" uses grouping and the bar character and
6694 would match either "this example" or "that example", and nothing else.
6696 These are just some of the ones you are likely to use when matching URLs
6697 with Privoxy, and is a long way from a definitive list. This is enough to
6698 get us started with a few simple examples which may be more illuminating:
6700 /.*/banners/.* - A simple example that uses the common combination of "."
6701 and "*" to denote any character, zero or more times. In other words, any
6702 string at all. So we start with a literal forward slash, then our regular
6703 expression pattern (".*") another literal forward slash, the string
6704 "banners", another forward slash, and lastly another ".*". We are building
6705 a directory path here. This will match any file with the path that has a
6706 directory named "banners" in it. The ".*" matches any characters, and this
6707 could conceivably be more forward slashes, so it might expand into a much
6708 longer looking path. For example, this could match:
6709 "/eye/hate/spammers/banners/annoy_me_please.gif", or just
6710 "/banners/annoying.html", or almost an infinite number of other possible
6711 combinations, just so it has "banners" in the path somewhere.
6713 And now something a little more complex:
6715 /.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have several literal forward
6716 slashes again ("/"), so we are building another expression that is a file
6717 path statement. We have another ".*", so we are matching against any
6718 conceivable sub-path, just so it matches our expression. The only true
6719 literal that must match our pattern is adv, together with the forward
6720 slashes. What comes after the "adv" string is the interesting part.
6722 Remember the "?" means the preceding expression (either a literal
6723 character or anything grouped with "(...)" in this case) can exist or not,
6724 since this means either zero or one match. So
6725 "((er)?ts?|ertis(ing|ements?))" is optional, as are the individual
6726 sub-expressions: "(er)", "(ing|ements?)", and the "s". The "|" means "or".
6727 We have two of those. For instance, "(ing|ements?)", can expand to match
6728 either "ing" OR "ements?". What is being done here, is an attempt at
6729 matching as many variations of "advertisement", and similar, as possible.
6730 So this would expand to match just "adv", or "advert", or "adverts", or
6731 "advertising", or "advertisement", or "advertisements". You get the idea.
6732 But it would not match "advertizements" (with a "z"). We could fix that by
6733 changing our regular expression to:
6734 "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/", which would then match
6737 /.*/advert[0-9]+\.(gif|jpe?g) - Again another path statement with forward
6738 slashes. Anything in the square brackets "[ ]" can be matched. This is
6739 using "0-9" as a shorthand expression to mean any digit one through nine.
6740 It is the same as saying "0123456789". So any digit matches. The "+" means
6741 one or more of the preceding expression must be included. The preceding
6742 expression here is what is in the square brackets -- in this case, any
6743 digit one through nine. Then, at the end, we have a grouping:
6744 "(gif|jpe?g)". This includes a "|", so this needs to match the expression
6745 on either side of that bar character also. A simple "gif" on one side, and
6746 the other side will in turn match either "jpeg" or "jpg", since the "?"
6747 means the letter "e" is optional and can be matched once or not at all. So
6748 we are building an expression here to match image GIF or JPEG type image
6749 file. It must include the literal string "advert", then one or more
6750 digits, and a "." (which is now a literal, and not a special character,
6751 since it is escaped with "\"), and lastly either "gif", or "jpeg", or
6752 "jpg". Some possible matches would include: "//advert1.jpg",
6753 "/nasty/ads/advert1234.gif", "/banners/from/hell/advert99.jpg". It would
6754 not match "advert1.gif" (no leading slash), or "/adverts232.jpg" (the
6755 expression does not include an "s"), or "/advert1.jsp" ("jsp" is not in
6756 the expression anywhere).
6758 We are barely scratching the surface of regular expressions here so that
6759 you can understand the default Privoxy configuration files, and maybe use
6760 this knowledge to customize your own installation. There is much, much
6761 more that can be done with regular expressions. Now that you know enough
6762 to get started, you can learn more on your own :/
6764 More reading on Perl Compatible Regular expressions:
6765 http://perldoc.perl.org/perlre.html
6767 For information on regular expression based substitutions and their
6768 applications in filters, please see the filter file tutorial in this
6771 --------------------------------------------------------------------------
6773 14.2. Privoxy's Internal Pages
6775 Since Privoxy proxies each requested web page, it is easy for Privoxy to
6776 trap certain special URLs. In this way, we can talk directly to Privoxy,
6777 and see how it is configured, see how our rules are being applied, change
6778 these rules and other configuration options, and even turn Privoxy's
6779 filtering off, all with a web browser.
6781 The URLs listed below are the special ones that allow direct access to
6782 Privoxy. Of course, Privoxy must be running to access these. If not, you
6783 will get a friendly error message. Internet access is not necessary
6786 * Privoxy main page:
6788 http://config.privoxy.org/
6790 There is a shortcut: http://p.p/ (But it doesn't provide a fall-back
6791 to a real page, in case the request is not sent through Privoxy)
6793 * Show information about the current configuration, including viewing
6794 and editing of actions files:
6796 http://config.privoxy.org/show-status
6798 * Show the source code version numbers:
6800 http://config.privoxy.org/show-version
6802 * Show the browser's request headers:
6804 http://config.privoxy.org/show-request
6806 * Show which actions apply to a URL and why:
6808 http://config.privoxy.org/show-url-info
6810 * Toggle Privoxy on or off. This feature can be turned off/on in the
6811 main config file. When toggled "off", "Privoxy" continues to run, but
6812 only as a pass-through proxy, with no actions taking place:
6814 http://config.privoxy.org/toggle
6816 Short cuts. Turn off, then on:
6818 http://config.privoxy.org/toggle?set=disable
6820 http://config.privoxy.org/toggle?set=enable
6822 These may be bookmarked for quick reference. See next.
6824 --------------------------------------------------------------------------
6826 14.2.1. Bookmarklets
6828 Below are some "bookmarklets" to allow you to easily access a "mini"
6829 version of some of Privoxy's special pages. They are designed for MS
6830 Internet Explorer, but should work equally well in Netscape, Mozilla, and
6831 other browsers which support JavaScript. They are designed to run directly
6832 from your bookmarks - not by clicking the links below (although that
6833 should work for testing).
6835 To save them, right-click the link and choose "Add to Favorites" (IE) or
6836 "Add Bookmark" (Netscape). You will get a warning that the bookmark "may
6837 not be safe" - just click OK. Then you can run the Bookmarklet directly
6838 from your favorites/bookmarks. For even faster access, you can put them on
6839 the "Links" bar (IE) or the "Personal Toolbar" (Netscape), and run them
6840 with a single click.
6846 * Privoxy - Toggle Privoxy (Toggles between enabled and disabled)
6848 * Privoxy- View Status
6852 Credit: The site which gave us the general idea for these bookmarklets is
6853 www.bookmarklets.com. They have more information about bookmarklets.
6855 --------------------------------------------------------------------------
6857 14.3. Chain of Events
6859 Let's take a quick look at how some of Privoxy's core features are
6860 triggered, and the ensuing sequence of events when a web page is requested
6863 * First, your web browser requests a web page. The browser knows to send
6864 the request to Privoxy, which will in turn, relay the request to the
6865 remote web server after passing the following tests:
6867 * Privoxy traps any request for its own internal CGI pages (e.g
6868 http://p.p/) and sends the CGI page back to the browser.
6870 * Next, Privoxy checks to see if the URL matches any "+block" patterns.
6871 If so, the URL is then blocked, and the remote web server will not be
6872 contacted. "+handle-as-image" and "+handle-as-empty-document" are then
6873 checked, and if there is no match, an HTML "BLOCKED" page is sent back
6874 to the browser. Otherwise, if it does match, an image is returned for
6875 the former, and an empty text document for the latter. The type of
6876 image would depend on the setting of "+set-image-blocker" (blank,
6877 checkerboard pattern, or an HTTP redirect to an image elsewhere).
6879 * Untrusted URLs are blocked. If URLs are being added to the trust file,
6882 * If the URL pattern matches the "+fast-redirects" action, it is then
6883 processed. Unwanted parts of the requested URL are stripped.
6885 * Now the rest of the client browser's request headers are processed. If
6886 any of these match any of the relevant actions (e.g.
6887 "+hide-user-agent", etc.), headers are suppressed or forged as
6888 determined by these actions and their parameters.
6890 * Now the web server starts sending its response back (i.e. typically a
6893 * First, the server headers are read and processed to determine, among
6894 other things, the MIME type (document type) and encoding. The headers
6895 are then filtered as determined by the "+crunch-incoming-cookies",
6896 "+session-cookies-only", and "+downgrade-http-version" actions.
6898 * If the "+kill-popups" action applies, and it is an HTML or JavaScript
6899 document, the popup-code in the response is filtered on-the-fly as it
6902 * If any "+filter" action or "+deanimate-gifs" action applies (and the
6903 document type fits the action), the rest of the page is read into
6904 memory (up to a configurable limit). Then the filter rules (from
6905 default.filter and any other filter files) are processed against the
6906 buffered content. Filters are applied in the order they are specified
6907 in one of the filter files. Animated GIFs, if present, are reduced to
6908 either the first or last frame, depending on the action setting.The
6909 entire page, which is now filtered, is then sent by Privoxy back to
6912 If neither a "+filter" action or "+deanimate-gifs" matches, then
6913 Privoxy passes the raw data through to the client browser as it
6916 * As the browser receives the now (possibly filtered) page content, it
6917 reads and then requests any URLs that may be embedded within the page
6918 source, e.g. ad images, stylesheets, JavaScript, other HTML documents
6919 (e.g. frames), sounds, etc. For each of these objects, the browser
6920 issues a separate request (this is easily viewable in Privoxy's logs).
6921 And each such request is in turn processed just as above. Note that a
6922 complex web page will have many, many such embedded URLs. If these
6923 secondary requests are to a different server, then quite possibly a
6924 very differing set of actions is triggered.
6926 NOTE: This is somewhat of a simplistic overview of what happens with each
6927 URL request. For the sake of brevity and simplicity, we have focused on
6928 Privoxy's core features only.
6930 --------------------------------------------------------------------------
6932 14.4. Troubleshooting: Anatomy of an Action
6934 The way Privoxy applies actions and filters to any given URL can be
6935 complex, and not always so easy to understand what is happening. And
6936 sometimes we need to be able to see just what Privoxy is doing.
6937 Especially, if something Privoxy is doing is causing us a problem
6938 inadvertently. It can be a little daunting to look at the actions and
6939 filters files themselves, since they tend to be filled with regular
6940 expressions whose consequences are not always so obvious.
6942 One quick test to see if Privoxy is causing a problem or not, is to
6943 disable it temporarily. This should be the first troubleshooting step. See
6944 the Bookmarklets section on a quick and easy way to do this (be sure to
6945 flush caches afterward!). Looking at the logs is a good idea too. (Note
6946 that both the toggle feature and logging are enabled via config file
6947 settings, and may need to be turned "on".)
6949 Another easy troubleshooting step to try is if you have done any
6950 customization of your installation, revert back to the installed defaults
6951 and see if that helps. There are times the developers get complaints about
6952 one thing or another, and the problem is more related to a customized
6953 configuration issue.
6955 Privoxy also provides the http://config.privoxy.org/show-url-info page
6956 that can show us very specifically how actions are being applied to any
6957 given URL. This is a big help for troubleshooting.
6959 First, enter one URL (or partial URL) at the prompt, and then Privoxy will
6960 tell us how the current configuration will handle it. This will not help
6961 with filtering effects (i.e. the "+filter" action) from one of the filter
6962 files since this is handled very differently and not so easy to trap! It
6963 also will not tell you about any other URLs that may be embedded within
6964 the URL you are testing. For instance, images such as ads are expressed as
6965 URLs within the raw page source of HTML pages. So you will only get info
6966 for the actual URL that is pasted into the prompt area -- not any
6967 sub-URLs. If you want to know about embedded URLs like ads, you will have
6968 to dig those out of the HTML source. Use your browser's "View Page Source"
6969 option for this. Or right click on the ad, and grab the URL.
6971 Let's try an example, google.com, and look at it one section at a time in
6972 a sample configuration (your real configuration may vary):
6974 Matches for http://www.google.com:
6976 In file: default.action [ View ] [ Edit ]
6978 {+deanimate-gifs {last}
6979 +fast-redirects {check-decoded-url}
6980 +filter {refresh-tags}
6981 +filter {img-reorder}
6982 +filter {banners-by-size}
6984 +filter {jumping-windows}
6985 +filter {ie-exploits}
6986 +hide-forwarded-for-headers
6987 +hide-from-header {block}
6988 +hide-referrer {forge}
6989 +session-cookies-only
6990 +set-image-blocker {pattern}
6993 { -session-cookies-only }
6999 In file: user.action [ View ] [ Edit ]
7000 (no matches in this file)
7002 This is telling us how we have defined our "actions", and which ones match
7003 for our test case, "google.com". Displayed is all the actions that are
7004 available to us. Remember, the + sign denotes "on". - denotes "off". So
7005 some are "on" here, but many are "off". Each example we try may provide a
7006 slightly different end result, depending on our configuration directives.
7008 The first listing is for our default.action file. The large, multi-line
7009 listing, is how the actions are set to match for all URLs, i.e. our
7010 default settings. If you look at your "actions" file, this would be the
7011 section just below the "aliases" section near the top. This will apply to
7012 all URLs as signified by the single forward slash at the end of the
7015 But we have defined additional actions that would be exceptions to these
7016 general rules, and then we list specific URLs (or patterns) that these
7017 exceptions would apply to. Last match wins. Just below this then are two
7018 explicit matches for ".google.com". The first is negating our previous
7019 cookie setting, which was for "+session-cookies-only" (i.e. not
7020 persistent). So we will allow persistent cookies for google, at least that
7021 is how it is in this example. The second turns off any "+fast-redirects"
7022 action, allowing this to take place unmolested. Note that there is a
7023 leading dot here -- ".google.com". This will match any hosts and
7024 sub-domains, in the google.com domain also, such as "www.google.com" or
7025 "mail.google.com". But it would not match "www.google.de"! So, apparently,
7026 we have these two actions defined as exceptions to the general rules at
7027 the top somewhere in the lower part of our default.action file, and
7028 "google.com" is referenced somewhere in these latter sections.
7030 Then, for our user.action file, we again have no hits. So there is nothing
7031 google-specific that we might have added to our own, local configuration.
7032 If there was, those actions would over-rule any actions from previously
7033 processed files, such as default.action. user.action typically has the
7034 last word. This is the best place to put hard and fast exceptions,
7036 And finally we pull it all together in the bottom section and summarize
7037 how Privoxy is applying all its "actions" to "google.com":
7043 -client-header-filter{hide-tor-exit-notation}
7044 -content-type-overwrite
7045 -crunch-client-header
7046 -crunch-if-none-match
7047 -crunch-incoming-cookies
7048 -crunch-outgoing-cookies
7049 -crunch-server-header
7050 +deanimate-gifs {last}
7051 -downgrade-http-version
7054 -filter {content-cookies}
7055 -filter {all-popups}
7056 -filter {banners-by-link}
7057 -filter {tiny-textforms}
7058 -filter {frameset-borders}
7059 -filter {demoronizer}
7060 -filter {shockwave-flash}
7061 -filter {quicktime-kioskmode}
7063 -filter {crude-parental}
7064 -filter {site-specifics}
7065 -filter {js-annoyances}
7066 -filter {html-annoyances}
7067 +filter {refresh-tags}
7068 -filter {unsolicited-popups}
7069 +filter {img-reorder}
7070 +filter {banners-by-size}
7072 +filter {jumping-windows}
7073 +filter {ie-exploits}
7080 -handle-as-empty-document
7082 -hide-accept-language
7083 -hide-content-disposition
7084 +hide-forwarded-for-headers
7085 +hide-from-header {block}
7086 -hide-if-modified-since
7087 +hide-referrer {forge}
7092 -overwrite-last-modified
7093 -prevent-compression
7097 -server-header-filter{xml-to-html}
7098 -server-header-filter{html-to-xml}
7099 -session-cookies-only
7100 +set-image-blocker {pattern}
7101 -treat-forbidden-connects-like-blocks
7103 Notice the only difference here to the previous listing, is to
7104 "fast-redirects" and "session-cookies-only", which are activated
7105 specifically for this site in our configuration, and thus show in the
7108 Now another example, "ad.doubleclick.net":
7116 { +block +handle-as-image }
7117 .[a-vx-z]*.doubleclick.net
7119 We'll just show the interesting part here - the explicit matches. It is
7120 matched three different times. Two "+block" sections, and a "+block
7121 +handle-as-image", which is the expanded form of one of our aliases that
7122 had been defined as: "+block-as-image". ("Aliases" are defined in the
7123 first section of the actions file and typically used to combine more than
7126 Any one of these would have done the trick and blocked this as an unwanted
7127 image. This is unnecessarily redundant since the last case effectively
7128 would also cover the first. No point in taking chances with these guys
7129 though ;-) Note that if you want an ad or obnoxious URL to be invisible,
7130 it should be defined as "ad.doubleclick.net" is done here -- as both a
7131 "+block" and an "+handle-as-image". The custom alias "+block-as-image"
7132 just simplifies the process and make it more readable.
7134 One last example. Let's try "http://www.example.net/adsl/HOWTO/". This one
7135 is giving us problems. We are getting a blank page. Hmmm ...
7137 Matches for http://www.example.net/adsl/HOWTO/:
7139 In file: default.action [ View ] [ Edit ]
7143 -client-header-filter{hide-tor-exit-notation}
7144 -content-type-overwrite
7145 -crunch-client-header
7146 -crunch-if-none-match
7147 -crunch-incoming-cookies
7148 -crunch-outgoing-cookies
7149 -crunch-server-header
7151 -downgrade-http-version
7152 +fast-redirects {check-decoded-url}
7154 -filter {content-cookies}
7155 -filter {all-popups}
7156 -filter {banners-by-link}
7157 -filter {tiny-textforms}
7158 -filter {frameset-borders}
7159 -filter {demoronizer}
7160 -filter {shockwave-flash}
7161 -filter {quicktime-kioskmode}
7163 -filter {crude-parental}
7164 -filter {site-specifics}
7165 -filter {js-annoyances}
7166 -filter {html-annoyances}
7167 +filter {refresh-tags}
7168 -filter {unsolicited-popups}
7169 +filter {img-reorder}
7170 +filter {banners-by-size}
7172 +filter {jumping-windows}
7173 +filter {ie-exploits}
7180 -handle-as-empty-document
7182 -hide-accept-language
7183 -hide-content-disposition
7184 +hide-forwarded-for-headers
7185 +hide-from-header{block}
7186 +hide-referer{forge}
7190 -overwrite-last-modified
7191 +prevent-compression
7195 -server-header-filter{xml-to-html}
7196 -server-header-filter{html-to-xml}
7197 +session-cookies-only
7198 +set-image-blocker{blank}
7199 -treat-forbidden-connects-like-blocks }
7202 { +block +handle-as-image }
7205 Ooops, the "/adsl/" is matching "/ads" in our configuration! But we did
7206 not want this at all! Now we see why we get the blank page. It is actually
7207 triggering two different actions here, and the effects are aggregated so
7208 that the URL is blocked, and Privoxy is told to treat the block as if it
7209 were an image. But this is, of course, all wrong. We could now add a new
7210 action below this (or better in our own user.action file) that explicitly
7211 un blocks ( "{-block}") paths with "adsl" in them (remember, last match in
7212 the configuration wins). There are various ways to handle such exceptions.
7218 Now the page displays ;-) Remember to flush your browser's caches when
7219 making these kinds of changes to your configuration to insure that you get
7220 a freshly delivered page! Or, try using Shift+Reload.
7222 But now what about a situation where we get no explicit matches like we
7225 { +block +handle-as-image }
7228 That actually was very helpful and pointed us quickly to where the problem
7229 was. If you don't get this kind of match, then it means one of the default
7230 rules in the first section of default.action is causing the problem. This
7231 would require some guesswork, and maybe a little trial and error to
7232 isolate the offending rule. One likely cause would be one of the "+filter"
7233 actions. These tend to be harder to troubleshoot. Try adding the URL for
7234 the site to one of aliases that turn off "+filter":
7238 .worldpay.com # for quietpc.com
7243 "{ shop }" is an "alias" that expands to "{ -filter -session-cookies-only
7244 }". Or you could do your own exception to negate filtering:
7247 # Disable ALL filter actions for sites in this section
7252 This would turn off all filtering for these sites. This is best put in
7253 user.action, for local site exceptions. Note that when a simple domain
7254 pattern is used by itself (without the subsequent path portion), all
7255 sub-pages within that domain are included automatically in the scope of
7258 Images that are inexplicably being blocked, may well be hitting the
7259 "+filter{banners-by-size}" rule, which assumes that images of certain
7260 sizes are ad banners (works well most of the time since these tend to be
7263 "{ fragile }" is an alias that disables most actions that are the most
7264 likely to cause trouble. This can be used as a last resort for problem
7268 # Handle with care: easy to break
7272 Remember to flush caches! Note that the mail.google reference lacks the
7273 TLD portion (e.g. ".com"). This will effectively match any TLD with google
7274 in it, such as mail.google.de., just as an example.
7276 If this still does not work, you will have to go through the remaining
7277 actions one by one to find which one(s) is causing the problem.