s@©@(c)@
[privoxy.git] / doc / text / user-manual.txt
1                            Privoxy 3.0.8 User Manual
2
3    [Copyright[ (c) 2001 - 2008 by Privoxy Developers]]
4
5    $Id: user-manual.txt,v 1.74 2008/01/19 21:41:37 hal9 Exp $
6
7    The Privoxy User Manual gives users information on how to install,
8    configure and use Privoxy.
9
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.
16
17    Privoxy is based on Internet Junkbuster (tm).
18
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.
22
23    --------------------------------------------------------------------------
24
25    Table of Contents
26
27    1. Introduction
28
29                 1.1. Features
30
31    2. Installation
32
33                 2.1. Binary Packages
34
35                              2.1.1. Red Hat and Fedora RPMs
36
37                              2.1.2. Debian and Ubuntu
38
39                              2.1.3. Windows
40
41                              2.1.4. Solaris
42
43                              2.1.5. OS/2
44
45                              2.1.6. Mac OSX
46
47                              2.1.7. AmigaOS
48
49                              2.1.8. FreeBSD
50
51                              2.1.9. Gentoo
52
53                 2.2. Building from Source
54
55                 2.3. Keeping your Installation Up-to-Date
56
57    3. What's New in this Release
58
59                 3.1. Note to Upgraders
60
61    4. Quickstart to Using Privoxy
62
63                 4.1. Quickstart to Ad Blocking
64
65    5. Starting Privoxy
66
67                 5.1. Red Hat and Fedora
68
69                 5.2. Debian
70
71                 5.3. Windows
72
73                 5.4. Solaris, NetBSD, FreeBSD, HP-UX and others
74
75                 5.5. OS/2
76
77                 5.6. Mac OSX
78
79                 5.7. AmigaOS
80
81                 5.8. Gentoo
82
83                 5.9. Command Line Options
84
85    6. Privoxy Configuration
86
87                 6.1. Controlling Privoxy with Your Web Browser
88
89                 6.2. Configuration Files Overview
90
91    7. The Main Configuration File
92
93                 7.1. Local Set-up Documentation
94
95                              7.1.1. user-manual
96
97                              7.1.2. trust-info-url
98
99                              7.1.3. admin-address
100
101                              7.1.4. proxy-info-url
102
103                 7.2. Configuration and Log File Locations
104
105                              7.2.1. confdir
106
107                              7.2.2. templdir
108
109                              7.2.3. logdir
110
111                              7.2.4. actionsfile
112
113                              7.2.5. filterfile
114
115                              7.2.6. logfile
116
117                              7.2.7. jarfile
118
119                              7.2.8. trustfile
120
121                 7.3. Debugging
122
123                              7.3.1. debug
124
125                              7.3.2. single-threaded
126
127                 7.4. Access Control and Security
128
129                              7.4.1. listen-address
130
131                              7.4.2. toggle
132
133                              7.4.3. enable-remote-toggle
134
135                              7.4.4. enable-remote-http-toggle
136
137                              7.4.5. enable-edit-actions
138
139                              7.4.6. enforce-blocks
140
141                              7.4.7. ACLs: permit-access and deny-access
142
143                              7.4.8. buffer-limit
144
145                 7.5. Forwarding
146
147                              7.5.1. forward
148
149                              7.5.2. forward-socks4 and forward-socks4a
150
151                              7.5.3. Advanced Forwarding Examples
152
153                              7.5.4. forwarded-connect-retries
154
155                              7.5.5. accept-intercepted-requests
156
157                              7.5.6. allow-cgi-request-crunching
158
159                              7.5.7. split-large-forms
160
161                 7.6. Windows GUI Options
162
163    8. Actions Files
164
165                 8.1. Finding the Right Mix
166
167                 8.2. How to Edit
168
169                 8.3. How Actions are Applied to Requests
170
171                 8.4. Patterns
172
173                              8.4.1. The Domain Pattern
174
175                              8.4.2. The Path Pattern
176
177                              8.4.3. The Tag Pattern
178
179                 8.5. Actions
180
181                              8.5.1. add-header
182
183                              8.5.2. block
184
185                              8.5.3. client-header-filter
186
187                              8.5.4. client-header-tagger
188
189                              8.5.5. content-type-overwrite
190
191                              8.5.6. crunch-client-header
192
193                              8.5.7. crunch-if-none-match
194
195                              8.5.8. crunch-incoming-cookies
196
197                              8.5.9. crunch-server-header
198
199                              8.5.10. crunch-outgoing-cookies
200
201                              8.5.11. deanimate-gifs
202
203                              8.5.12. downgrade-http-version
204
205                              8.5.13. fast-redirects
206
207                              8.5.14. filter
208
209                              8.5.15. force-text-mode
210
211                              8.5.16. forward-override
212
213                              8.5.17. handle-as-empty-document
214
215                              8.5.18. handle-as-image
216
217                              8.5.19. hide-accept-language
218
219                              8.5.20. hide-content-disposition
220
221                              8.5.21. hide-if-modified-since
222
223                              8.5.22. hide-forwarded-for-headers
224
225                              8.5.23. hide-from-header
226
227                              8.5.24. hide-referrer
228
229                              8.5.25. hide-user-agent
230
231                              8.5.26. inspect-jpegs
232
233                              8.5.27. kill-popups
234
235                              8.5.28. limit-connect
236
237                              8.5.29. prevent-compression
238
239                              8.5.30. overwrite-last-modified
240
241                              8.5.31. redirect
242
243                              8.5.32. send-vanilla-wafer
244
245                              8.5.33. send-wafer
246
247                              8.5.34. server-header-filter
248
249                              8.5.35. server-header-tagger
250
251                              8.5.36. session-cookies-only
252
253                              8.5.37. set-image-blocker
254
255                              8.5.38. treat-forbidden-connects-like-blocks
256
257                              8.5.39. Summary
258
259                 8.6. Aliases
260
261                 8.7. Actions Files Tutorial
262
263                              8.7.1. default.action
264
265                              8.7.2. user.action
266
267    9. Filter Files
268
269                 9.1. Filter File Tutorial
270
271                 9.2. The Pre-defined Filters
272
273    10. Privoxy's Template Files
274
275    11. Contacting the Developers, Bug Reporting and Feature Requests
276
277                 11.1. Get Support
278
279                 11.2. Reporting Problems
280
281                              11.2.1. Reporting Ads or Other Configuration
282                              Problems
283
284                              11.2.2. Reporting Bugs
285
286                 11.3. Request New Features
287
288                 11.4. Other
289
290    12. Privoxy Copyright, License and History
291
292                 12.1. License
293
294                 12.2. History
295
296                 12.3. Authors
297
298    13. See Also
299
300    14. Appendix
301
302                 14.1. Regular Expressions
303
304                 14.2. Privoxy's Internal Pages
305
306                              14.2.1. Bookmarklets
307
308                 14.3. Chain of Events
309
310                 14.4. Troubleshooting: Anatomy of an Action
311
312 1. Introduction
313
314    This documentation is included with the current stable version of Privoxy,
315    v.3.0.8.
316
317    --------------------------------------------------------------------------
318
319   1.1. Features
320
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:
324
325      * Can be run as an "intercepting" proxy, which obviates the need to
326        configure browsers individually.
327
328      * Sophisticated actions and filters for manipulating both server and
329        client headers.
330
331      * Can be chained with other proxies.
332
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.
336
337      * Web page filtering (text replacements, removes banners based on size,
338        invisible "web-bugs", JavaScript and HTML annoyances, pop-up windows,
339        etc.)
340
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.
344
345      * Support for Perl Compatible Regular Expressions in the configuration
346        files, and a more sophisticated and flexible configuration syntax.
347
348      * Improved cookie management features (e.g. session based cookies).
349
350      * GIF de-animation.
351
352      * Bypass many click-tracking scripts (avoids script redirection).
353
354      * Multi-threaded (POSIX and native threads).
355
356      * User-customizable HTML templates for all proxy-generated pages (e.g.
357        "blocked" page).
358
359      * Auto-detection and re-reading of config file changes.
360
361      * Improved signal handling, and a true daemon mode (Unix).
362
363      * Every feature now controllable on a per-site or per-location basis,
364        configuration more powerful and versatile over-all.
365
366      * Many smaller new features added, limitations and bugs removed, and
367        security holes fixed.
368
369    --------------------------------------------------------------------------
370
371 2. Installation
372
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
376    Project Page.
377
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.
382
383    --------------------------------------------------------------------------
384
385   2.1. Binary Packages
386
387    How to install the binary packages depends on your operating system:
388
389    --------------------------------------------------------------------------
390
391     2.1.1. Red Hat and Fedora RPMs
392
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.
395
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
398    methods.
399
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.
403
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
407    Privoxy.
408
409    --------------------------------------------------------------------------
410
411     2.1.2. Debian and Ubuntu
412
413    DEBs can be installed with apt-get install privoxy, and will use
414    /etc/privoxy for the location of configuration files.
415
416    --------------------------------------------------------------------------
417
418     2.1.3. Windows
419
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.
423
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.
427
428    Arguments:
429
430            --install[:service_name]
431
432            --uninstall[:service_name]
433
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.
442
443    --------------------------------------------------------------------------
444
445     2.1.4. Solaris
446
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.
449
450    --------------------------------------------------------------------------
451
452     2.1.5. OS/2
453
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.
457
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.
462
463    The directory you choose to install Privoxy into will contain all of the
464    configuration files.
465
466    --------------------------------------------------------------------------
467
468     2.1.6. Mac OSX
469
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.
477
478    To start Privoxy by hand, double-click on StartPrivoxy.command in the
479    /Library/Privoxy folder. Or, type this command in the Terminal:
480
481      /Library/Privoxy/StartPrivoxy.command
482
483
484    You will be prompted for the administrator password.
485
486    --------------------------------------------------------------------------
487
488     2.1.7. AmigaOS
489
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.
493
494    --------------------------------------------------------------------------
495
496     2.1.8. FreeBSD
497
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.
500
501    If you don't use the ports, you can fetch and install the package with
502    pkg_add -r privoxy.
503
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.
507
508    --------------------------------------------------------------------------
509
510     2.1.9. Gentoo
511
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
515    Portage Tree).
516
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
519    the latest version.
520
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.
523
524    --------------------------------------------------------------------------
525
526   2.2. Building from Source
527
528    The most convenient way to obtain the Privoxy sources is to download the
529    source tarball from our project download page.
530
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.
534
535    To build Privoxy from source, autoconf, GNU make (gmake), and, of course,
536    a C compiler like gcc are required.
537
538    When building from a source tarball, first unpack the source:
539
540     tar xzvf privoxy-3.0.8-src* [.tgz or .tar.gz]
541     cd privoxy-3.0.8
542
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:
547
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
550   cd current
551
552    This will create a directory named current/, which will contain the source
553    tree.
554
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
557    tree).
558
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
564    platform).
565
566    /etc/passwd might then look like:
567
568      privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell
569
570    And then /etc/group, like:
571
572      privoxy:*:7777:
573
574    Some binary packages may do this for you.
575
576    Then, to build from either unpacked tarball or CVS source:
577
578     autoheader
579     autoconf
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)
585
586    Using GNU make, you can have the first four steps automatically done for
587    you by just typing:
588
589      make
590
591    in the freshly downloaded or unpacked source directory.
592
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:
596
597     ./configure  --disable-toggle  --disable-editor  --disable-force
598
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.
601
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.
608
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!
614
615    Alternately, you can specify user and group on the make command line, but
616    be sure both already exist:
617
618     make -s install  USER=privoxy GROUP=privoxy
619
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.
626
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.
633
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
637    for Privoxy.
638
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.
643
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.
650
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.
661
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.
665
666    --------------------------------------------------------------------------
667
668   2.3. Keeping your Installation Up-to-Date
669
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.
673
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.
677
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.
682
683    --------------------------------------------------------------------------
684
685 3. What's New in this Release
686
687    There are many improvements and new features since Privoxy 3.0.6, the last
688    stable release:
689
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
695        tags.
696
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.
702
703      * There are four new options for the main config file:
704
705           * allow-cgi-request-crunching which allows requests for Privoxy's
706             internal CGI pages to be blocked, redirected or (un)trusted like
707             ordinary requests.
708
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.
712
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.
718
719           * templdir to designate an alternate location for Privoxy's locally
720             customized CGI templates so that these are not overwritten during
721             upgrades.
722
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)
727
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
731        request origin.
732
733      * The redirect action can now use regular expression substitutions
734        against the original URL.
735
736      * zlib support is now available as a compile time option to filter
737        compressed content. Patch provided by Wil Mahan.
738
739      * Improve various filters, and add new ones.
740
741      * Include support for RFC 3253 so that Subversion works with Privoxy.
742        Patch provided by Petr Kadlec.
743
744      * Logging can be completely turned off by not specifying a logfile
745        directive.
746
747      * A number of improvements to Privoxy's internal CGI pages, including
748        the use of favicons for error and control pages.
749
750      * Many bugfixes, memory leaks addressed, code improvements, and logging
751        improvements.
752
753    For a more detailed list of changes please have a look at the ChangeLog.
754
755    --------------------------------------------------------------------------
756
757   3.1. Note to Upgraders
758
759    A quick list of things to be aware of before upgrading from earlier
760    versions of Privoxy:
761
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
765        maybe patch.
766
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
771        anyway.
772
773      * Note that some installers remove earlier versions completely,
774        including configuration files, therefore you should really save any
775        important configuration files!
776
777      * On the other hand, other installers don't overwrite existing
778        configuration files, thinking you will want to do that yourself.
779
780      * standard.action now only includes the enabled actions. Not all actions
781        as before.
782
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.
787
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.
792
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.
797
798    --------------------------------------------------------------------------
799
800 4. Quickstart to Using Privoxy
801
802      * Install Privoxy. See the Installation Section below for platform
803        specific information.
804
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.
808
809      * Start Privoxy, if the installation program has not done this already
810        (may vary according to platform). See the section Starting Privoxy.
811
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
816        these protocols.
817
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.
821
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.
828
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
832        banners.
833
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".
841
842      * Please see the section Contacting the Developers on how to report
843        bugs, problems with websites or to get help.
844
845      * Now enjoy surfing with enhanced control, comfort and privacy!
846
847    --------------------------------------------------------------------------
848
849   4.1. Quickstart to Ad Blocking
850
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.
854
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.
858
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.
868
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
875    below.
876
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
881    section.
882
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.
894
895    The most important actions for basic ad blocking are: block,
896    handle-as-image, handle-as-empty-document,and set-image-blocker:
897
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).
906
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.
917
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.
921
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.
926
927        The configuration options on what to display instead of the ad are:
928
929           pattern - a checkerboard pattern, so that an ad replacement is
930        obvious. This is the default.
931
932           blank - A very small empty GIF image is displayed. This is the
933        so-called "invisible" configuration option.
934
935           http://<URL> - A redirect to any image anywhere of the user's
936        choosing (advanced usage).
937
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.
945
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.
950
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.
954
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.
962
963    A quick and simple step by step example:
964
965      * Right click on the ad image to be blocked, then select "Copy Link
966        Location" from the pop-up menu.
967
968      * Set your browser to http://config.privoxy.org/show-status
969
970      * Find user.action in the top section, and click on "Edit":
971
972        Figure 1. Actions Files in Use
973
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
979        the list.
980
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
984        pop-up window).
985
986      * Now go back to the original page, and press SHIFT-Reload (or flush all
987        browser caches). The image should be gone now.
988
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.
993
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.
997
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.
1001
1002    --------------------------------------------------------------------------
1003
1004 5. Starting Privoxy
1005
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
1010    must be done!
1011
1012    Please note that Privoxy can only proxy HTTP and HTTPS traffic. It will
1013    not work with FTP or other protocols.
1014
1015    Figure 2. Proxy Configuration Showing Mozilla/Netscape HTTP and HTTPS
1016    (SSL) Settings
1017
1018    With Firefox, this is typically set under:
1019
1020     Tools -> Options ->  Advanced -> Network ->Connection -> Settings
1021
1022
1023    Or optionally on some platforms:
1024
1025     Edit -> Preferences -> General -> Connection Settings -> Manual Proxy
1026    Configuration
1027
1028
1029    With Netscape (and Mozilla), this can be set under:
1030
1031     Edit -> Preferences -> Advanced -> Proxies -> HTTP Proxy
1032
1033
1034    For Internet Explorer v.5-7:
1035
1036     Tools -> Internet Options -> Connections -> LAN Settings
1037
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)!
1043
1044    Figure 3. Proxy Configuration Showing Internet Explorer HTTP and HTTPS
1045    (Secure) Settings
1046
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!
1051
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.
1056
1057    --------------------------------------------------------------------------
1058
1059   5.1. Red Hat and Fedora
1060
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.
1063
1064     # /etc/rc.d/init.d/privoxy start
1065
1066    Or ...
1067
1068     # service privoxy start
1069
1070    --------------------------------------------------------------------------
1071
1072   5.2. Debian
1073
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
1076    configuration file.
1077
1078     # /etc/init.d/privoxy start
1079
1080    --------------------------------------------------------------------------
1081
1082   5.3. Windows
1083
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.
1088
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
1092    for details.
1093
1094    --------------------------------------------------------------------------
1095
1096   5.4. Solaris, NetBSD, FreeBSD, HP-UX and others
1097
1098    Example Unix startup command:
1099
1100     # /usr/sbin/privoxy /etc/privoxy/config
1101
1102    --------------------------------------------------------------------------
1103
1104   5.5. OS/2
1105
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.
1109
1110    --------------------------------------------------------------------------
1111
1112   5.6. Mac OSX
1113
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:
1118
1119      /Library/Privoxy/StartPrivoxy.command
1120
1121
1122    You will be prompted for the administrator password.
1123
1124    --------------------------------------------------------------------------
1125
1126   5.7. AmigaOS
1127
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
1133    running).
1134
1135    --------------------------------------------------------------------------
1136
1137   5.8. Gentoo
1138
1139    A script is again used. It will use the file /etc/privoxy/config as its
1140    main configuration file.
1141
1142     /etc/init.d/privoxy start
1143
1144
1145    Note that Privoxy is not automatically started at boot time by default.
1146    You can change this with the rc-update command.
1147
1148     rc-update add privoxy default
1149
1150
1151    --------------------------------------------------------------------------
1152
1153   5.9. Command Line Options
1154
1155    Privoxy may be invoked with the following command-line options:
1156
1157      * --version
1158
1159        Print version info and exit. Unix only.
1160
1161      * --help
1162
1163        Print short usage info and exit. Unix only.
1164
1165      * --no-daemon
1166
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.
1169
1170      * --pidfile FILE
1171
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.
1175
1176      * --user USER[.GROUP]
1177
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.
1181
1182      * --chroot
1183
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.
1189
1190      * --pre-chroot-nslookup hostname
1191
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.
1197
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
1203        output.
1204
1205      * configfile
1206
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
1211        start.
1212
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.
1216
1217    --------------------------------------------------------------------------
1218
1219 6. Privoxy Configuration
1220
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.
1224
1225    --------------------------------------------------------------------------
1226
1227   6.1. Controlling Privoxy with Your Web Browser
1228
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
1232    section:
1233
1234
1235
1236        Privoxy Menu
1237
1238              sB  View & change the current configuration
1239
1240              sB  View the source code version numbers
1241
1242              sB  View the request headers.
1243
1244              sB  Look up which actions apply to a URL and why
1245
1246              sB  Toggle Privoxy on or off
1247
1248              sB  Documentation
1249
1250
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.
1257
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
1264    your browser.
1265
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.
1269
1270    --------------------------------------------------------------------------
1271
1272   6.2. Configuration Files Overview
1273
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.
1277
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:
1281
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.
1284
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.
1291
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
1298        internal use.
1299
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.
1303
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.
1313
1314    The syntax of the configuration and filter files may change between
1315    different Privoxy versions, unfortunately some enhancements cost backwards
1316    compatibility.
1317
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.
1324
1325    The actions files and filter files can use Perl style regular expressions
1326    for maximum flexibility.
1327
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
1333    address.
1334
1335    --------------------------------------------------------------------------
1336
1337 7. The Main Configuration File
1338
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:
1343
1344      confdir /etc/privoxy
1345
1346    Assigns the value /etc/privoxy to the option confdir and thus indicates
1347    that the configuration directory is named "/etc/privoxy/".
1348
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
1351    unset.
1352
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
1355    may be surfing).
1356
1357    --------------------------------------------------------------------------
1358
1359   7.1. Local Set-up Documentation
1360
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.
1364
1365    --------------------------------------------------------------------------
1366
1367       7.1.1. user-manual
1368
1369    Specifies:
1370
1371            Location of the Privoxy User Manual.
1372
1373    Type of value:
1374
1375            A fully qualified URI
1376
1377    Default value:
1378
1379            Unset
1380
1381    Effect if unset:
1382
1383            http://www.privoxy.org/version/user-manual/ will be used, where
1384            version is the Privoxy version.
1385
1386    Notes:
1387
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
1392            installed copy.
1393
1394            Examples:
1395
1396            The best all purpose solution is simply to put the full local PATH
1397            to where the User Manual is located:
1398
1399              user-manual  /usr/share/doc/privoxy/user-manual
1400
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/).
1405
1406            If the documentation is not on the local system, it can be
1407            accessed from a remote server, as:
1408
1409              user-manual  http://example.com/privoxy/user-manual/
1410
1411            +---------------------------------------------------------+
1412            |                         Warning                         |
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            +---------------------------------------------------------+
1418
1419    --------------------------------------------------------------------------
1420
1421       7.1.2. trust-info-url
1422
1423    Specifies:
1424
1425            A URL to be displayed in the error page that users will see if
1426            access to an untrusted page is denied.
1427
1428    Type of value:
1429
1430            URL
1431
1432    Default value:
1433
1434            Two example URLs are provided
1435
1436    Effect if unset:
1437
1438            No links are displayed on the "untrusted" error page.
1439
1440    Notes:
1441
1442            The value of this option only matters if the experimental trust
1443            mechanism has been activated. (See trustfile below.)
1444
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.
1448
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!
1452
1453    --------------------------------------------------------------------------
1454
1455       7.1.3. admin-address
1456
1457    Specifies:
1458
1459            An email address to reach the Privoxy administrator.
1460
1461    Type of value:
1462
1463            Email address
1464
1465    Default value:
1466
1467            Unset
1468
1469    Effect if unset:
1470
1471            No email address is displayed on error pages and the CGI user
1472            interface.
1473
1474    Notes:
1475
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
1478            shown.
1479
1480    --------------------------------------------------------------------------
1481
1482       7.1.4. proxy-info-url
1483
1484    Specifies:
1485
1486            A URL to documentation about the local Privoxy setup,
1487            configuration or policies.
1488
1489    Type of value:
1490
1491            URL
1492
1493    Default value:
1494
1495            Unset
1496
1497    Effect if unset:
1498
1499            No link to local documentation is displayed on error pages and the
1500            CGI user interface.
1501
1502    Notes:
1503
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
1506            shown.
1507
1508            This URL shouldn't be blocked ;-)
1509
1510    --------------------------------------------------------------------------
1511
1512   7.2. Configuration and Log File Locations
1513
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.
1517
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.
1521
1522    --------------------------------------------------------------------------
1523
1524       7.2.1. confdir
1525
1526    Specifies:
1527
1528            The directory where the other configuration files are located.
1529
1530    Type of value:
1531
1532            Path name
1533
1534    Default value:
1535
1536            /etc/privoxy (Unix) or Privoxy installation dir (Windows)
1537
1538    Effect if unset:
1539
1540            Mandatory
1541
1542    Notes:
1543
1544            No trailing "/", please.
1545
1546    --------------------------------------------------------------------------
1547
1548       7.2.2. templdir
1549
1550    Specifies:
1551
1552            An alternative directory where the templates are loaded from.
1553
1554    Type of value:
1555
1556            Path name
1557
1558    Default value:
1559
1560            unset
1561
1562    Effect if unset:
1563
1564            The templates are assumed to be located in confdir/template.
1565
1566    Notes:
1567
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.
1573
1574    --------------------------------------------------------------------------
1575
1576       7.2.3. logdir
1577
1578    Specifies:
1579
1580            The directory where all logging takes place (i.e. where logfile
1581            and jarfile are located).
1582
1583    Type of value:
1584
1585            Path name
1586
1587    Default value:
1588
1589            /var/log/privoxy (Unix) or Privoxy installation dir (Windows)
1590
1591    Effect if unset:
1592
1593            Mandatory
1594
1595    Notes:
1596
1597            No trailing "/", please.
1598
1599    --------------------------------------------------------------------------
1600
1601       7.2.4. actionsfile
1602
1603    Specifies:
1604
1605            The actions file(s) to use
1606
1607    Type of value:
1608
1609            Complete file name, relative to confdir
1610
1611    Default values:
1612
1613              standard.action     # Internal purposes, no editing recommended
1614              default.action      # Main actions file
1615              user.action         # User customizations
1616
1617    Effect if unset:
1618
1619            No actions are taken at all. More or less neutral proxying.
1620
1621    Notes:
1622
1623            Multiple actionsfile lines are permitted, and are in fact
1624            recommended!
1625
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.
1630
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
1634            file.
1635
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.
1640
1641    --------------------------------------------------------------------------
1642
1643       7.2.5. filterfile
1644
1645    Specifies:
1646
1647            The filter file(s) to use
1648
1649    Type of value:
1650
1651            File name, relative to confdir
1652
1653    Default value:
1654
1655            default.filter (Unix) or default.filter.txt (Windows)
1656
1657    Effect if unset:
1658
1659            No textual content filtering takes place, i.e. all +filter{name}
1660            actions in the actions files are turned neutral.
1661
1662    Notes:
1663
1664            Multiple filterfile lines are permitted.
1665
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.
1672
1673            The +filter{name} actions rely on the relevant filter (name) to be
1674            defined in a filter file!
1675
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.
1679
1680            It is recommended to place any locally adapted filters into a
1681            separate file, such as user.filter.
1682
1683    --------------------------------------------------------------------------
1684
1685       7.2.6. logfile
1686
1687    Specifies:
1688
1689            The log file to use
1690
1691    Type of value:
1692
1693            File name, relative to logdir
1694
1695    Default value:
1696
1697            Unset (commented out). When activated: logfile (Unix) or
1698            privoxy.log (Windows).
1699
1700    Effect if unset:
1701
1702            No logfile is written.
1703
1704    Notes:
1705
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
1711            doing.
1712
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
1716            default.
1717
1718            For most troubleshooting purposes, you will have to change that,
1719            please refer to the debugging section for details.
1720
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.
1725
1726            Any log files must be writable by whatever user Privoxy is being
1727            run as (on Unix, default user id is "privoxy").
1728
1729    --------------------------------------------------------------------------
1730
1731       7.2.7. jarfile
1732
1733    Specifies:
1734
1735            The file to store intercepted cookies in
1736
1737    Type of value:
1738
1739            File name, relative to logdir
1740
1741    Default value:
1742
1743            Unset (commented out). When activated: jarfile (Unix) or
1744            privoxy.jar (Windows).
1745
1746    Effect if unset:
1747
1748            Intercepted cookies are not stored in a dedicated log file.
1749
1750    Notes:
1751
1752            The jarfile may grow to ridiculous sizes over time.
1753
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
1758            it.
1759
1760    --------------------------------------------------------------------------
1761
1762       7.2.8. trustfile
1763
1764    Specifies:
1765
1766            The name of the trust file to use
1767
1768    Type of value:
1769
1770            File name, relative to confdir
1771
1772    Default value:
1773
1774            Unset (commented out). When activated: trust (Unix) or trust.txt
1775            (Windows)
1776
1777    Effect if unset:
1778
1779            The entire trust mechanism is disabled.
1780
1781    Notes:
1782
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.
1786
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
1789            one of two ways:
1790
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.
1794
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
1803            not be made.
1804
1805            If you use the + operator in the trust file, it may grow
1806            considerably over time.
1807
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.
1811
1812            Possible applications include limiting Internet access for
1813            children.
1814
1815    --------------------------------------------------------------------------
1816
1817   7.3. Debugging
1818
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
1821    when debugging.
1822
1823    --------------------------------------------------------------------------
1824
1825       7.3.1. debug
1826
1827    Specifies:
1828
1829            Key values that determine what information gets logged.
1830
1831    Type of value:
1832
1833            Integer values
1834
1835    Default value:
1836
1837            0 (i.e.: only fatal errors (that cause Privoxy to exit) are
1838            logged)
1839
1840    Effect if unset:
1841
1842            Default value is used (see above).
1843
1844    Notes:
1845
1846            The available debug levels are:
1847
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
1862
1863            To select multiple debug levels, you can either add them or use
1864            multiple debug lines.
1865
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).
1871
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.
1875
1876            If you are used to the more verbose settings, simply enable the
1877            debug lines below again.
1878
1879            If you want to use pure CLF (Common Log Format), you should set
1880            "debug 512" ONLY and not enable anything else.
1881
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]".
1885
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
1889            own.
1890
1891    --------------------------------------------------------------------------
1892
1893       7.3.2. single-threaded
1894
1895    Specifies:
1896
1897            Whether to run only one server thread.
1898
1899    Type of value:
1900
1901            None
1902
1903    Default value:
1904
1905            Unset
1906
1907    Effect if unset:
1908
1909            Multi-threaded (or, where unavailable: forked) operation, i.e. the
1910            ability to serve multiple requests simultaneously.
1911
1912    Notes:
1913
1914            This option is only there for debugging purposes. It will
1915            drastically reduce performance.
1916
1917    --------------------------------------------------------------------------
1918
1919   7.4. Access Control and Security
1920
1921    This section of the config file controls the security-relevant aspects of
1922    Privoxy's configuration.
1923
1924    --------------------------------------------------------------------------
1925
1926       7.4.1. listen-address
1927
1928    Specifies:
1929
1930            The IP address and TCP port on which Privoxy will listen for
1931            client requests.
1932
1933    Type of value:
1934
1935            [IP-Address]:Port
1936
1937    Default value:
1938
1939            127.0.0.1:8118
1940
1941    Effect if unset:
1942
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
1945            their browser.
1946
1947    Notes:
1948
1949            You will need to configure your browser(s) to this proxy address
1950            and port.
1951
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.
1955
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.
1960
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
1964
1965    Example:
1966
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:
1971
1972              listen-address  192.168.0.1:8118
1973
1974    --------------------------------------------------------------------------
1975
1976       7.4.2. toggle
1977
1978    Specifies:
1979
1980            Initial state of "toggle" status
1981
1982    Type of value:
1983
1984            1 or 0
1985
1986    Default value:
1987
1988            1
1989
1990    Effect if unset:
1991
1992            Act as if toggled on
1993
1994    Notes:
1995
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.
1999
2000            The windows version will only display the toggle icon in the
2001            system tray if this option is present.
2002
2003    --------------------------------------------------------------------------
2004
2005       7.4.3. enable-remote-toggle
2006
2007    Specifies:
2008
2009            Whether or not the web-based toggle feature may be used
2010
2011    Type of value:
2012
2013            0 or 1
2014
2015    Default value:
2016
2017            0
2018
2019    Effect if unset:
2020
2021            The web-based toggle feature is disabled.
2022
2023    Notes:
2024
2025            When toggled off, Privoxy mostly acts like a normal,
2026            content-neutral proxy, i.e. doesn't block ads or filter content.
2027
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.
2033
2034            Note that malicious client side code (e.g Java) is also capable of
2035            using this option.
2036
2037            As a lot of Privoxy users don't read documentation, this feature
2038            is disabled by default.
2039
2040            Note that you must have compiled Privoxy with support for this
2041            feature, otherwise this option has no effect.
2042
2043    --------------------------------------------------------------------------
2044
2045       7.4.4. enable-remote-http-toggle
2046
2047    Specifies:
2048
2049            Whether or not Privoxy recognizes special HTTP headers to change
2050            its behaviour.
2051
2052    Type of value:
2053
2054            0 or 1
2055
2056    Default value:
2057
2058            0
2059
2060    Effect if unset:
2061
2062            Privoxy ignores special HTTP headers.
2063
2064    Notes:
2065
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.
2070
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.
2075
2076            This option will be removed in future releases as it has been
2077            obsoleted by the more general header taggers.
2078
2079    --------------------------------------------------------------------------
2080
2081       7.4.5. enable-edit-actions
2082
2083    Specifies:
2084
2085            Whether or not the web-based actions file editor may be used
2086
2087    Type of value:
2088
2089            0 or 1
2090
2091    Default value:
2092
2093            0
2094
2095    Effect if unset:
2096
2097            The web-based actions file editor is disabled.
2098
2099    Notes:
2100
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
2104            all users.
2105
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.
2109
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.
2114
2115            Note that you must have compiled Privoxy with support for this
2116            feature, otherwise this option has no effect.
2117
2118    --------------------------------------------------------------------------
2119
2120       7.4.6. enforce-blocks
2121
2122    Specifies:
2123
2124            Whether the user is allowed to ignore blocks and can "go there
2125            anyway".
2126
2127    Type of value:
2128
2129            0 or 1
2130
2131    Default value:
2132
2133            0
2134
2135    Effect if unset:
2136
2137            Blocks are not enforced.
2138
2139    Notes:
2140
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
2146            block.
2147
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.
2152
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.
2159
2160    Examples:
2161
2162            enforce-blocks 1
2163
2164    --------------------------------------------------------------------------
2165
2166       7.4.7. ACLs: permit-access and deny-access
2167
2168    Specifies:
2169
2170            Who can access what.
2171
2172    Type of value:
2173
2174            src_addr[/src_masklen] [dst_addr[/dst_masklen]]
2175
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.
2181
2182    Default value:
2183
2184            Unset
2185
2186    Effect if unset:
2187
2188            Don't restrict access further than implied by listen-address
2189
2190    Notes:
2191
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.
2197
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.
2201
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.
2206
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).
2213
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
2218            used.
2219
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).
2223
2224    Examples:
2225
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:
2229
2230              permit-access  localhost
2231
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
2234            the same system):
2235
2236              permit-access  www.privoxy.org/24 www.example.com/32
2237
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:
2241
2242              permit-access  192.168.45.64/26
2243              deny-access    192.168.45.73    www.dirty-stuff.example.com
2244
2245    --------------------------------------------------------------------------
2246
2247       7.4.8. buffer-limit
2248
2249    Specifies:
2250
2251            Maximum size of the buffer for content filtering.
2252
2253    Type of value:
2254
2255            Size in Kbytes
2256
2257    Default value:
2258
2259            4096
2260
2261    Effect if unset:
2262
2263            Use a 4MB (4096 KB) limit.
2264
2265    Notes:
2266
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.
2272
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.
2278
2279    --------------------------------------------------------------------------
2280
2281   7.5. Forwarding
2282
2283    This feature allows routing of HTTP requests through a chain of multiple
2284    proxies.
2285
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.
2289
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.
2297
2298    Also specified here are SOCKS proxies. Privoxy supports the SOCKS 4 and
2299    SOCKS 4A protocols.
2300
2301    --------------------------------------------------------------------------
2302
2303       7.5.1. forward
2304
2305    Specifies:
2306
2307            To which parent HTTP proxy specific requests should be routed.
2308
2309    Type of value:
2310
2311            target_pattern http_parent[:port]
2312
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".
2319
2320    Default value:
2321
2322            Unset
2323
2324    Effect if unset:
2325
2326            Don't use parent HTTP proxies.
2327
2328    Notes:
2329
2330            If http_parent is ".", then requests are not forwarded to another
2331            HTTP proxy but are made directly to the web servers.
2332
2333            Multiple lines are OK, they are checked in sequence, and the last
2334            match wins.
2335
2336    Examples:
2337
2338            Everything goes to an example parent proxy, except SSL on port 443
2339            (which it doesn't handle):
2340
2341              forward   /      parent-proxy.example.org:8080
2342              forward   :443   .
2343
2344            Everything goes to our example ISP's caching proxy, except for
2345            requests to that ISP's sites:
2346
2347              forward   /                  caching-proxy.isp.example.net:8000
2348              forward   .isp.example.net   .
2349
2350    --------------------------------------------------------------------------
2351
2352       7.5.2. forward-socks4 and forward-socks4a
2353
2354    Specifies:
2355
2356            Through which SOCKS proxy (and optionally to which parent HTTP
2357            proxy) specific requests should be routed.
2358
2359    Type of value:
2360
2361            target_pattern socks_proxy[:port] http_parent[:port]
2362
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
2369
2370    Default value:
2371
2372            Unset
2373
2374    Effect if unset:
2375
2376            Don't use SOCKS proxies.
2377
2378    Notes:
2379
2380            Multiple lines are OK, they are checked in sequence, and the last
2381            match wins.
2382
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
2386            locally.
2387
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.
2391
2392    Examples:
2393
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
2397            the Internet.
2398
2399   forward-socks4a   /              socks-gw.example.com:1080  www-cache.isp.example.net:8080
2400   forward           .example.com   .
2401
2402            A rule that uses a SOCKS 4 gateway for all destinations but no
2403            HTTP parent looks like this:
2404
2405              forward-socks4   /               socks-gw.example.com:1080  .
2406
2407            To chain Privoxy and Tor, both running on the same system, you
2408            would use something like:
2409
2410              forward-socks4a   /               127.0.0.1:9050 .
2411
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:
2415
2416              forward         192.168.*.*/     .
2417              forward            10.*.*.*/     .
2418              forward           127.*.*.*/     .
2419
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.
2425
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
2428            look like this:
2429
2430             forward           localhost/     .
2431
2432    --------------------------------------------------------------------------
2433
2434       7.5.3. Advanced Forwarding Examples
2435
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.
2440
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:
2444
2445    host-a:
2446
2447      forward    /           .
2448      forward    .isp-b.example.net  host-b:8118
2449
2450    host-b:
2451
2452      forward    /           .
2453      forward    .isp-a.example.org  host-a:8118
2454
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.
2457
2458    If you intend to chain Privoxy and squid locally, then chaining as browser
2459    -> squid -> privoxy is the recommended way.
2460
2461    Assuming that Privoxy and squid run on the same box, your squid
2462    configuration could then look like this:
2463
2464      # Define Privoxy as parent proxy (without ICP)
2465      cache_peer 127.0.0.1 parent 8118 7 no-query
2466
2467      # Define ACL for protocol FTP
2468      acl ftp proto FTP
2469
2470      # Do not forward FTP requests to Privoxy
2471      always_direct allow ftp
2472
2473      # Forward all the rest to Privoxy
2474      never_direct allow all
2475
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.
2479
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:
2483
2484      forward   /                          .
2485      forward   /.*\.(exe|com|dll|zip)$    antivir.example.com:8010
2486
2487    --------------------------------------------------------------------------
2488
2489       7.5.4. forwarded-connect-retries
2490
2491    Specifies:
2492
2493            How often Privoxy retries if a forwarded connection request fails.
2494
2495    Type of value:
2496
2497            Number of retries.
2498
2499    Default value:
2500
2501            0
2502
2503    Effect if unset:
2504
2505            Connections forwarded through other proxies are treated like
2506            direct connections and no retry attempts are made.
2507
2508    Notes:
2509
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
2516            message.
2517
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.
2521
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.
2526
2527    Examples:
2528
2529            forwarded-connect-retries 1
2530
2531    --------------------------------------------------------------------------
2532
2533       7.5.5. accept-intercepted-requests
2534
2535    Specifies:
2536
2537            Whether intercepted requests should be treated as valid.
2538
2539    Type of value:
2540
2541            0 or 1
2542
2543    Default value:
2544
2545            0
2546
2547    Effect if unset:
2548
2549            Only proxy requests are accepted, intercepted requests are treated
2550            as invalid.
2551
2552    Notes:
2553
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.
2557
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.
2563
2564    Examples:
2565
2566            accept-intercepted-requests 1
2567
2568    --------------------------------------------------------------------------
2569
2570       7.5.6. allow-cgi-request-crunching
2571
2572    Specifies:
2573
2574            Whether requests to Privoxy's CGI pages can be blocked or
2575            redirected.
2576
2577    Type of value:
2578
2579            0 or 1
2580
2581    Default value:
2582
2583            0
2584
2585    Effect if unset:
2586
2587            Privoxy ignores block and redirect actions for its CGI pages.
2588
2589    Notes:
2590
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.
2596
2597            Don't enable this option unless you're sure that you really need
2598            it.
2599
2600    Examples:
2601
2602            allow-cgi-request-crunching 1
2603
2604    --------------------------------------------------------------------------
2605
2606       7.5.7. split-large-forms
2607
2608    Specifies:
2609
2610            Whether the CGI interface should stay compatible with broken HTTP
2611            clients.
2612
2613    Type of value:
2614
2615            0 or 1
2616
2617    Default value:
2618
2619            0
2620
2621    Effect if unset:
2622
2623            The CGI form generate long GET URLs.
2624
2625    Notes:
2626
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.
2630
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.
2635
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.
2639
2640    Examples:
2641
2642            split-large-forms 1
2643
2644    --------------------------------------------------------------------------
2645
2646   7.6. Windows GUI Options
2647
2648    Privoxy has a number of options specific to the Windows GUI interface:
2649
2650    If "activity-animation" is set to 1, the Privoxy icon will animate when
2651    "Privoxy" is active. To turn off, set to 0.
2652
2653      activity-animation 1
2654
2655
2656    If "log-messages" is set to 1, Privoxy will log messages to the console
2657    window:
2658
2659      log-messages 1
2660
2661
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).
2665
2666    Warning: Setting this to 0 will result in the buffer to grow infinitely
2667    and eat up all your memory!
2668
2669      log-buffer-size 1
2670
2671
2672    log-max-lines is the maximum number of lines held in the log buffer. See
2673    above.
2674
2675      log-max-lines 200
2676
2677
2678    If "log-highlight-messages" is set to 1, Privoxy will highlight portions
2679    of the log messages with a bold-faced font:
2680
2681      log-highlight-messages 1
2682
2683
2684    The font used in the console window:
2685
2686      log-font-name Comic Sans MS
2687
2688
2689    Font size used in the console window:
2690
2691      log-font-size 8
2692
2693
2694    "show-on-task-bar" controls whether or not Privoxy will appear as a button
2695    on the Task bar when minimized:
2696
2697      show-on-task-bar 0
2698
2699
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).
2703
2704      close-button-minimizes 1
2705
2706
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
2709    command console.
2710
2711      #hide-console
2712
2713
2714    --------------------------------------------------------------------------
2715
2716 8. Actions Files
2717
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.
2726
2727    There are three action files included with Privoxy with differing
2728    purposes:
2729
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).
2737
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.
2742
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
2746        default.action.
2747
2748        Edit Set to Cautious Set to Medium Set to Advanced
2749
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.
2757
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.
2768
2769        It is not recommend to edit the standard.action file itself.
2770
2771        The default profiles, and their associated actions, as pre-defined in
2772        standard.action are:
2773
2774        Table 1. Default Configurations
2775
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        +--------------------------------------------------------------------+
2806
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.
2816
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.
2827
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.
2834
2835    --------------------------------------------------------------------------
2836
2837   8.1. Finding the Right Mix
2838
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.
2850
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
2855    chapter again :).
2856
2857    --------------------------------------------------------------------------
2858
2859   8.2. How to Edit
2860
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!
2870
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.
2874
2875    --------------------------------------------------------------------------
2876
2877   8.3. How Actions are Applied to Requests
2878
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.
2885
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.
2891
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:
2898
2899      { +handle-as-image  +block }
2900      # Block these as if they were images. Send no block page.
2901       banners.example.com
2902       media.example.com/.*banners
2903       .example.com/images/ads/
2904
2905    You can trace this process for URL patterns and any given URL by visiting
2906    http://config.privoxy.org/show-url-info.
2907
2908    Examples and more detail on this is provided in the Appendix,
2909    Troubleshooting: Anatomy of an Action section.
2910
2911    --------------------------------------------------------------------------
2912
2913   8.4. Patterns
2914
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.
2920
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!
2925
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)"
2929    based syntax.
2930
2931    www.example.com/
2932
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.
2938
2939    www.example.com
2940
2941            means exactly the same. For domain-only patterns, the trailing /
2942            may be omitted.
2943
2944    www.example.com/index.html$
2945
2946            matches all the documents on www.example.com whose name starts
2947            with /index.html.
2948
2949    www.example.com/index.html$
2950
2951            matches only the single document /index.html on www.example.com.
2952
2953    /index.html$
2954
2955            matches the document /index.html, regardless of the domain, i.e.
2956            on any web server anywhere.
2957
2958    index.html
2959
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.
2962
2963    --------------------------------------------------------------------------
2964
2965     8.4.1. The Domain Pattern
2966
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
2969    example:
2970
2971    .example.com
2972
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.
2977
2978    www.
2979
2980            matches any domain that STARTS with www. (It also matches the
2981            domain www but most of the time that doesn't matter.)
2982
2983    .example.
2984
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
2991            matched.
2992
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
3000    freely mixed:
3001
3002    ad*.example.com
3003
3004            matches "adserver.example.com", "ads.example.com", etc but not
3005            "sfads.example.com"
3006
3007    *ad*.example.com
3008
3009            matches all of the above, and then some.
3010
3011    .?pix.com
3012
3013            matches www.ipix.com, pictures.epix.com, a.b.c.d.e.upix.com etc.
3014
3015    www[1-9a-ez].example.c*
3016
3017            matches www1.example.com, www4.example.cc, wwwd.example.cy,
3018            wwwz.example.com etc., but not wwww.example.com.
3019
3020    While flexible, this is not the sophistication of full regular expression
3021    based syntax.
3022
3023    --------------------------------------------------------------------------
3024
3025     8.4.2. The Path Pattern
3026
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.
3030
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.
3036
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).
3040
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.
3045
3046    .example.com/.*
3047
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
3051
3052    .example.com/.*/index.html$
3053
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
3060            meta-character ".".
3061
3062    .example.com/(.*/)?index\.html$
3063
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!).
3068
3069    .example.com/(.*/)(ads|banners?|junk)
3070
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,
3074            just contain them.
3075
3076    .example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$
3077
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.
3081
3082    There are many, many good examples to be found in default.action, and more
3083    tutorials below in Appendix on regular expressions.
3084
3085    --------------------------------------------------------------------------
3086
3087     8.4.3. The Tag Pattern
3088
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.
3092
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).
3098
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.
3103
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.
3107
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.
3112
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.
3121
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
3124    much sense.
3125
3126    --------------------------------------------------------------------------
3127
3128   8.5. Actions
3129
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."
3136
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.
3142
3143    Actions fall into three categories:
3144
3145      * Boolean, i.e the action can only be "enabled" or "disabled". Syntax:
3146
3147          +name        # enable action name
3148          -name        # disable action name
3149
3150        Example: +block
3151
3152      * Parameterized, where some value is required in order to enable this
3153        type of action. Syntax:
3154
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
3158
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.
3162
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}
3165
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:
3172
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
3177
3178        Examples: +add-header{X-Fun-Header: Some text} and
3179        +filter{html-annoyances}
3180
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
3185    starting point).
3186
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.
3196
3197    The list of valid Privoxy actions are:
3198
3199    --------------------------------------------------------------------------
3200
3201       8.5.1. add-header
3202
3203    Typical use:
3204
3205            Confuse log analysis, custom applications
3206
3207    Effect:
3208
3209            Sends a user defined HTTP header to the web server.
3210
3211    Type:
3212
3213            Multi-value.
3214
3215    Parameter:
3216
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
3219            custom headers.
3220
3221    Notes:
3222
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.
3227
3228    Example usage:
3229
3230            +add-header{X-User-Tracking: sucks}
3231
3232    --------------------------------------------------------------------------
3233
3234       8.5.2. block
3235
3236    Typical use:
3237
3238            Block ads or other unwanted content
3239
3240    Effect:
3241
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.
3247
3248    Type:
3249
3250            Boolean.
3251
3252    Parameter:
3253
3254            N/A
3255
3256    Notes:
3257
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.
3266
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.
3272
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.
3276
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.
3282
3283    Example usage (section):
3284
3285            {+block}
3286            # Block and replace with "blocked" page
3287             .nasty-stuff.example.com
3288
3289            {+block +handle-as-image}
3290            # Block and replace with image
3291             .ad.doubleclick.net
3292             .ads.r.us/banners/
3293
3294            {+block +handle-as-empty-document}
3295            # Block and then ignore
3296             adserver.exampleclick.net/.*\.js$
3297
3298    --------------------------------------------------------------------------
3299
3300       8.5.3. client-header-filter
3301
3302    Typical use:
3303
3304            Rewrite or remove single client headers.
3305
3306    Effect:
3307
3308            All client headers to which this action applies are filtered
3309            on-the-fly through the specified regular expression based
3310            substitutions.
3311
3312    Type:
3313
3314            Parameterized.
3315
3316    Parameter:
3317
3318            The name of a client-header filter, as defined in one of the
3319            filter files.
3320
3321    Notes:
3322
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.
3327
3328            Client-header filters are executed after the other header actions
3329            have finished and use their output as input.
3330
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.
3335
3336            Please refer to the filter file chapter to learn which
3337            client-header filters are available by default, and how to create
3338            your own.
3339
3340    Example usage (section):
3341
3342            {+client-header-filter{hide-tor-exit-notation}}
3343            .exit/
3344
3345
3346    --------------------------------------------------------------------------
3347
3348       8.5.4. client-header-tagger
3349
3350    Typical use:
3351
3352            Block requests based on their headers.
3353
3354    Effect:
3355
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.
3359
3360    Type:
3361
3362            Parameterized.
3363
3364    Parameter:
3365
3366            The name of a client-header tagger, as defined in one of the
3367            filter files.
3368
3369    Notes:
3370
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.
3373
3374            Client-header taggers are the first actions that are executed and
3375            their tags can be used to control every other action.
3376
3377    Example usage (section):
3378
3379            # Tag every request with the User-Agent header
3380            {+client-header-tagger{user-agent}}
3381            /
3382
3383
3384    --------------------------------------------------------------------------
3385
3386       8.5.5. content-type-overwrite
3387
3388    Typical use:
3389
3390            Stop useless download menus from popping up, or change the
3391            browser's rendering mode
3392
3393    Effect:
3394
3395            Replaces the "Content-Type:" HTTP server header.
3396
3397    Type:
3398
3399            Parameterized.
3400
3401    Parameter:
3402
3403            Any string.
3404
3405    Notes:
3406
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
3411            by the browser.
3412
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.
3418
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.
3424
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.
3429
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
3434            circumventing it.
3435
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.
3440
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
3443            the same precision.
3444
3445    Example usage (sections):
3446
3447      # Check if www.example.net/ really uses valid XHTML
3448      { +content-type-overwrite{application/xml} }
3449      www.example.net/
3450
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
3455
3456    --------------------------------------------------------------------------
3457
3458       8.5.6. crunch-client-header
3459
3460    Typical use:
3461
3462            Remove a client header Privoxy has no dedicated action for.
3463
3464    Effect:
3465
3466            Deletes every header sent by the client that contains the string
3467            the user supplied as parameter.
3468
3469    Type:
3470
3471            Parameterized.
3472
3473    Parameter:
3474
3475            Any string.
3476
3477    Notes:
3478
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.
3482
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.
3486
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.
3490
3491            +---------------------------------------------------------+
3492            |                         Warning                         |
3493            |---------------------------------------------------------|
3494            | Don't block any header without understanding the        |
3495            | consequences.                                           |
3496            +---------------------------------------------------------+
3497
3498    Example usage (section):
3499
3500            # Block the non-existent "Privacy-Violation:" client header
3501            { +crunch-client-header{Privacy-Violation:} }
3502            /
3503
3504
3505    --------------------------------------------------------------------------
3506
3507       8.5.7. crunch-if-none-match
3508
3509    Typical use:
3510
3511            Prevent yet another way to track the user's steps between
3512            sessions.
3513
3514    Effect:
3515
3516            Deletes the "If-None-Match:" HTTP client header.
3517
3518    Type:
3519
3520            Boolean.
3521
3522    Parameter:
3523
3524            N/A
3525
3526    Notes:
3527
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.
3532
3533            It is also useful to make sure the header isn't used as a cookie
3534            replacement (unlikely but possible).
3535
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
3538            or missing as well.
3539
3540            It is recommended to use this action together with
3541            hide-if-modified-since and overwrite-last-modified.
3542
3543    Example usage (section):
3544
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}
3550            /
3551
3552    --------------------------------------------------------------------------
3553
3554       8.5.8. crunch-incoming-cookies
3555
3556    Typical use:
3557
3558            Prevent the web server from setting HTTP cookies on your system
3559
3560    Effect:
3561
3562            Deletes any "Set-Cookie:" HTTP headers from server replies.
3563
3564    Type:
3565
3566            Boolean.
3567
3568    Parameter:
3569
3570            N/A
3571
3572    Notes:
3573
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.
3577
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.
3581
3582    Example usage:
3583
3584            +crunch-incoming-cookies
3585
3586    --------------------------------------------------------------------------
3587
3588       8.5.9. crunch-server-header
3589
3590    Typical use:
3591
3592            Remove a server header Privoxy has no dedicated action for.
3593
3594    Effect:
3595
3596            Deletes every header sent by the server that contains the string
3597            the user supplied as parameter.
3598
3599    Type:
3600
3601            Parameterized.
3602
3603    Parameter:
3604
3605            Any string.
3606
3607    Notes:
3608
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.
3612
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.
3616
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.
3620
3621            +---------------------------------------------------------+
3622            |                         Warning                         |
3623            |---------------------------------------------------------|
3624            | Don't block any header without understanding the        |
3625            | consequences.                                           |
3626            +---------------------------------------------------------+
3627
3628    Example usage (section):
3629
3630            # Crunch server headers that try to prevent caching
3631            { +crunch-server-header{no-cache} }
3632            /
3633
3634    --------------------------------------------------------------------------
3635
3636       8.5.10. crunch-outgoing-cookies
3637
3638    Typical use:
3639
3640            Prevent the web server from reading any HTTP cookies from your
3641            system
3642
3643    Effect:
3644
3645            Deletes any "Cookie:" HTTP headers from client requests.
3646
3647    Type:
3648
3649            Boolean.
3650
3651    Parameter:
3652
3653            N/A
3654
3655    Notes:
3656
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.
3660
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.
3664
3665    Example usage:
3666
3667            +crunch-outgoing-cookies
3668
3669    --------------------------------------------------------------------------
3670
3671       8.5.11. deanimate-gifs
3672
3673    Typical use:
3674
3675            Stop those annoying, distracting animated GIF images.
3676
3677    Effect:
3678
3679            De-animate GIF animations, i.e. reduce them to their first or last
3680            image.
3681
3682    Type:
3683
3684            Parameterized.
3685
3686    Parameter:
3687
3688            "last" or "first"
3689
3690    Notes:
3691
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
3698            frame).
3699
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.
3703
3704    Example usage:
3705
3706            +deanimate-gifs{last}
3707
3708    --------------------------------------------------------------------------
3709
3710       8.5.12. downgrade-http-version
3711
3712    Typical use:
3713
3714            Work around (very rare) problems with HTTP/1.1
3715
3716    Effect:
3717
3718            Downgrades HTTP/1.1 client requests and server replies to
3719            HTTP/1.0.
3720
3721    Type:
3722
3723            Boolean.
3724
3725    Parameter:
3726
3727            N/A
3728
3729    Notes:
3730
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.
3736
3737    Example usage (section):
3738
3739            {+downgrade-http-version}
3740            problem-host.example.com
3741
3742    --------------------------------------------------------------------------
3743
3744       8.5.13. fast-redirects
3745
3746    Typical use:
3747
3748            Fool some click-tracking scripts and speed up indirect links.
3749
3750    Effect:
3751
3752            Detects redirection URLs and redirects the browser without
3753            contacting the redirection server first.
3754
3755    Type:
3756
3757            Parameterized.
3758
3759    Parameter:
3760
3761               * "simple-check" to just search for the string "http://" to
3762                 detect redirection URLs.
3763
3764               * "check-decoded-url" to decode URLs (if necessary) before
3765                 searching for redirection URLs.
3766
3767    Notes:
3768
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
3773            look like:
3774            "http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/".
3775
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.
3782
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
3786            ways:
3787
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.
3795
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.
3806
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
3813            logged.
3814
3815    Example usage:
3816
3817             { +fast-redirects{simple-check} }
3818               one.example.com
3819
3820             { +fast-redirects{check-decoded-url} }
3821               another.example.com/testing
3822
3823    --------------------------------------------------------------------------
3824
3825       8.5.14. filter
3826
3827    Typical use:
3828
3829            Get rid of HTML and JavaScript annoyances, banner advertisements
3830            (by size), do fun text replacements, add personalized effects,
3831            etc.
3832
3833    Effect:
3834
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.)
3841
3842    Type:
3843
3844            Parameterized.
3845
3846    Parameter:
3847
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.
3853
3854            When used in its negative form, and without parameters, all
3855            filtering is completely disabled.
3856
3857    Notes:
3858
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.
3862
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.
3868
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.
3873
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.
3878
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
3885            exceptions.
3886
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
3890            it.
3891
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.
3896
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.
3902
3903            Feedback with suggestions for new or improved filters is
3904            particularly welcome!
3905
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.
3909
3910    Example usage (with filters from the distribution default.filter file).
3911    See the Predefined Filters section for more explanation on each:
3912
3913 +filter{js-annoyances}       # Get rid of particularly annoying JavaScript abuse
3914
3915 +filter{js-events}           # Kill all JS event bindings (Radically destructive! Only for extra nasty sites)
3916
3917       +filter{html-annoyances}     # Get rid of particularly annoying HTML abuse
3918
3919  +filter{content-cookies}     # Kill cookies that come in the HTML or JS content
3920
3921 +filter{refresh-tags}        # Kill automatic refresh tags (for dial-on-demand setups)
3922
3923 +filter{unsolicited-popups}  # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.
3924
3925 +filter{all-popups}          # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.
3926
3927 +filter{img-reorder}         # Reorder attributes in <img> tags to make the banners-by-* filters more effective
3928
3929            +filter{banners-by-size}     # Kill banners by size
3930
3931 +filter{banners-by-link}     # Kill banners by their links to known clicktrackers
3932
3933 +filter{webbugs}             # Squish WebBugs (1x1 invisible GIFs used for user tracking)
3934
3935 +filter{tiny-textforms}      # Extend those tiny textareas up to 40x80 and kill the hard wrap
3936
3937 +filter{jumping-windows}     # Prevent windows from resizing and moving themselves
3938
3939     +filter{frameset-borders}    # Give frames a border and make them resizeable
3940
3941    +filter{demoronizer}         # Fix MS's non-standard use of standard charsets
3942
3943            +filter{shockwave-flash}     # Kill embedded Shockwave Flash objects
3944
3945            +filter{quicktime-kioskmode} # Make Quicktime movies savable
3946
3947    +filter{fun}                 # Text replacements for subversive browsing fun!
3948
3949            +filter{crude-parental}      # Crude parental filtering (demo only)
3950
3951    +filter{ie-exploits}         # Disable a known Internet Explorer bug exploits
3952
3953 +filter{site-specifics}      # Custom filters for specific site related problems
3954
3955 +filter{google}              # Removes text ads and other Google specific improvements
3956
3957 +filter{yahoo}               # Removes text ads and other Yahoo specific improvements
3958
3959 +filter{msn}                 # Removes text ads and other MSN specific improvements
3960
3961            +filter{blogspot}            # Cleans up Blogspot blogs
3962
3963 +filter{no-ping}             # Removes non-standard ping attributes from anchor and area tags
3964
3965    --------------------------------------------------------------------------
3966
3967       8.5.15. force-text-mode
3968
3969    Typical use:
3970
3971            Force Privoxy to treat a document as if it was in some kind of
3972            text format.
3973
3974    Effect:
3975
3976            Declares a document as text, even if the "Content-Type:" isn't
3977            detected as such.
3978
3979    Type:
3980
3981            Boolean.
3982
3983    Parameter:
3984
3985            N/A
3986
3987    Notes:
3988
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.
3993
3994            +---------------------------------------------------------+
3995            |                         Warning                         |
3996            |---------------------------------------------------------|
3997            | Think twice before activating this action. Filtering    |
3998            | binary data with regular expressions can cause file     |
3999            | damage.                                                 |
4000            +---------------------------------------------------------+
4001
4002    Example usage:
4003
4004            +force-text-mode
4005
4006
4007    --------------------------------------------------------------------------
4008
4009       8.5.16. forward-override
4010
4011    Typical use:
4012
4013            Change the forwarding settings based on User-Agent or request
4014            origin
4015
4016    Effect:
4017
4018            Overrules the forward directives in the configuration file.
4019
4020    Type:
4021
4022            Multi-value.
4023
4024    Parameter:
4025
4026               * "forward ." to use a direct connection without any additional
4027                 proxies.
4028
4029               * "forward 127.0.0.1:8123" to use the HTTP proxy listening at
4030                 127.0.0.1 port 8123.
4031
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.
4036
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.
4042
4043    Notes:
4044
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.
4049
4050            +---------------------------------------------------------+
4051            |                         Warning                         |
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.                   |
4057            |                                                         |
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.                                        |
4062            |                                                         |
4063            | Use the show-url-info CGI page to verify that your      |
4064            | forward settings do what you thought the do.            |
4065            +---------------------------------------------------------+
4066
4067    Example usage:
4068
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     \
4080            }
4081            TAG:^User-Agent: fetch libfetch/2\.0$
4082
4083
4084    --------------------------------------------------------------------------
4085
4086       8.5.17. handle-as-empty-document
4087
4088    Typical use:
4089
4090            Mark URLs that should be replaced by empty documents if they get
4091            blocked
4092
4093    Effect:
4094
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.
4101
4102    Type:
4103
4104            Boolean.
4105
4106    Parameter:
4107
4108            N/A
4109
4110    Notes:
4111
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.
4116
4117            The content type for the empty document can be specified with
4118            content-type-overwrite{}, but usually this isn't necessary.
4119
4120    Example usage:
4121
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}
4125            example.org/.*\.js$
4126
4127
4128    --------------------------------------------------------------------------
4129
4130       8.5.18. handle-as-image
4131
4132    Typical use:
4133
4134            Mark URLs as belonging to images (so they'll be replaced by images
4135            if they do get blocked, rather than HTML pages)
4136
4137    Effect:
4138
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
4144            content.
4145
4146    Type:
4147
4148            Boolean.
4149
4150    Parameter:
4151
4152            N/A
4153
4154    Notes:
4155
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.
4159
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.
4163
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
4168            error messages.
4169
4170    Example usage (sections):
4171
4172            # Generic image extensions:
4173            #
4174            {+handle-as-image}
4175            /.*\.(gif|jpg|jpeg|png|bmp|ico)$
4176
4177            # These don't look like images, but they're banners and should be
4178            # blocked as images:
4179            #
4180            {+block +handle-as-image}
4181            some.nasty-banner-server.com/junk.cgi\?output=trash
4182
4183            # Banner source! Who cares if they also have non-image content?
4184            ad.doubleclick.net
4185
4186    --------------------------------------------------------------------------
4187
4188       8.5.19. hide-accept-language
4189
4190    Typical use:
4191
4192            Pretend to use different language settings.
4193
4194    Effect:
4195
4196            Deletes or replaces the "Accept-Language:" HTTP header in client
4197            requests.
4198
4199    Type:
4200
4201            Parameterized.
4202
4203    Parameter:
4204
4205            Keyword: "block", or any user defined value.
4206
4207    Notes:
4208
4209            Faking the browser's language settings can be useful to make a
4210            foreign User-Agent set with hide-user-agent more believable.
4211
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.
4216
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.
4220
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.
4225
4226    Example usage (section):
4227
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} \
4231 }
4232 /
4233
4234    --------------------------------------------------------------------------
4235
4236       8.5.20. hide-content-disposition
4237
4238    Typical use:
4239
4240            Prevent download menus for content you prefer to view inside the
4241            browser.
4242
4243    Effect:
4244
4245            Deletes or replaces the "Content-Disposition:" HTTP header set by
4246            some servers.
4247
4248    Type:
4249
4250            Parameterized.
4251
4252    Parameter:
4253
4254            Keyword: "block", or any user defined value.
4255
4256    Notes:
4257
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.
4262
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.
4266
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
4272            download menus.
4273
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
4276            up.
4277
4278            This action will probably be removed in the future, use
4279            server-header filters instead.
4280
4281    Example usage:
4282
4283            # Disarm the download link in Sourceforge's patch tracker
4284            { -filter \
4285             +content-type-overwrite{text/plain}\
4286             +hide-content-disposition{block} }
4287             .sourceforge.net/tracker/download\.php
4288
4289    --------------------------------------------------------------------------
4290
4291       8.5.21. hide-if-modified-since
4292
4293    Typical use:
4294
4295            Prevent yet another way to track the user's steps between
4296            sessions.
4297
4298    Effect:
4299
4300            Deletes the "If-Modified-Since:" HTTP client header or modifies
4301            its value.
4302
4303    Type:
4304
4305            Parameterized.
4306
4307    Parameter:
4308
4309            Keyword: "block", or a user defined value that specifies a range
4310            of hours.
4311
4312    Notes:
4313
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.
4317
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.
4323
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
4327            high.
4328
4329            It is a good idea to only use a small negative value and let
4330            overwrite-last-modified handle the greater changes.
4331
4332            It is also recommended to use this action together with
4333            crunch-if-none-match, otherwise it's more or less pointless.
4334
4335    Example usage (section):
4336
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}
4341    /
4342
4343    --------------------------------------------------------------------------
4344
4345       8.5.22. hide-forwarded-for-headers
4346
4347    Typical use:
4348
4349            Improve privacy by not forwarding the source of the request in the
4350            HTTP headers.
4351
4352    Effect:
4353
4354            Deletes any existing "X-Forwarded-for:" HTTP header from client
4355            requests.
4356
4357    Type:
4358
4359            Boolean.
4360
4361    Parameter:
4362
4363            N/A
4364
4365    Notes:
4366
4367            It is safe and recommended to leave this on.
4368
4369    Example usage:
4370
4371            +hide-forwarded-for-headers
4372
4373    --------------------------------------------------------------------------
4374
4375       8.5.23. hide-from-header
4376
4377    Typical use:
4378
4379            Keep your (old and ill) browser from telling web servers your
4380            email address
4381
4382    Effect:
4383
4384            Deletes any existing "From:" HTTP header, or replaces it with the
4385            specified string.
4386
4387    Type:
4388
4389            Parameterized.
4390
4391    Parameter:
4392
4393            Keyword: "block", or any user defined value.
4394
4395    Notes:
4396
4397            The keyword "block" will completely remove the header (not to be
4398            confused with the block action).
4399
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.
4403
4404            This action is rarely needed, as modern web browsers don't send
4405            "From:" headers anymore.
4406
4407    Example usage:
4408
4409            +hide-from-header{block}
4410
4411            or
4412
4413            +hide-from-header{spam-me-senseless@sittingduck.example.com}
4414
4415    --------------------------------------------------------------------------
4416
4417       8.5.24. hide-referrer
4418
4419    Typical use:
4420
4421            Conceal which link you followed to get to a particular site
4422
4423    Effect:
4424
4425            Deletes the "Referer:" (sic) HTTP header from the client request,
4426            or replaces it with a forged one.
4427
4428    Type:
4429
4430            Parameterized.
4431
4432    Parameter:
4433
4434               * "conditional-block" to delete the header completely if the
4435                 host has changed.
4436
4437               * "conditional-forge" to forge the header if the host has
4438                 changed.
4439
4440               * "block" to delete the header unconditionally.
4441
4442               * "forge" to pretend to be coming from the homepage of the
4443                 server we are talking to.
4444
4445               * Any other string to set a user defined referrer.
4446
4447    Notes:
4448
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
4452            address directly.
4453
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.
4460
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.
4465
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.
4469
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".)
4474
4475    Example usage:
4476
4477            +hide-referrer{forge}
4478
4479            or
4480
4481            +hide-referrer{http://www.yahoo.com/}
4482
4483    --------------------------------------------------------------------------
4484
4485       8.5.25. hide-user-agent
4486
4487    Typical use:
4488
4489            Try to conceal your type of browser and client operating system
4490
4491    Effect:
4492
4493            Replaces the value of the "User-Agent:" HTTP header in client
4494            requests with the specified value.
4495
4496    Type:
4497
4498            Parameterized.
4499
4500    Parameter:
4501
4502            Any user-defined string.
4503
4504    Notes:
4505
4506            +---------------------------------------------------------+
4507            |                         Warning                         |
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            +---------------------------------------------------------+
4515
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 :-).
4526
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.
4530
4531    Example usage:
4532
4533            +hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}
4534
4535    --------------------------------------------------------------------------
4536
4537       8.5.26. inspect-jpegs
4538
4539    Typical use:
4540
4541            Try to protect against a MS buffer over-run in JPEG processing
4542
4543    Effect:
4544
4545            Protect against a known exploit
4546
4547    Type:
4548
4549            Boolean.
4550
4551    Parameter:
4552
4553            N/A
4554
4555    Notes:
4556
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.
4564
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.
4568
4569    Example usage:
4570
4571            +inspect-jpegs
4572
4573    --------------------------------------------------------------------------
4574
4575       8.5.27. kill-popups
4576
4577    Typical use:
4578
4579            Eliminate those annoying pop-up windows (deprecated)
4580
4581    Effect:
4582
4583            While loading the document, replace JavaScript code that opens
4584            pop-up windows with (syntactically neutral) dummy code on the fly.
4585
4586    Type:
4587
4588            Boolean.
4589
4590    Parameter:
4591
4592            N/A
4593
4594    Notes:
4595
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.
4602
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.
4609
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
4613            the unwanted ones.
4614
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.
4618
4619            This action is most appropriate for browsers that don't have any
4620            controls for unwanted pop-ups. Not recommended for general usage.
4621
4622            This action doesn't work very reliable and may be removed in
4623            future releases.
4624
4625    Example usage:
4626
4627            +kill-popups
4628
4629    --------------------------------------------------------------------------
4630
4631       8.5.28. limit-connect
4632
4633    Typical use:
4634
4635            Prevent abuse of Privoxy as a TCP proxy relay or disable SSL for
4636            untrusted sites
4637
4638    Effect:
4639
4640            Specifies to which ports HTTP CONNECT requests are allowable.
4641
4642    Type:
4643
4644            Parameterized.
4645
4646    Parameter:
4647
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).
4650
4651    Notes:
4652
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.
4657
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
4663            relays very easily.
4664
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.
4671
4672    Example usages:
4673
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
4679
4680    --------------------------------------------------------------------------
4681
4682       8.5.29. prevent-compression
4683
4684    Typical use:
4685
4686            Ensure that servers send the content uncompressed, so it can be
4687            passed through filters.
4688
4689    Effect:
4690
4691            Removes the Accept-Encoding header which can be used to ask for
4692            compressed transfer.
4693
4694    Type:
4695
4696            Boolean.
4697
4698    Parameter:
4699
4700            N/A
4701
4702    Notes:
4703
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
4707            uncompressed data.
4708
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.
4715
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.
4719
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.
4723
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.
4730
4731    Example usage (sections):
4732
4733            # Selectively turn off compression, and enable a filter
4734            #
4735            { +filter{tiny-textforms} +prevent-compression }
4736            # Match only these sites
4737             .google.
4738             sourceforge.net
4739             sf.net
4740
4741            # Or instead, we could set a universal default:
4742            #
4743            { +prevent-compression }
4744             / # Match all sites
4745
4746            # Then maybe make exceptions for broken sites:
4747            #
4748            { -prevent-compression }
4749            .compusa.com/
4750
4751    --------------------------------------------------------------------------
4752
4753       8.5.30. overwrite-last-modified
4754
4755    Typical use:
4756
4757            Prevent yet another way to track the user's steps between
4758            sessions.
4759
4760    Effect:
4761
4762            Deletes the "Last-Modified:" HTTP server header or modifies its
4763            value.
4764
4765    Type:
4766
4767            Parameterized.
4768
4769    Parameter:
4770
4771            One of the keywords: "block", "reset-to-request-time" and
4772            "randomize"
4773
4774    Notes:
4775
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
4779            of the page.
4780
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.
4787
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
4791            your random range.
4792
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.
4799
4800            It is also recommended to use this action together with
4801            crunch-if-none-match.
4802
4803    Example usage:
4804
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}
4809            /
4810
4811    --------------------------------------------------------------------------
4812
4813       8.5.31. redirect
4814
4815    Typical use:
4816
4817            Redirect requests to other sites.
4818
4819    Effect:
4820
4821            Convinces the browser that the requested document has been moved
4822            to another location and the browser should get it from there.
4823
4824    Type:
4825
4826            Parameterized
4827
4828    Parameter:
4829
4830            An absolute URL or a single pcrs command.
4831
4832    Notes:
4833
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
4837            original URL.
4838
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.
4842
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.
4846
4847    Example usages:
4848
4849            # Replace example.com's style sheet with another one
4850            { +redirect{http://localhost/css-replacements/example.com.css} }
4851             example.com/stylesheet\.css
4852
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} }
4856             a
4857
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*$
4863
4864    --------------------------------------------------------------------------
4865
4866       8.5.32. send-vanilla-wafer
4867
4868    Typical use:
4869
4870            Feed log analysis scripts with useless data.
4871
4872    Effect:
4873
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
4876            not to track you.
4877
4878    Type:
4879
4880            Boolean.
4881
4882    Parameter:
4883
4884            N/A
4885
4886    Notes:
4887
4888            The vanilla wafer is a (relatively) unique header and could
4889            conceivably be used to track you.
4890
4891            This action is rarely used and not enabled in the default
4892            configuration.
4893
4894    Example usage:
4895
4896            +send-vanilla-wafer
4897
4898    --------------------------------------------------------------------------
4899
4900       8.5.33. send-wafer
4901
4902    Typical use:
4903
4904            Send custom cookies or feed log analysis scripts with even more
4905            useless data.
4906
4907    Effect:
4908
4909            Sends a custom, user-defined cookie with each request.
4910
4911    Type:
4912
4913            Multi-value.
4914
4915    Parameter:
4916
4917            A string of the form "name=value".
4918
4919    Notes:
4920
4921            Being multi-valued, multiple instances of this action can apply to
4922            the same request, resulting in multiple cookies being sent.
4923
4924            This action is rarely used and not enabled in the default
4925            configuration.
4926
4927    Example usage (section):
4928
4929            {+send-wafer{UsingPrivoxy=true}}
4930            my-internal-testing-server.void
4931
4932    --------------------------------------------------------------------------
4933
4934       8.5.34. server-header-filter
4935
4936    Typical use:
4937
4938            Rewrite or remove single server headers.
4939
4940    Effect:
4941
4942            All server headers to which this action applies are filtered
4943            on-the-fly through the specified regular expression based
4944            substitutions.
4945
4946    Type:
4947
4948            Parameterized.
4949
4950    Parameter:
4951
4952            The name of a server-header filter, as defined in one of the
4953            filter files.
4954
4955    Notes:
4956
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.
4961
4962            Server-header filters are executed after the other header actions
4963            have finished and use their output as input.
4964
4965            Please refer to the filter file chapter to learn which
4966            server-header filters are available by default, and how to create
4967            your own.
4968
4969    Example usage (section):
4970
4971            {+server-header-filter{html-to-xml}}
4972            example.org/xml-instance-that-is-delivered-as-html
4973
4974            {+server-header-filter{xml-to-html}}
4975            example.org/instance-that-is-delivered-as-xml-but-is-not
4976
4977
4978    --------------------------------------------------------------------------
4979
4980       8.5.35. server-header-tagger
4981
4982    Typical use:
4983
4984            Enable or disable filters based on the Content-Type header.
4985
4986    Effect:
4987
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.
4991
4992    Type:
4993
4994            Parameterized.
4995
4996    Parameter:
4997
4998            The name of a server-header tagger, as defined in one of the
4999            filter files.
5000
5001    Notes:
5002
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.
5005
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).
5010
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
5013            file.
5014
5015    Example usage (section):
5016
5017            # Tag every request with the content type declared by the server
5018            {+server-header-tagger{content-type}}
5019            /
5020
5021
5022    --------------------------------------------------------------------------
5023
5024       8.5.36. session-cookies-only
5025
5026    Typical use:
5027
5028            Allow only temporary "session" cookies (for the current browser
5029            session only).
5030
5031    Effect:
5032
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.
5036
5037    Type:
5038
5039            Boolean.
5040
5041    Parameter:
5042
5043            N/A
5044
5045    Notes:
5046
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
5050            privacy too badly.
5051
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.
5058
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.
5062
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.
5066
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.
5070
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.
5074
5075    Example usage:
5076
5077            +session-cookies-only
5078
5079    --------------------------------------------------------------------------
5080
5081       8.5.37. set-image-blocker
5082
5083    Typical use:
5084
5085            Choose the replacement for blocked images
5086
5087    Effect:
5088
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.
5093
5094    Type:
5095
5096            Parameterized.
5097
5098    Parameter:
5099
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.
5103
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.
5109
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).
5114
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.
5121
5122    Notes:
5123
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".
5127
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.
5132
5133    Example usage:
5134
5135            Built-in pattern:
5136
5137            +set-image-blocker{pattern}
5138
5139            Redirect to the BSD daemon:
5140
5141            +set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}
5142
5143            Redirect to the built-in pattern for better caching:
5144
5145           +set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}
5146
5147    --------------------------------------------------------------------------
5148
5149       8.5.38. treat-forbidden-connects-like-blocks
5150
5151    Typical use:
5152
5153            Block forbidden connects with an easy to find error message.
5154
5155    Effect:
5156
5157            If this action is enabled, Privoxy no longer makes a difference
5158            between forbidden connects and ordinary blocks.
5159
5160    Type:
5161
5162            Boolean
5163
5164    Parameter:
5165
5166            N/A
5167
5168    Notes:
5169
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.
5173
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
5177            "See why" link.
5178
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
5182            suppressed.
5183
5184    Example usage:
5185
5186            +treat-forbidden-connects-like-blocks
5187
5188    --------------------------------------------------------------------------
5189
5190     8.5.39. Summary
5191
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.
5198
5199    --------------------------------------------------------------------------
5200
5201   8.6. Aliases
5202
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.
5210
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.
5215
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.
5223
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.
5229
5230    Now let's define some aliases...
5231
5232  # Useful custom aliases we can use later.
5233  #
5234  # Note the (required!) section header line and that this section
5235  # must be at the top of the actions file!
5236  #
5237  {{alias}}
5238
5239  # These aliases just save typing later:
5240  # (Note that some already use other aliases!)
5241  #
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}
5246
5247  # These aliases define combinations of actions
5248  # that are useful for certain types of sites:
5249  #
5250  fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -kill-popups -prevent-compression
5251
5252  shop        = -crunch-all-cookies -filter{all-popups} -kill-popups
5253
5254  # Short names for other aliases, for really lazy people ;-)
5255  #
5256  c0 = +crunch-all-cookies
5257  c1 = -crunch-all-cookies
5258
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):
5262
5263     # These sites are either very complex or very keen on
5264     # user data and require minimal interference to work:
5265     #
5266     {fragile}
5267     .office.microsoft.com
5268     .windowsupdate.microsoft.com
5269     # Gmail is really mail.google.com, not gmail.com
5270     mail.google.com
5271
5272     # Shopping sites:
5273     # Allow cookies (for setting and retrieving your customer data)
5274     #
5275     {shop}
5276     .quietpc.com
5277     .worldpay.com   # for quietpc.com
5278     mybank.example.com
5279
5280     # These shops require pop-ups:
5281     #
5282     {-kill-popups -filter{all-popups} -filter{unsolicited-popups}}
5283      .dabs.com
5284      .overclockers.co.uk
5285
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
5288    properly.
5289
5290    --------------------------------------------------------------------------
5291
5292   8.7. Actions Files Tutorial
5293
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
5298    together:
5299
5300    --------------------------------------------------------------------------
5301
5302     8.7.1. default.action
5303
5304    Every config file should start with a short comment stating its purpose:
5305
5306    # Sample default.action file <ijbswa-developers@lists.sourceforge.net>
5307
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:
5310
5311    ##########################################################################
5312    # Settings -- Don't change! For internal Privoxy use ONLY.
5313    ##########################################################################
5314
5315    {{settings}}
5316    for-privoxy-version=3.0
5317
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
5320    aliases are used:
5321
5322 ##########################################################################
5323 # Aliases
5324 ##########################################################################
5325 {{alias}}
5326
5327  # These aliases just save typing later:
5328  # (Note that some already use other aliases!)
5329  #
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}
5334
5335  # These aliases define combinations of actions
5336  # that are useful for certain types of sites:
5337  #
5338  fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -kill-popups
5339  shop        = -crunch-all-cookies -filter{all-popups} -kill-popups
5340
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.
5344
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.
5351
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
5356    continuation.
5357
5358    ##########################################################################
5359    # "Defaults" section:
5360    ##########################################################################
5361     { \
5362     +deanimate-gifs \
5363     +filter{html-annoyances} \
5364     +filter{refresh-tags} \
5365     +filter{webbugs} \
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} \
5373     }
5374     / # forward slash will match *all* potential URL patterns.
5375
5376    The default behavior is now set.
5377
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
5383    explicitly:
5384
5385    ##########################################################################
5386    # Exceptions for sites that'll break under the default action set:
5387    ##########################################################################
5388
5389    # "Fragile" Use a minimum set of actions for these sites (see alias above):
5390    #
5391    { fragile }
5392    .office.microsoft.com           # surprise, surprise!
5393    .windowsupdate.microsoft.com
5394    mail.google.com
5395
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:
5399
5400    # Shopping sites:
5401    #
5402    { shop }
5403    .quietpc.com
5404    .worldpay.com   # for quietpc.com
5405    .jungle.com
5406    .scan.co.uk
5407
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:
5410
5411    { -fast-redirects }
5412    login.yahoo.com
5413    edit.*.yahoo.com
5414    .google.com
5415    .altavista.com/.*(like|url|link):http
5416    .altavista.com/trans.*urltext=http
5417    .nytimes.com
5418
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:
5426
5427    ##########################################################################
5428    # Images:
5429    ##########################################################################
5430
5431    # Define which file types will be treated as images, in case they get
5432    # blocked further down this file:
5433    #
5434    { +handle-as-image }
5435    /.*\.(gif|jpe?g|png|bmp|ico)$
5436
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
5445    repeated:
5446
5447    # Known ad generators:
5448    #
5449    { +block-as-image }
5450    ar.atwola.com
5451    .ad.doubleclick.net
5452    .ad.*.doubleclick.net
5453    .a.yimg.com/(?:(?!/i/).)*$
5454    .a[0-9].yimg.com/(?:(?!/i/).)*$
5455    bs*.gsanet.com
5456    .qkimg.net
5457
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
5465    action to them.
5466
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
5470    example short:
5471
5472    ##########################################################################
5473    # Block these fine banners:
5474    ##########################################################################
5475    { +block }
5476
5477    # Generic patterns:
5478    #
5479    ad*.
5480    .*ads.
5481    banner?.
5482    count*.
5483    /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
5484    /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
5485
5486    # Site-specific patterns (abbreviated):
5487    #
5488    .hitbox.com
5489
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
5493    effective.
5494
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.
5500
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.
5509
5510    ##########################################################################
5511    # Save some innocent victims of the above generic block patterns:
5512    ##########################################################################
5513
5514    # By domain:
5515    #
5516    { -block }
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)
5523
5524    # By path:
5525    #
5526    /.*loads/
5527
5528    # Site-specific:
5529    #
5530    www.globalintersec.com/adv # (adv = advanced)
5531    www.ugu.com/sui/ugu/adv
5532
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!
5536
5537    # Don't filter code!
5538    #
5539    { -filter }
5540    /(.*/)?cvs
5541    bugzilla.
5542    developer.
5543    wiki.
5544    .sourceforge.net
5545
5546    The actual default.action is of course much more comprehensive, but we
5547    hope this example made clear how it works.
5548
5549    --------------------------------------------------------------------------
5550
5551     8.7.2. user.action
5552
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.
5563
5564    So let's look at a few examples of things that one might typically do in
5565    user.action:
5566
5567    # My user.action file. <fred@example.com>
5568
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:
5571
5572 # Aliases are local to the file they are defined in.
5573 # (Re-)define aliases for this file:
5574 #
5575 {{alias}}
5576 #
5577 # These aliases just save typing later, and the alias names should
5578 # be self explanatory.
5579 #
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
5586
5587 # These aliases define combinations of actions that are useful for
5588 # certain types of sites:
5589 #
5590 fragile     = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer -kill-popups
5591 shop        = -crunch-all-cookies allow-popups
5592
5593 # Allow ads for selected useful free sites:
5594 #
5595 allow-ads   = -block -filter{banners-by-size} -filter{banners-by-link}
5596
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
5600
5601
5602
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.
5608
5609    { allow-all-cookies }
5610     sourceforge.net
5611     .yahoo.com
5612     .msdn.microsoft.com
5613     .redhat.com
5614
5615    Your bank is allergic to some filter, but you don't know which, so you
5616    disable them all:
5617
5618    { -filter }
5619     .your-home-banking-site.com
5620
5621    Some file types you may not want to filter for various reasons:
5622
5623    # Technical documentation is likely to contain strings that might
5624    # erroneously get altered by the JavaScript-oriented filters:
5625    #
5626    .tldp.org
5627    /(.*/)?selfhtml/
5628
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:
5631    #
5632    stupid-server.example.com/
5633
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
5640    anyway:
5641
5642    { +block }
5643     www.example.com/nasty-ads/sponsor\.gif
5644     another.example.net/more/junk/here/
5645
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.
5652    Use cautiously.
5653
5654    { +block-as-image }
5655     .doubleclick.net
5656     .fastclick.net
5657     /Realmedia/ads/
5658     ar.atwola.com/
5659
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:
5668
5669    { fragile }
5670     .forbes.com
5671     webmail.example.com
5672     .mybank.com
5673
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:
5677
5678    { +filter{fun} }
5679     / # For ALL sites!
5680
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.
5685
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:
5690
5691    { allow-ads }
5692     .sourceforge.net
5693     .slashdot.org
5694     .osdn.net
5695
5696    Note that allow-ads has been aliased to -block, -filter{banners-by-size},
5697    and -filter{banners-by-link} above.
5698
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
5702    choose to.
5703
5704    { handle-as-text }
5705     /.*\.sh$
5706
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:
5712
5713    { +set-image-blocker{blank} }
5714    / # ALL sites
5715
5716    --------------------------------------------------------------------------
5717
5718 9. Filter Files
5719
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".
5722
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.
5727
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
5733    with tag-patterns.
5734
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.
5739
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.
5745
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
5749    content.
5750
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.
5754
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.
5763
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.
5766
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:
5770
5771    FILTER: foo Replace all "foo" with "bar"
5772
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
5779    ungreedy matching.
5780
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.
5785
5786    --------------------------------------------------------------------------
5787
5788   9.1. Filter File Tutorial
5789
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:
5793
5794    s/foo/bar/
5795
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:
5799
5800    s/foo/bar/g
5801
5802    Our complete filter now looks like this:
5803
5804    FILTER: foo Replace all "foo" with "bar"
5805    s/foo/bar/g
5806
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:
5810
5811 FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse
5812
5813 # Get rid of JavaScript referrer tracking. Test page: http://www.randomoddness.com/untitled.htm
5814 #
5815 s|(<script.*)document\.referrer(.*</script>)|$1"Not Your Business!"$2|Usg
5816
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
5820    (\).
5821
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.
5827
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).
5835
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.
5841
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.
5852
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.
5858
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!".
5865
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.
5871
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:
5874
5875    # The status bar is for displaying link targets, not pointless blahblah
5876    #
5877    s/window\.status\s*=\s*(['"]).*?\1/dUmMy=1/ig
5878
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.
5886
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.
5893
5894 # Kill OnUnload popups. Yummy. Test: http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html
5895 #
5896 s/(<body [^>]*)onunload(.*>)/$1never$2/iU
5897
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.
5906
5907    The last example is from the fun department:
5908
5909    FILTER: fun Fun text replacements
5910
5911    # Spice the daily news:
5912    #
5913    s/microsoft(?!\.com)/MicroSuck/ig
5914
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.
5919
5920    # Buzzword Bingo (example for extended regex syntax)
5921    #
5922    s* industry[ -]leading \
5923    |  cutting[ -]edge \
5924    |  customer[ -]focused \
5925    |  market[ -]driven \
5926    |  award[ -]winning # Comments are OK, too! \
5927    |  high[ -]performance \
5928    |  solutions[ -]based \
5929    |  unmatched \
5930    |  unparalleled \
5931    |  unrivalled \
5932    *<font color="red"><b>BINGO!</b></font> \
5933    *igx
5934
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.
5937
5938    You get the idea?
5939
5940    --------------------------------------------------------------------------
5941
5942   9.2. The Pre-defined Filters
5943
5944    The distribution default.filter file contains a selection of pre-defined
5945    filters for your convenience:
5946
5947    js-annoyances
5948
5949            The purpose of this filter is to get rid of particularly annoying
5950            JavaScript abuse. To that end, it
5951
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.
5955
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
5959                 another one.
5960
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.
5964
5965            Use with caution. This is an aggressive filter, and can break
5966            sites that rely heavily on JavaScript.
5967
5968    js-events
5969
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!
5974
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).
5978
5979    html-annoyances
5980
5981            This filter will undo many common instances of HTML based abuse.
5982
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.
5987
5988    content-cookies
5989
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.
5995
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.
6000
6001    refresh tags
6002
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.
6007
6008    unsolicited-popups
6009
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.
6014
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.
6019
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.
6023
6024    all-popups
6025
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.
6030
6031    img-reorder
6032
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.
6036
6037    banners-by-size
6038
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.
6043
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
6046            sizes.
6047
6048            Recommended only for those who require extreme ad blocking. The
6049            default block rules should catch 95+% of all ads without this
6050            filter enabled.
6051
6052    banners-by-link
6053
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
6057            by default.
6058
6059    webbugs
6060
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
6069            addresses.
6070
6071            This filter removes the HTML code that loads such "webbugs".
6072
6073    tiny-textforms
6074
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.
6080
6081            It is not recommended to use this filter as a default.
6082
6083    jumping-windows
6084
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.
6089
6090    frameset-borders
6091
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
6097            whole content.
6098
6099            This filter removes the related HTML code. It should only be
6100            applied to sites which need it.
6101
6102    demoronizer
6103
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.
6108
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.
6115
6116    shockwave-flash
6117
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
6120            objects.
6121
6122    quicktime-kioskmode
6123
6124            Change HTML code that embeds Quicktime objects so that kioskmode,
6125            which prevents saving, is disabled.
6126
6127    fun
6128
6129            Text replacements for subversive browsing fun. Make fun of your
6130            favorite Monopolist or play buzzword bingo.
6131
6132    crude-parental
6133
6134            A demonstration-only filter that shows how Privoxy can be used to
6135            delete web content on a keyword basis.
6136
6137    ie-exploits
6138
6139            An experimental collection of text replacements to disable
6140            malicious HTML and JavaScript code that exploits known security
6141            holes in Internet Explorer.
6142
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.
6146
6147    site-specifics
6148
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
6151            sites.
6152
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.
6157
6158    google
6159
6160            A CSS based block for Google text ads. Also removes a width
6161            limitation and the toolbar advertisement.
6162
6163    yahoo
6164
6165            Another CSS based block, this time for Yahoo text ads. And removes
6166            a width limitation as well.
6167
6168    msn
6169
6170            Another CSS based block, this time for MSN text ads. And removes
6171            tracking URLs, as well as a width limitation.
6172
6173    blogspot
6174
6175            Cleans up some Blogspot blogs. Read the fine print before using
6176            this one!
6177
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.
6183
6184    xml-to-html
6185
6186            Server-header filter to change the Content-Type from xml to html.
6187
6188    html-to-xml
6189
6190            Server-header filter to change the Content-Type from html to xml.
6191
6192    no-ping
6193
6194            Removes the non-standard ping attribute from anchor and area HTML
6195            tags.
6196
6197    hide-tor-exit-notation
6198
6199            Client-header filter to remove the Tor exit node notation found in
6200            Host and Referer headers.
6201
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
6205            "foobar".
6206
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.
6211
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
6215            address).
6216
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.
6222
6223    --------------------------------------------------------------------------
6224
6225 10. Privoxy's Template Files
6226
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.)
6231
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/.
6235
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.
6243
6244    Note that just like in configuration files, lines starting with # are
6245    ignored when the templates are filled in.
6246
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.
6252
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
6257    development stage:
6258
6259    <!-- @if-unstable-start -->
6260
6261      ... beta warning HTML code goes here ...
6262
6263    <!-- if-unstable-end@ -->
6264
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:
6268
6269    <!--  -->
6270
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 ;-)
6273
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.
6278
6279    --------------------------------------------------------------------------
6280
6281 11. Contacting the Developers, Bug Reporting and Feature Requests
6282
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:
6286
6287    --------------------------------------------------------------------------
6288
6289   11.1. Get Support
6290
6291    For casual users, our support forum at SourceForge is probably best
6292    suited: http://sourceforge.net/tracker/?group_id=11118&atid=211118
6293
6294    All users are of course welcome to discuss their issues on the users
6295    mailing list, where the developers also hang around.
6296
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
6301    discarded as spam.
6302
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.
6307
6308    --------------------------------------------------------------------------
6309
6310   11.2. Reporting Problems
6311
6312    "Problems" for our purposes, come in two forms:
6313
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
6316        turned "on".
6317
6318      * "Bugs" in the programming code that makes up Privoxy, such as that
6319        might cause a crash.
6320
6321    --------------------------------------------------------------------------
6322
6323     11.2.1. Reporting Ads or Other Configuration Problems
6324
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
6329    File Tracker.
6330
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.
6334
6335    --------------------------------------------------------------------------
6336
6337     11.2.2. Reporting Bugs
6338
6339    Please report all bugs through our bug tracker:
6340    http://sourceforge.net/tracker/?group_id=11118&atid=111118.
6341
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.
6346
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
6350    persists.
6351
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.
6356
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.
6361
6362    Please be sure to provide the following information:
6363
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).
6367
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.
6371
6372      * The name, platform, and version of the browser you were using (e.g.
6373        Internet Explorer v5.5 for Mac).
6374
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).
6377
6378      * Whether your version of Privoxy is one supplied by the Privoxy
6379        developers via SourceForge, or if you got your copy somewhere else.
6380
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
6383        symptoms change.
6384
6385      * Whether you are using a personal firewall product. If so, does Privoxy
6386        work without it?
6387
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
6390        each action taken).
6391
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.
6396
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.
6400
6401    The appendix of the Privoxy User Manual also has helpful information on
6402    understanding actions, and action debugging.
6403
6404    --------------------------------------------------------------------------
6405
6406   11.3. Request New Features
6407
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.
6411
6412    --------------------------------------------------------------------------
6413
6414   11.4. Other
6415
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.
6421
6422    --------------------------------------------------------------------------
6423
6424 12. Privoxy Copyright, License and History
6425
6426    Copyright (c) 2001-2008 by Privoxy Developers
6427    <ijbswa-developers@lists.sourceforge.net>
6428
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.
6431
6432    --------------------------------------------------------------------------
6433
6434   12.1. License
6435
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.
6439
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
6445
6446    You should have received a copy of the GNU General Public License along
6447    with this program; if not, write to the
6448
6449     Free Software
6450     Foundation, Inc. 51 Franklin Street, Fifth Floor
6451     Boston, MA 02110-1301
6452     USA
6453
6454    --------------------------------------------------------------------------
6455
6456   12.2. History
6457
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.
6461
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.
6468
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.
6476
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.
6480
6481    The result of this is Privoxy, whose first stable version, 3.0, was
6482    released August, 2002.
6483
6484    --------------------------------------------------------------------------
6485
6486   12.3. Authors
6487
6488    Current Privoxy Team:
6489
6490     Fabian Keil, lead developer
6491     David Schmidt, developer
6492
6493     Hal Burgiss
6494     Gerry Murphy
6495     Roland Rosenfeld
6496     Jörg Strohmayer
6497
6498    Former Privoxy Team Members:
6499
6500     Johny Agotnes
6501     Rodrigo Barbosa
6502     Moritz Barsnick
6503     Ian Cummings
6504     Brian Dessent
6505     Jon Foster
6506     Karsten Hopp
6507     Alexander Lazic
6508     Daniel Leite
6509     Gábor Lipták
6510     Adam Lock
6511     Guy Laroche
6512     Mark Martinec
6513     Justin McMurtry
6514     Andreas Oesterhelt
6515     Haroon Rafique
6516     Georg Sauthoff
6517     Thomas Steudten
6518     Rodney Stromlund
6519     Sviatoslav Sviridov
6520     Sarantis Paskalis
6521     Stefan Waldherr
6522
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):
6526
6527     Ken Arromdee
6528     Devin Bayer
6529     Gergely Bor
6530     Reiner Buehl
6531     Andrew J. Caines
6532     Clifford Caoile
6533     Frédéric Crozat
6534     Michael T. Davis
6535     Mattes Dolak
6536     Peter E.
6537     Florian Effenberger
6538     Markus Elfring
6539     Dean Gaudet
6540     Stephen Gildea
6541     Daniel Griscom
6542     Felix Gröbert
6543     Aaron Hamid
6544     Darel Henman
6545     Magnus Holmgren
6546     Ralf Horstmann
6547     Stefan Huehner
6548     Peter Hyman
6549     Derek Jennings
6550     Petr Kadlec
6551     David Laight
6552     Bert van Leeuwen
6553     Don Libes
6554     Paul Lieverse
6555     Toby Lyward
6556     Wil Mahan
6557     Jindrich Makovicka
6558     David Mediavilla
6559     Raphael Moll
6560     Amuro Namie
6561     Adam Piggott
6562     Dan Price
6563     Lee R.
6564     Roberto Ragusa
6565     Félix Rauch
6566     Maynard Riley
6567     Chung-chieh Shan
6568     Spinor S.
6569     Bart Schelstraete
6570     Oliver Stoeneberg
6571     Peter Thoenen
6572     Martin Thomas
6573     Song Weijia
6574     Jörg Weinmann
6575     Darren Wiebe
6576     Bobby G. Vinyard
6577     Anduin Withers
6578     Oliver Yeoh
6579     Jamie Zawinski
6580
6581    Privoxy is based in part on code originally developed by Junkbusters Corp.
6582    and Anonymous Coders.
6583
6584    Privoxy heavily relies on Philip Hazel's PCRE.
6585
6586    The code to filter compressed content makes use of zlib which is written
6587    by Jean-loup Gailly and Mark Adler.
6588
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.
6592
6593    --------------------------------------------------------------------------
6594
6595 13. See Also
6596
6597    Other references and sites of interest to Privoxy users:
6598
6599    http://www.privoxy.org/, the Privoxy Home page.
6600
6601    http://www.privoxy.org/faq/, the Privoxy FAQ.
6602
6603    http://sourceforge.net/projects/ijbswa/, the Project Page for Privoxy on
6604    SourceForge.
6605
6606    http://config.privoxy.org/, the web-based user interface. Privoxy must be
6607    running for this to work. Shortcut: http://p.p/
6608
6609    http://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit
6610    "misses" and other configuration related suggestions to the developers.
6611
6612    http://www.junkbusters.com/ht/en/cookies.html, an explanation how cookies
6613    are used to track web users.
6614
6615    http://www.junkbusters.com/ijb.html, the original Internet Junkbuster.
6616
6617    http://privacy.net/, a useful site to check what information about you is
6618    leaked while you browse the web.
6619
6620    http://www.squid-cache.org/, a popular caching proxy, which is often used
6621    together with Privoxy.
6622
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.
6626
6627    http://tor.eff.org/, Tor can help anonymize web browsing, web publishing,
6628    instant messaging, IRC, SSH, and other applications.
6629
6630    http://www.privoxy.org/developer-manual/, the Privoxy developer manual.
6631
6632    --------------------------------------------------------------------------
6633
6634 14. Appendix
6635
6636   14.1. Regular Expressions
6637
6638    Privoxy uses Perl-style "regular expressions" in its actions files and
6639    filter file, through the PCRE and PCRS libraries.
6640
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 ;-)
6644
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.
6653
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"!
6661
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
6665    some examples:
6666
6667    . - Matches any single character, e.g. "a", "A", "4", ":", or "@".
6668
6669    ? - The preceding character or expression is matched ZERO or ONE times.
6670    Either/or.
6671
6672    + - The preceding character or expression is matched ONE or MORE times.
6673
6674    * - The preceding character or expression is matched ZERO or MORE times.
6675
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
6681    character).
6682
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]+".
6687
6688    ( ) - parentheses are used to group a sub-expression, or multiple
6689    sub-expressions.
6690
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.
6695
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:
6699
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.
6712
6713    And now something a little more complex:
6714
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.
6721
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
6735    either spelling.
6736
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).
6757
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 :/
6763
6764    More reading on Perl Compatible Regular expressions:
6765    http://perldoc.perl.org/perlre.html
6766
6767    For information on regular expression based substitutions and their
6768    applications in filters, please see the filter file tutorial in this
6769    manual.
6770
6771    --------------------------------------------------------------------------
6772
6773   14.2. Privoxy's Internal Pages
6774
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.
6780
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
6784    either.
6785
6786      * Privoxy main page:
6787
6788          http://config.privoxy.org/
6789
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)
6792
6793      * Show information about the current configuration, including viewing
6794        and editing of actions files:
6795
6796          http://config.privoxy.org/show-status
6797
6798      * Show the source code version numbers:
6799
6800          http://config.privoxy.org/show-version
6801
6802      * Show the browser's request headers:
6803
6804          http://config.privoxy.org/show-request
6805
6806      * Show which actions apply to a URL and why:
6807
6808          http://config.privoxy.org/show-url-info
6809
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:
6813
6814          http://config.privoxy.org/toggle
6815
6816        Short cuts. Turn off, then on:
6817
6818          http://config.privoxy.org/toggle?set=disable
6819
6820          http://config.privoxy.org/toggle?set=enable
6821
6822    These may be bookmarked for quick reference. See next.
6823
6824    --------------------------------------------------------------------------
6825
6826     14.2.1. Bookmarklets
6827
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).
6834
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.
6841
6842      * Privoxy - Enable
6843
6844      * Privoxy - Disable
6845
6846      * Privoxy - Toggle Privoxy (Toggles between enabled and disabled)
6847
6848      * Privoxy- View Status
6849
6850      * Privoxy - Why?
6851
6852    Credit: The site which gave us the general idea for these bookmarklets is
6853    www.bookmarklets.com. They have more information about bookmarklets.
6854
6855    --------------------------------------------------------------------------
6856
6857   14.3. Chain of Events
6858
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
6861    by your browser:
6862
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:
6866
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.
6869
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).
6878
6879      * Untrusted URLs are blocked. If URLs are being added to the trust file,
6880        then that is done.
6881
6882      * If the URL pattern matches the "+fast-redirects" action, it is then
6883        processed. Unwanted parts of the requested URL are stripped.
6884
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.
6889
6890      * Now the web server starts sending its response back (i.e. typically a
6891        web page).
6892
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.
6897
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
6900        is received.
6901
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
6910        your browser.
6911
6912        If neither a "+filter" action or "+deanimate-gifs" matches, then
6913        Privoxy passes the raw data through to the client browser as it
6914        becomes available.
6915
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.
6925
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.
6929
6930    --------------------------------------------------------------------------
6931
6932   14.4. Troubleshooting: Anatomy of an Action
6933
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.
6941
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".)
6948
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.
6954
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.
6958
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.
6970
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):
6973
6974     Matches for http://www.google.com:
6975
6976     In file: default.action [ View ] [ Edit ]
6977
6978     {+deanimate-gifs {last}
6979     +fast-redirects {check-decoded-url}
6980     +filter {refresh-tags}
6981     +filter {img-reorder}
6982     +filter {banners-by-size}
6983     +filter {webbugs}
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}
6991    /
6992
6993     { -session-cookies-only }
6994     .google.com
6995
6996     { -fast-redirects }
6997     .google.com
6998
6999    In file: user.action [ View ] [ Edit ]
7000    (no matches in this file)
7001
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.
7007
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
7013    listing -- " / ".
7014
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.
7029
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,
7035
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":
7038
7039     Final results:
7040
7041     -add-header
7042     -block
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
7052     -fast-redirects
7053     -filter {js-events}
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}
7062     -filter {fun}
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}
7071     +filter {webbugs}
7072     +filter {jumping-windows}
7073     +filter {ie-exploits}
7074     -filter {google}
7075     -filter {yahoo}
7076     -filter {msn}
7077     -filter {blogspot}
7078     -filter {no-ping}
7079     -force-text-mode
7080     -handle-as-empty-document
7081     -handle-as-image
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}
7088     -hide-user-agent
7089     -inspect-jpegs
7090     -kill-popups
7091     -limit-connect
7092     -overwrite-last-modified
7093     -prevent-compression
7094     -redirect
7095     -send-vanilla-wafer
7096     -send-wafer
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
7102
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
7106    "Final Results".
7107
7108    Now another example, "ad.doubleclick.net":
7109
7110     { +block }
7111      ad*.
7112
7113     { +block }
7114      .ad.
7115
7116     { +block +handle-as-image }
7117      .[a-vx-z]*.doubleclick.net
7118
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
7124    one action.)
7125
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.
7133
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 ...
7136
7137     Matches for http://www.example.net/adsl/HOWTO/:
7138
7139     In file: default.action [ View ] [ Edit ]
7140
7141     {-add-header
7142      -block
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
7150      +deanimate-gifs
7151      -downgrade-http-version
7152      +fast-redirects {check-decoded-url}
7153      -filter {js-events}
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}
7162      -filter {fun}
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}
7171      +filter {webbugs}
7172      +filter {jumping-windows}
7173      +filter {ie-exploits}
7174      -filter {google}
7175      -filter {yahoo}
7176      -filter {msn}
7177      -filter {blogspot}
7178      -filter {no-ping}
7179      -force-text-mode
7180      -handle-as-empty-document
7181      -handle-as-image
7182      -hide-accept-language
7183      -hide-content-disposition
7184      +hide-forwarded-for-headers
7185      +hide-from-header{block}
7186      +hide-referer{forge}
7187      -hide-user-agent
7188      -inspect-jpegs
7189      -kill-popups
7190      -overwrite-last-modified
7191      +prevent-compression
7192      -redirect
7193      -send-vanilla-wafer
7194      -send-wafer
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 }
7200       /
7201
7202     { +block +handle-as-image }
7203      /ads
7204
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.
7213    Example:
7214
7215     { -block }
7216      /adsl
7217
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.
7221
7222    But now what about a situation where we get no explicit matches like we
7223    did with:
7224
7225     { +block +handle-as-image }
7226     /ads
7227
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":
7235
7236     { shop }
7237     .quietpc.com
7238     .worldpay.com   # for quietpc.com
7239     .jungle.com
7240     .scan.co.uk
7241     .forbes.com
7242
7243    "{ shop }" is an "alias" that expands to "{ -filter -session-cookies-only
7244    }". Or you could do your own exception to negate filtering:
7245
7246     { -filter }
7247     # Disable ALL filter actions for sites in this section
7248     .forbes.com
7249     developer.ibm.com
7250     localhost
7251
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
7256    the action.
7257
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
7261    standardized).
7262
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
7265    sites.
7266
7267     { fragile }
7268     # Handle with care: easy to break
7269     mail.google.
7270     mybank.example.com
7271
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.
7275
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.