Catchup with recent corrections (minor).
[privoxy.git] / doc / text / user-manual.txt
1 Privoxy 3.0.5 User Manual
2
3 Copyright © 2001 - 2006 by Privoxy Developers
4
5 $Id: user-manual.sgml,v 2.22 2006/09/22 01:27:55 hal9 Exp $
6
7 The Privoxy User Manual gives users information on how to install, configure
8 and use Privoxy.
9
10 Privoxy is a web proxy with advanced filtering capabilities for protecting
11 privacy, modifying web page data, managing cookies, controlling access, and
12 removing ads, banners, pop-ups and other obnoxious Internet junk. Privoxy has a
13 very flexible configuration and can be customized to suit individual needs and
14 tastes. Privoxy has application for both stand-alone systems and multi-user
15 networks.
16
17 Privoxy is based on Internet Junkbuster (tm).
18
19 You can find the latest version of the Privoxy User Manual at http://
20 www.privoxy.org/user-manual/. Please see the Contact section on how to contact
21 the developers.
22
23 -------------------------------------------------------------------------------
24
25 Table of Contents
26 1. Introduction
27    
28     1.1. Features
29    
30 2. Installation
31    
32     2.1. Binary Packages
33        
34         2.1.1. Red Hat, SuSE and Conectiva RPMs
35         2.1.2. Debian
36         2.1.3. Windows
37         2.1.4. Solaris, NetBSD, FreeBSD, HP-UX
38         2.1.5. OS/2
39         2.1.6. Mac OSX
40         2.1.7. AmigaOS
41         2.1.8. Gentoo
42        
43     2.2. Building from Source
44     2.3. Keeping your Installation Up-to-Date
45    
46 3. What's New in this Release
47    
48     3.1. Note to Upgraders
49    
50 4. Quickstart to Using Privoxy
51    
52     4.1. Quickstart to Ad Blocking
53    
54 5. Starting Privoxy
55    
56     5.1. Red Hat, Fedora and Conectiva
57     5.2. Debian
58     5.3. SuSE
59     5.4. Windows
60     5.5. Solaris, NetBSD, FreeBSD, HP-UX and others
61     5.6. OS/2
62     5.7. Mac OSX
63     5.8. AmigaOS
64     5.9. Gentoo
65     5.10. Command Line Options
66    
67 6. Privoxy Configuration
68    
69     6.1. Controlling Privoxy with Your Web Browser
70     6.2. Configuration Files Overview
71    
72 7. The Main Configuration File
73    
74     7.1. Local Set-up Documentation
75        
76         7.1.1. user-manual
77         7.1.2. trust-info-url
78         7.1.3. admin-address
79         7.1.4. proxy-info-url
80        
81     7.2. Configuration and Log File Locations
82        
83         7.2.1. confdir
84         7.2.2. logdir
85         7.2.3. actionsfile
86         7.2.4. filterfile
87         7.2.5. logfile
88         7.2.6. jarfile
89         7.2.7. trustfile
90        
91     7.3. Debugging
92        
93         7.3.1. debug
94         7.3.2. single-threaded
95        
96     7.4. Access Control and Security
97        
98         7.4.1. listen-address
99         7.4.2. toggle
100         7.4.3. enable-remote-toggle
101         7.4.4. enable-remote-http-toggle
102         7.4.5. enable-edit-actions
103         7.4.6. ACLs: permit-access and deny-access
104         7.4.7. buffer-limit
105        
106     7.5. Forwarding
107        
108         7.5.1. forward
109         7.5.2. forward-socks4 and forward-socks4a
110         7.5.3. Advanced Forwarding Examples
111         7.5.4. forwarded-connect-retries
112        
113     7.6. Windows GUI Options
114    
115 8. Actions Files
116    
117     8.1. Finding the Right Mix
118     8.2. How to Edit
119     8.3. How Actions are Applied to URLs
120     8.4. Patterns
121        
122         8.4.1. The Domain Pattern
123         8.4.2. The Path Pattern
124        
125     8.5. Actions
126        
127         8.5.1. add-header
128         8.5.2. block
129         8.5.3. content-type-overwrite
130         8.5.4. crunch-client-header
131         8.5.5. crunch-if-none-match
132         8.5.6. crunch-incoming-cookies
133         8.5.7. crunch-server-header
134         8.5.8. crunch-outgoing-cookies
135         8.5.9. deanimate-gifs
136         8.5.10. downgrade-http-version
137         8.5.11. fast-redirects
138         8.5.12. filter
139         8.5.13. filter-client-headers
140         8.5.14. filter-server-headers
141         8.5.15. force-text-mode
142         8.5.16. handle-as-empty-document
143         8.5.17. handle-as-image
144         8.5.18. hide-accept-language
145         8.5.19. hide-content-disposition
146         8.5.20. hide-if-modified-since
147         8.5.21. hide-forwarded-for-headers
148         8.5.22. hide-from-header
149         8.5.23. hide-referrer
150         8.5.24. hide-user-agent
151         8.5.25. inspect-jpegs
152         8.5.26. kill-popups
153         8.5.27. limit-connect
154         8.5.28. prevent-compression
155         8.5.29. overwrite-last-modified
156         8.5.30. redirect
157         8.5.31. send-vanilla-wafer
158         8.5.32. send-wafer
159         8.5.33. session-cookies-only
160         8.5.34. set-image-blocker
161         8.5.35. treat-forbidden-connects-like-blocks
162         8.5.36. Summary
163        
164     8.6. Aliases
165     8.7. Actions Files Tutorial
166        
167         8.7.1. default.action
168         8.7.2. user.action
169        
170 9. Filter Files
171    
172     9.1. Filter File Tutorial
173     9.2. The Pre-defined Filters
174    
175 10. Privoxy's Template Files
176 11. Contacting the Developers, Bug Reporting and Feature Requests
177    
178     11.1. Get Support
179     11.2. Reporting Problems
180        
181         11.2.1. Reporting Ads or Other Configuration Problems
182         11.2.2. Reporting Bugs
183        
184     11.3. Request New Features
185     11.4. Other
186    
187 12. Privoxy Copyright, License and History
188    
189     12.1. License
190     12.2. History
191     12.3. Authors
192    
193 13. See Also
194 14. Appendix
195    
196     14.1. Regular Expressions
197     14.2. Privoxy's Internal Pages
198        
199         14.2.1. Bookmarklets
200        
201     14.3. Chain of Events
202     14.4. Troubleshooting: Anatomy of an Action
203    
204 1. Introduction
205
206 This documentation is included with the current BETA version of Privoxy,
207 v.3.0.5, and is mostly complete at this point. The most up to date reference
208 for the time being is still the comments in the source files and in the
209 individual configuration files. Development of a new version is currently
210 nearing completion, and includes significant changes and enhancements over
211 earlier versions. .
212
213 Since this is a BETA version, not all new features are well tested. This
214 documentation may be slightly out of sync as a result (especially with CVS
215 sources). And there may be bugs, though hopefully not many!
216
217 -------------------------------------------------------------------------------
218
219 1.1. Features
220
221 In addition to the core features of ad blocking and cookie management, Privoxy
222 provides many supplemental features, some of them currently under development,
223 that give the end-user more control, more privacy and more freedom:
224
225   * Integrated browser based configuration and control utility at http://
226     config.privoxy.org/ (shortcut: http://p.p/). Browser-based tracing of rule
227     and filter effects. Remote toggling.
228    
229   * Web page content filtering (removes banners based on size, invisible
230     "web-bugs", JavaScript and HTML annoyances, pop-up windows, etc.)
231    
232   * Modularized configuration that allows for standard settings and user
233     settings to reside in separate files, so that installing updated actions
234     files won't overwrite individual user settings.
235    
236   * HTTP/1.1 compliant (but not all optional 1.1 features are supported).
237    
238   * Support for Perl Compatible Regular Expressions in the configuration files,
239     and generally a more sophisticated and flexible configuration syntax over
240     previous versions.
241    
242   * Improved cookie management features (e.g. session based cookies).
243    
244   * GIF de-animation.
245    
246   * Bypass many click-tracking scripts (avoids script redirection).
247    
248   * Multi-threaded (POSIX and native threads).
249    
250   * User-customizable HTML templates for all proxy-generated pages (e.g.
251     "blocked" page).
252    
253   * Auto-detection and re-reading of config file changes.
254    
255   * Improved signal handling, and a true daemon mode (Unix).
256    
257   * Every feature now controllable on a per-site or per-location basis,
258     configuration more powerful and versatile over-all.
259    
260   * Many smaller new features added, limitations and bugs removed, and security
261     holes fixed.
262    
263 -------------------------------------------------------------------------------
264
265 2. Installation
266
267 Privoxy is available both in convenient pre-compiled packages for a wide range
268 of operating systems, and as raw source code. For most users, we recommend
269 using the packages, which can be downloaded from our Privoxy Project Page.
270
271 Note: On some platforms, the installer may remove previously installed
272 versions, if found. (See below for your platform). In any case be sure to
273 backup your old configuration if it is valuable to you. See the note to
274 upgraders section below.
275
276 -------------------------------------------------------------------------------
277
278 2.1. Binary Packages
279
280 How to install the binary packages depends on your operating system:
281
282 -------------------------------------------------------------------------------
283
284 2.1.1. Red Hat, SuSE and Conectiva RPMs
285
286 RPMs can be installed with rpm -Uvh privoxy-3.0.5-1.rpm, and will use /etc/
287 privoxy for the location of configuration files.
288
289 Note that on Red Hat, Privoxy will not be automatically started on system boot.
290 You will need to enable that using chkconfig, ntsysv, or similar methods.
291
292 If you have problems with failed dependencies, try rebuilding the SRC RPM: rpm
293 --rebuild privoxy-3.0.5-1.src.rpm. This will use your locally installed
294 libraries and RPM version.
295
296 Also note that if you have a Junkbuster RPM installed on your system, you need
297 to remove it first, because the packages conflict. Otherwise, RPM will try to
298 remove Junkbuster automatically if found, before installing Privoxy.
299
300 -------------------------------------------------------------------------------
301
302 2.1.2. Debian
303
304 DEBs can be installed with apt-get install privoxy, and will use /etc/privoxy
305 for the location of configuration files.
306
307 -------------------------------------------------------------------------------
308
309 2.1.3. Windows
310
311 Just double-click the installer, which will guide you through the installation
312 process. You will find the configuration files in the same directory as you
313 installed Privoxy in.
314
315 Version 3.0.4 introduced full Windows service functionality. On Windows only,
316 the Privoxy program has two new command line arguments to install and uninstall
317 Privoxy as a service.
318
319 Arguments:
320    
321     --install[:service_name]
322    
323     --uninstall[:service_name]
324    
325 After invoking Privoxy with --install, you will need to bring up the Windows
326 service console to assign the user you want Privoxy to run under, and whether
327 or not you want it to run whenever the system starts. You can start the Windows
328 services console with the following command: services.msc. If you do not take
329 the manual step of modifying Privoxy's service settings, it will not start.
330 Note too that you will need to give Privoxy a user account that actually
331 exists, or it will not be permitted to write to its log and configuration
332 files.
333
334 -------------------------------------------------------------------------------
335
336 2.1.4. Solaris, NetBSD, FreeBSD, HP-UX
337
338 Create a new directory, cd to it, then unzip and untar the archive. For the
339 most part, you'll have to figure out where things go.
340
341 -------------------------------------------------------------------------------
342
343 2.1.5. OS/2
344
345 First, make sure that no previous installations of Junkbuster and / or Privoxy
346 are left on your system. Check that no Junkbuster or Privoxy objects are in
347 your startup folder. 
348
349 Then, just double-click the WarpIN self-installing archive, which will guide
350 you through the installation process. A shadow of the Privoxy executable will
351 be placed in your startup folder so it will start automatically whenever OS/2
352 starts.
353
354 The directory you choose to install Privoxy into will contain all of the
355 configuration files.
356
357 -------------------------------------------------------------------------------
358
359 2.1.6. Mac OSX
360
361 Unzip the downloaded file (you can either double-click on the file from the
362 finder, or from the desktop if you downloaded it there). Then, double-click on
363 the package installer icon named Privoxy.pkg and follow the installation
364 process. Privoxy will be installed in the folder /Library/Privoxy. It will
365 start automatically whenever you start up. To prevent it from starting
366 automatically, remove or rename the folder /Library/StartupItems/Privoxy.
367
368 To start Privoxy by hand, double-click on StartPrivoxy.command in the /Library/
369 Privoxy folder. Or, type this command in the Terminal:
370
371   /Library/Privoxy/StartPrivoxy.command                                        
372                                                                                
373
374 You will be prompted for the administrator password.
375
376 -------------------------------------------------------------------------------
377
378 2.1.7. AmigaOS
379
380 Copy and then unpack the lha archive to a suitable location. All necessary
381 files will be installed into Privoxy directory, including all configuration and
382 log files. To uninstall, just remove this directory.
383
384 -------------------------------------------------------------------------------
385
386 2.1.8. Gentoo
387
388 Gentoo source packages (Ebuilds) for Privoxy are contained in the Gentoo
389 Portage Tree (they are not on the download page, but there is a Gentoo section,
390 where you can see when a new Privoxy Version is added to the Portage Tree).
391
392 Before installing Privoxy under Gentoo just do first emerge rsync to get the
393 latest changes from the Portage tree. With emerge privoxy you install the
394 latest version.
395
396 Configuration files are in /etc/privoxy, the documentation is in /usr/share/doc
397 /privoxy-3.0.5 and the Log directory is in /var/log/privoxy.
398
399 -------------------------------------------------------------------------------
400
401 2.2. Building from Source
402
403 The most convenient way to obtain the Privoxy sources is to download the source
404 tarball from our project page.
405
406 If you like to live on the bleeding edge and are not afraid of using possibly
407 unstable development versions, you can check out the up-to-the-minute version
408 directly from the CVS repository.
409
410 To build Privoxy from source, autoconf, GNU make (gmake), and, of course, a C
411 compiler like gcc are required.
412
413 When building from a source tarball, first unpack the source:
414
415  tar xzvf privoxy-3.0.5-beta-src* [.tgz or .tar.gz]                            
416  cd privoxy-3.0.5-beta                                                         
417
418 For retrieving the current CVS sources, you'll need a CVS client installed.
419 Note that sources from CVS are typicially development quality, and may not be
420 stable, or well tested. To download CVS source, check the Sourceforge
421 documentation, which might give commands like:
422
423   cvs -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa login          
424   cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co current 
425   cd current                                                                         
426
427 This will create a directory named current/, which will contain the source
428 tree.
429
430 You can also check out any Privoxy "branch", just exchange the current name
431 with the wanted branch name (Example: v_3_0_branch for the 3.0 cvs tree).
432
433 It is also strongly recommended to not run Privoxy as root, and instead it is
434 suggested to create a "privoxy" user and group for this purpose. See your local
435 documentation for the correct command line to do this.
436
437 /etc/passwd might then look like:
438
439   privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell                         
440
441 And then /etc/group, like:
442
443   privoxy:*:7777:                                                              
444
445 Some binary packages may do this for you.
446
447 Then, to build from either unpacked tarball or CVS source:
448
449  autoheader                                                                    
450  autoconf                                                                      
451  ./configure      # (--help to see options)                                    
452  make             # (the make from GNU, sometimes called gmake)                
453  su                                                                            
454  make -n install  # (to see where all the files will go)                       
455  make -s install  # (to really install, -s to silence output)                  
456
457 If you have GNU make, you can have the first four steps automatically done for
458 you by just typing:
459
460   make                                                                         
461
462 in the freshly downloaded or unpacked source directory.
463
464 WARNING: If installing as root, the install will fail unless a non-root user or
465 group is specified, or a privoxy user and group already exist on the system. If
466 a non-root user is specified, and no group, then the installation will try to
467 also use a group of the same name as "user". If a group is specified (and no
468 user), then the support files will be installed as writable by that group, and
469 owned by the user running the installation.
470
471 configure accepts --with-user and --with-group options for setting user and
472 group ownership of the configuration files (which need to be writable by the
473 daemon). The specified user must already exist. When starting Privoxy, it
474 should be run as this same user to insure write access to configuration and log
475 files.
476
477 Alternately, you can specify user and group on the make command line, but be
478 sure both already exist:
479
480  make -s install  USER=privoxy GROUP=privoxy                                   
481
482 The default installation path for make install is /usr/local. This may of
483 course be customized with the various ./configure path options. If you are
484 doing a root install to anywhere else besides /usr/local, be sure to set the
485 appropriate paths with the correct configure options (./configure --help).
486
487 If you do install to /usr/local, the install will use sysconfdir=$prefix/etc/
488 privoxy by default. All other destinations, and the direct usage of
489 --sysconfdir flag behave like normal, i.e. will not add the extra privoxy
490 directory. This is for a safer install, as there may already exist another
491 program that uses a file with the "config" name, and thus makes /usr/local/etc
492 cleaner.
493
494 If installing to /usr/local, the docs will go by default to $prefix/share/doc.
495 But if this directory doesn't exist, it will then try $prefix/doc and install
496 there before creating a new $prefix/share/doc just for Privoxy.
497
498 Again, if the installs goes to /usr/local, the localstatedir (ie: var/) will
499 default to /var instead of $prefix/var so the logs will go to /var/log/privoxy
500 /, and the pid file will be created in /var/run/privoxy.pid.
501
502 make install will attempt to set the correct values in config (main
503 configuration file). You may want to check this to make sure all values are
504 correct. If appropriate, an init script will be installed, but it is up to the
505 user to determine how and where to start Privoxy. The init script should be
506 checked for correct paths and values, if anything other than a default install
507 is done.
508
509 If install finds previous versions of any local configuration files, these will
510 not be overwritten, and the new ones will be installed with a "new" extension.
511 default.action, default.filter, and standard.action will be overwritten. You
512 will then need to manually update the other installed configuration files as
513 needed. All template files will be overwritten. If you have customized, local
514 templates, you should save these first. If a previous version of Privoxy is
515 already running, you will have to restart it manually.
516
517 For more detailed instructions on how to build Redhat RPMs, Windows
518 self-extracting installers, building on platforms with special requirements
519 etc, please consult the developer manual.
520
521 -------------------------------------------------------------------------------
522
523 2.3. Keeping your Installation Up-to-Date
524
525 As user feedback comes in and development continues, we will make updated
526 versions of both the main actions file (as a separate package) and the software
527 itself (including the actions file) available for download.
528
529 If you wish to receive an email notification whenever we release updates of
530 Privoxy or the actions file, subscribe to our announce mailing list,
531 ijbswa-announce@lists.sourceforge.net.
532
533 In order not to lose your personal changes and adjustments when updating to the
534 latest default.action file we strongly recommend that you use user.action and
535 user.filter for your local customizations of Privoxy. See the Chapter on
536 actions files for details.
537
538 -------------------------------------------------------------------------------
539
540 3. What's New in this Release
541
542 There are many improvements and new features in Privoxy 3.0.5 :
543
544   * Multiple filter files can now be specified in config. This allows for
545     locally defined filters that can be maintained separately from the filters
546     as supplied by the developers, i.e. default.filter.
547    
548   * There are a number of new actions:
549    
550       + content-type-overwrite
551        
552       + crunch-client-header
553        
554       + crunch-if-none-match
555        
556       + crunch-server-header
557        
558       + filter-client-headers
559        
560       + filter-server-headers
561        
562       + force-text-mode
563        
564       + handle-as-empty-document
565        
566       + hide-accept-language
567        
568       + hide-content-disposition
569        
570       + hide-if-modified-since
571        
572       + inspect-jpegs
573        
574       + overwrite-last-modified
575        
576       + redirect
577        
578       + treat-forbidden-connects-like-blocks
579        
580     In addition, fast-redirects has been significantly improved with enhanced
581     syntax.
582    
583     And hide-referrer has a new option, conditional block.
584    
585   * MS-Windows versions can now be installed and started as a Windows service.
586    
587   * config has two new options: enable-remote-http-toggle, and 
588     forwarded-connect-retries.
589    
590     And there is improved handling of the user-manual option, for placing
591     documentation and help files on the local system.
592    
593   * Actions files problems and suggestions are now being directed to: http://
594     sourceforge.net/tracker/?group_id=11118&atid=460288. Please use this to
595     report such configuration related problems as missed ads, sites that don't
596     function properly due to one action or another, innocent images being
597     blocked, etc.
598    
599   * In addition, there are numerous bug fixes and significant enhancements,
600     including error pages should no longer be cached if the problem is fixed,
601     much better DNS error handling, and various logging improvements.
602    
603   * The default actions setting is now Cautious. Previous releases had a
604     default setting of Medium. Experienced users may want to adjust this, as it
605     is fairly conservative by Privoxy standards and past practices. See http://
606     config.privoxy.org/edit-actions-list?f=default. New users should try the
607     default settings for a while before turning up the volume.
608    
609 -------------------------------------------------------------------------------
610
611 3.1. Note to Upgraders
612
613 A quick list of things to be aware of before upgrading from earlier versions of
614 Privoxy:
615
616   * Some installers may remove earlier versions completely, including
617     configuration files. Save any important configuration files!
618    
619   * On the other hand, other installers may not overwrite any existing
620     configuration files, thinking you will want to do that. You may want to
621     manually check your saved files against the newer versions to see if the
622     improvements have merit, or whether there are new options that you may want
623     to consider. There are a number of new features, but most won't be
624     available unless these features are incorporated into your configuration
625     somehow.
626    
627   * See the full documentation on fast-redirects which has changed syntax, and
628     will require adjustments to local configs, such as user.action. You must
629     reference the new syntax:
630    
631       { +fast-redirects{check-decoded-url} }                           
632        .example.com                                                    
633        mybank.com                                                      
634        .google.                                                        
635    
636   * The jarfile, cookie logger, is off by default now.
637    
638   * What constitutes a "default" configuration has changed, and you may want to
639     review which actions are "on" by default. This is primarily a matter of
640     emphasis, but some features you may have been used to, may now be "off" by
641     default. There are also a number of new actions you may want to consider,
642     most of which are not incorporated into the default settings as yet (see
643     above).
644    
645   * Some installers may not automatically start Privoxy after installation.
646    
647 -------------------------------------------------------------------------------
648
649 4. Quickstart to Using Privoxy
650
651   * Install Privoxy. See the Installation Section below for platform specific
652     information.
653    
654   * Advanced users and those who want to offer Privoxy service to more than
655     just their local machine should check the main config file, especially the 
656     security-relevant options. These are off by default.
657    
658   * Start Privoxy, if the installation program has not done this already (may
659     vary according to platform). See the section Starting Privoxy.
660    
661   * Set your browser to use Privoxy as HTTP and HTTPS (SSL) proxy by setting
662     the proxy configuration for address of 127.0.0.1 and port 8118. DO NOT
663     activate proxying for FTP or any protocols besides HTTP and HTTPS (SSL)! It
664     won't work!
665    
666   * Flush your browser's disk and memory caches, to remove any cached ad
667     images. If using Privoxy to manage cookies, you should remove any currently
668     stored cookies too.
669    
670   * A default installation should provide a reasonable starting point for most.
671     There will undoubtedly be occasions where you will want to adjust the
672     configuration, but that can be dealt with as the need arises. Little to no
673     initial configuration is required in most cases.
674    
675     See the Configuration section for more configuration options, and how to
676     customize your installation. You might also want to look at the next
677     section for a quick introduction to how Privoxy blocks ads and banners.
678    
679   * If you experience ads that slip through, innocent images that are blocked,
680     or otherwise feel the need to fine-tune Privoxy's behavior, take a look at
681     the actions files. As a quick start, you might find the richly commented
682     examples helpful. You can also view and edit the actions files through the 
683     web-based user interface. The Appendix "Troubleshooting: Anatomy of an
684     Action" has hints how to understand and debug actions that "misbehave".
685    
686   * For easy access to Privoxy's most important controls, drag the provided 
687     Bookmarklets into your browser's personal toolbar.
688    
689   * Please see the section Contacting the Developers on how to report bugs,
690     problems with websites or to get help.
691    
692   * Now enjoy surfing with enhanced control, comfort and privacy!
693    
694 -------------------------------------------------------------------------------
695
696 4.1. Quickstart to Ad Blocking
697
698 Ad blocking is but one of Privoxy's array of features. Many of these features
699 are for the technically minded advanced user. But, ad and banner blocking is
700 surely common ground for everybody.
701
702 This section will provide a quick summary of ad blocking so you can get up to
703 speed quickly without having to read the more extensive information provided
704 below, though this is highly recommended.
705
706 First a bit of a warning ... blocking ads is much like blocking SPAM: the more
707 aggressive you are about it, the more likely you are to block things that were
708 not intended. So there is a trade off here. If you want extreme ad free
709 browsing, be prepared to deal with more "problem" sites, and to spend more time
710 adjusting the configuration to solve these unintended consequences. In short,
711 there is not an easy way to eliminate all ads. Either take the easy way and
712 settle for most ads blocked with the default configuration, or jump in and
713 tweak it for your personal surfing habits and preferences.
714
715 Secondly, a brief explanation of Privoxy's "actions". "Actions" in this
716 context, are the directives we use to tell Privoxy to perform some task
717 relating to HTTP transactions (i.e. web browsing). We tell Privoxy to take some
718 "action". Each action has a unique name and function. While there are many
719 potential actions in Privoxy's arsenal, only a few are used for ad blocking. 
720 Actions, and action configuration files, are explained in depth below.
721
722 Actions are specified in Privoxy's configuration, followed by one or more URLs
723 to which the action should apply. URLs can actually be URL type patterns that
724 use wildcards so they can apply potentially to a range of similar URLs. The
725 actions, together with the URL patterns are called a section.
726
727 When you connect to a website, the full URL will either match one or more of
728 the sections as defined in Privoxy's configuration, or not. If so, then Privoxy
729 will perform the respective actions. If not, then nothing special happens.
730 Furthermore, web pages may contain embedded, secondary URLs that your web
731 browser will use to load additional components of the page, as it parses the
732 original page's HTML content. An ad image for instance, is just an URL embedded
733 in the page somewhere. The image itself may be on the same server, or a server
734 somewhere else on the Internet. Complex web pages will have many such embedded
735 URLs.
736
737 The actions we need to know about for ad blocking are: block, handle-as-image,
738 and set-image-blocker:
739
740   * block - this action stops any contact between your browser and any URL
741     patterns that match this action's configuration. It can be used for
742     blocking ads, but also anything that is determined to be unwanted. By
743     itself, it simply stops any communication with the remote server and sends
744     Privoxy's own built-in BLOCKED page instead to let you now what has
745     happened.
746    
747   * handle-as-image - tells Privoxy to treat this URL as an image. Privoxy's
748     default configuration already does this for all common image types (e.g.
749     GIF), but there are many situations where this is not so easy to determine.
750     So we'll force it in these cases. This is particularly important for ad
751     blocking, since only if we know that it's an image of some kind, can we
752     replace it with an image of our choosing, instead of the Privoxy BLOCKED
753     page (which would only result in a "broken image" icon). There are some
754     limitations to this though. For instance, you can't just brute-force an
755     image substitution for an entire HTML page in most situations.
756    
757   * set-image-blocker - tells Privoxy what to display in place of an ad image
758     that has hit a block rule. For this to come into play, the URL must match a
759     block action somewhere in the configuration, and, it must also match an 
760     handle-as-image action.
761    
762     The configuration options on what to display instead of the ad are:
763    
764        pattern - a checkerboard pattern, so that an ad replacement is obvious. 
765     This is the default.                                                       
766    
767        blank - A very small empty GIF image is displayed. This is the so-called
768     "invisible" configuration option.                                          
769    
770        http://<URL> - A redirect to any image anywhere of the user's choosing  
771     (advanced usage).                                                          
772    
773 The quickest way to adjust any of these settings is with your browser through
774 the special Privoxy editor at http://config.privoxy.org/show-status (shortcut: 
775 http://p.p/show-status). This is an internal page, and does not require
776 Internet access. Select the appropriate "actions" file, and click "Edit". It is
777 best to put personal or local preferences in user.action since this is not
778 meant to be overwritten during upgrades, and will over-ride the settings in
779 other files. Here you can insert new "actions", and URLs for ad blocking or
780 other purposes, and make other adjustments to the configuration. Privoxy will
781 detect these changes automatically.
782
783 A quick and simple step by step example:
784
785   * Right click on the ad image to be blocked, then select "Copy Link Location"
786     from the pop-up menu.
787    
788   * Set your browser to http://config.privoxy.org/show-status
789    
790   * Find user.action in the top section, and click on "Edit":
791    
792     Figure 1. Actions Files in Use
793    
794     [files-in-u]
795    
796   * You should have a section with only block listed under "Actions:". If not,
797     click a "Insert new section below" button, and in the new section that just
798     appeared, click the Edit button right under the word "Actions:". This will
799     bring up a list of all actions. Find block near the top, and click in the
800     "Enabled" column, then "Submit" just below the list.
801    
802   * Now, in the block actions section, click the "Add" button, and paste the
803     URL the browser got from "Copy Link Location". Remove the http:// at the
804     beginning of the URL. Then, click "Submit" (or "OK" if in a pop-up window).
805    
806   * Now go back to the original page, and press SHIFT-Reload (or flush all
807     browser caches). The image should be gone now.
808    
809 This is a very crude and simple example. There might be good reasons to use a
810 wildcard pattern match to include potentially similar images from the same
811 site. For a more extensive explanation of "patterns", and the entire actions
812 concept, see the Actions section.
813
814 For advanced users who want to hand edit their config files, you might want to
815 now go to the Actions Files Tutorial. The ideas explained therein also apply to
816 the web-based editor.
817
818 -------------------------------------------------------------------------------
819
820 5. Starting Privoxy
821
822 Before launching Privoxy for the first time, you will want to configure your
823 browser(s) to use Privoxy as a HTTP and HTTPS (SSL) proxy. The default is
824 127.0.0.1 (or localhost) for the proxy address, and port 8118 (earlier versions
825 used port 8000). This is the one configuration step that must be done!
826
827 Please note that Privoxy can only proxy HTTP and HTTPS traffic. It will not
828 work with FTP or other protocols.
829
830 Figure 2. Proxy Configuration Showing Mozilla/Netscape HTTP and HTTPS (SSL)
831 Settings
832
833 [proxy_setu]
834
835 With Firefox, this can be set under:
836
837  Tools -> Options -> General -> Connection Settings -> Manual Proxy
838 Configuration
839  
840
841 With Netscape (and Mozilla), this can be set under:
842
843  Edit -> Preferences -> Advanced -> Proxies -> HTTP Proxy
844  
845
846 For Internet Explorer v.5-6:
847
848  Tools -> Internet Options -> Connections -> LAN Settings
849
850 Then, check "Use Proxy" and fill in the appropriate info (Address: 127.0.0.1,
851 Port: 8118). Include HTTPS (SSL), if you want HTTPS proxy support too
852 (sometimes labeled "Secure"). Make sure any checkboxes like "Use the same proxy
853 server for all protocols" is UNCHECKED. You want only HTTP and HTTPS (SSL)!
854
855 Figure 3. Proxy Configuration Showing Internet Explorer HTTP and HTTPS (Secure)
856 Settings
857
858 [proxy2]
859
860 After doing this, flush your browser's disk and memory caches to force a
861 re-reading of all pages and to get rid of any ads that may be cached. Remove
862 any cookies, if you want Privoxy to manage that. You are now ready to start
863 enjoying the benefits of using Privoxy!
864
865 Privoxy itself is typically started by specifying the main configuration file
866 to be used on the command line. If no configuration file is specified on the
867 command line, Privoxy will look for a file named config in the current
868 directory. Except on Win32 where it will try config.txt.
869
870 -------------------------------------------------------------------------------
871
872 5.1. Red Hat, Fedora and Conectiva
873
874 A default Red Hat installation may not start Privoxy upon boot. It will use the
875 file /etc/privoxy/config as its main configuration file.
876
877  # /etc/rc.d/init.d/privoxy start                                              
878
879 Or ...
880
881  # service privoxy start                                                       
882
883 -------------------------------------------------------------------------------
884
885 5.2. Debian
886
887 We use a script. Note that Debian typically starts Privoxy upon booting per
888 default. It will use the file /etc/privoxy/config as its main configuration
889 file.
890
891  # /etc/init.d/privoxy start                                                   
892
893 -------------------------------------------------------------------------------
894
895 5.3. SuSE
896
897 We use a script. It will use the file /etc/privoxy/config as its main
898 configuration file. Note that SuSE starts Privoxy upon booting your PC.
899
900  # rcprivoxy start                                                             
901
902 -------------------------------------------------------------------------------
903
904 5.4. Windows
905
906 Click on the Privoxy Icon to start Privoxy. If no configuration file is
907 specified on the command line, Privoxy will look for a file named config.txt.
908 Note that Windows will automatically start Privoxy when the system starts if
909 you chose that option when installing.
910
911 Privoxy can run with full Windows service functionality. On Windows only, the
912 Privoxy program has two new command line arguments to install and uninstall
913 Privoxy as a service. See the Windows Installation instructions for details.
914
915 -------------------------------------------------------------------------------
916
917 5.5. Solaris, NetBSD, FreeBSD, HP-UX and others
918
919 Example Unix startup command:
920
921  # /usr/sbin/privoxy /etc/privoxy/config                                       
922
923 -------------------------------------------------------------------------------
924
925 5.6. OS/2
926
927 During installation, Privoxy is configured to start automatically when the
928 system restarts. You can start it manually by double-clicking on the Privoxy
929 icon in the Privoxy folder.
930
931 -------------------------------------------------------------------------------
932
933 5.7. Mac OSX
934
935 During installation, Privoxy is configured to start automatically when the
936 system restarts. To start Privoxy manually, double-click on the
937 StartPrivoxy.command icon in the /Library/Privoxy folder. Or, type this command
938 in the Terminal:
939
940   /Library/Privoxy/StartPrivoxy.command                                        
941                                                                                
942
943 You will be prompted for the administrator password.
944
945 -------------------------------------------------------------------------------
946
947 5.8. AmigaOS
948
949 Start Privoxy (with RUN <>NIL:) in your startnet script (AmiTCP), in s:
950 user-startup (RoadShow), as startup program in your startup script (Genesis),
951 or as startup action (Miami and MiamiDx). Privoxy will automatically quit when
952 you quit your TCP/IP stack (just ignore the harmless warning your TCP/IP stack
953 may display that Privoxy is still running).
954
955 -------------------------------------------------------------------------------
956
957 5.9. Gentoo
958
959 A script is again used. It will use the file /etc/privoxy/config as its main
960 configuration file.
961
962  /etc/init.d/privoxy start                                                     
963                                                                                
964
965 Note that Privoxy is not automatically started at boot time by default. You can
966 change this with the rc-update command.
967
968  rc-update add privoxy default                                                 
969                                                                                
970
971 -------------------------------------------------------------------------------
972
973 5.10. Command Line Options
974
975 Privoxy may be invoked with the following command-line options:
976
977   * --version
978    
979     Print version info and exit. Unix only.
980    
981   * --help
982    
983     Print short usage info and exit. Unix only.
984    
985   * --no-daemon
986    
987     Don't become a daemon, i.e. don't fork and become process group leader, and
988     don't detach from controlling tty. Unix only.
989    
990   * --pidfile FILE
991    
992     On startup, write the process ID to FILE. Delete the FILE on exit. Failure
993     to create or delete the FILE is non-fatal. If no FILE option is given, no
994     PID file will be used. Unix only.
995    
996   * --user USER[.GROUP]
997    
998     After (optionally) writing the PID file, assume the user ID of USER, and if
999     included the GID of GROUP. Exit if the privileges are not sufficient to do
1000     so. Unix only.
1001    
1002   * --chroot
1003    
1004     Before changing to the user ID given in the --user option, chroot to that
1005     user's home directory, i.e. make the kernel pretend to the Privoxy process
1006     that the directory tree starts there. If set up carefully, this can limit
1007     the impact of possible vulnerabilities in Privoxy to the files contained in
1008     that hierarchy. Unix only.
1009    
1010   * configfile
1011    
1012     If no configfile is included on the command line, Privoxy will look for a
1013     file named "config" in the current directory (except on Win32 where it will
1014     look for "config.txt" instead). Specify full path to avoid confusion. If no
1015     config file is found, Privoxy will fail to start.
1016    
1017 On MS Windows only there are two additional command-line options to allow
1018 Privoxy to install and run as a service. See the Window Installation section
1019 for details.
1020
1021 -------------------------------------------------------------------------------
1022
1023 6. Privoxy Configuration
1024
1025 All Privoxy configuration is stored in text files. These files can be edited
1026 with a text editor. Many important aspects of Privoxy can also be controlled
1027 easily with a web browser.
1028
1029 -------------------------------------------------------------------------------
1030
1031 6.1. Controlling Privoxy with Your Web Browser
1032
1033 Privoxy's user interface can be reached through the special URL http://
1034 config.privoxy.org/ (shortcut: http://p.p/), which is a built-in page and works
1035 without Internet access. You will see the following section: 
1036
1037      Privoxy Menu                                                              
1038         ?  View & change the current configuration                             
1039         ?  View the source code version numbers                                
1040         ?  View the request headers.                                           
1041         ?  Look up which actions apply to a URL and why                        
1042         ?  Toggle Privoxy on or off                                            
1043         ?  Documentation                                                       
1044                                                                                
1045
1046 This should be self-explanatory. Note the first item leads to an editor for the
1047 actions files, which is where the ad, banner, cookie, and URL blocking magic is
1048 configured as well as other advanced features of Privoxy. This is an easy way
1049 to adjust various aspects of Privoxy configuration. The actions file, and other
1050 configuration files, are explained in detail below.
1051
1052 "Toggle Privoxy On or Off" is handy for sites that might have problems with
1053 your current actions and filters. You can in fact use it as a test to see
1054 whether it is Privoxy causing the problem or not. Privoxy continues to run as a
1055 proxy in this case, but all manipulation is disabled, i.e. Privoxy acts like a
1056 normal forwarding proxy. There is even a toggle Bookmarklet offered, so that
1057 you can toggle Privoxy with one click from your browser.
1058
1059 -------------------------------------------------------------------------------
1060
1061 6.2. Configuration Files Overview
1062
1063 For Unix, *BSD and Linux, all configuration files are located in /etc/privoxy/
1064 by default. For MS Windows, OS/2, and AmigaOS these are all in the same
1065 directory as the Privoxy executable. The name and number of configuration files
1066 has changed from previous versions, and is subject to change as development
1067 progresses.
1068
1069 The installed defaults provide a reasonable starting point, though some
1070 settings may be aggressive by some standards. For the time being, the principle
1071 configuration files are:
1072
1073   * The main configuration file is named config on Linux, Unix, BSD, OS/2, and
1074     AmigaOS and config.txt on Windows. This is a required file.
1075    
1076   * default.action (the main actions file) is used to define which "actions"
1077     relating to banner-blocking, images, pop-ups, content modification, cookie
1078     handling etc should be applied by default. It also defines many exceptions
1079     (both positive and negative) from this default set of actions that enable
1080     Privoxy to selectively eliminate the junk, and only the junk, on as many
1081     websites as possible.
1082    
1083     Multiple actions files may be defined in config. These are processed in the
1084     order they are defined. Local customizations and locally preferred
1085     exceptions to the default policies as defined in default.action (which you
1086     will most probably want to define sooner or later) are probably best
1087     applied in user.action, where you can preserve them across upgrades.
1088     standard.action is for Privoxy's internal use.
1089    
1090     There is also a web based editor that can be accessed from http://
1091     config.privoxy.org/show-status (Shortcut: http://p.p/show-status) for the
1092     various actions files.
1093    
1094   * "Filter files" (the filter file) can be used to re-write the raw page
1095     content, including viewable text as well as embedded HTML and JavaScript,
1096     and whatever else lurks on any given web page. The filtering jobs are only
1097     pre-defined here; whether to apply them or not is up to the actions files.
1098     default.filter includes various filters made available for use by the
1099     developers. Some are much more intrusive than others, and all should be
1100     used with caution. You may define additional filter files in config as you
1101     can with actions files. We suggest user.filter for any locally defined
1102     filters or customizations.
1103    
1104 The syntax of all configuration files has remained the same throughout the 3.x
1105 series. There have been enhancements, but no changes that would preclude the
1106 use of any configuration file from one version to the next. (There is one
1107 exception: +fast-redirects which has enhanced syntax and will require updating
1108 any local configs from earlier versions.)
1109
1110 All files use the "#" character to denote a comment (the rest of the line will
1111 be ignored) and understand line continuation through placing a backslash ("\")
1112 as the very last character in a line. If the # is preceded by a backslash, it
1113 looses its special function. Placing a # in front of an otherwise valid
1114 configuration line to prevent it from being interpreted is called "commenting
1115 out" that line. Blank lines are ignored.
1116
1117 The actions files and filter files can use Perl style regular expressions for
1118 maximum flexibility.
1119
1120 After making any changes, there is no need to restart Privoxy in order for the
1121 changes to take effect. Privoxy detects such changes automatically. Note,
1122 however, that it may take one or two additional requests for the change to take
1123 effect. When changing the listening address of Privoxy, these "wake up"
1124 requests must obviously be sent to the old listening address.
1125
1126 While under development, the configuration content is subject to change. The
1127 below documentation may not be accurate by the time you read this. Also, what
1128 constitutes a "default" setting, may change, so please check all your
1129 configuration files on important issues.
1130
1131 -------------------------------------------------------------------------------
1132
1133 7. The Main Configuration File
1134
1135 Again, the main configuration file is named config on Linux/Unix/BSD and OS/2,
1136 and config.txt on Windows. Configuration lines consist of an initial keyword
1137 followed by a list of values, all separated by whitespace (any number of spaces
1138 or tabs). For example:
1139
1140   confdir /etc/privoxy
1141
1142 Assigns the value /etc/privoxy to the option confdir and thus indicates that
1143 the configuration directory is named "/etc/privoxy/".
1144
1145 All options in the config file except for confdir and logdir are optional.
1146 Watch out in the below description for what happens if you leave them unset.
1147
1148 The main config file controls all aspects of Privoxy's operation that are not
1149 location dependent (i.e. they apply universally, no matter where you may be
1150 surfing).
1151
1152 -------------------------------------------------------------------------------
1153
1154 7.1. Local Set-up Documentation
1155
1156 If you intend to operate Privoxy for more users than just yourself, it might be
1157 a good idea to let them know how to reach you, what you block and why you do
1158 that, your policies, etc.
1159
1160 -------------------------------------------------------------------------------
1161
1162 7.1.1. user-manual
1163
1164 Specifies:
1165    
1166     Location of the Privoxy User Manual.
1167    
1168 Type of value:
1169    
1170     A fully qualified URI
1171    
1172 Default value:
1173    
1174     Unset
1175    
1176 Effect if unset:
1177    
1178     http://www.privoxy.org/version/user-manual/ will be used, where version is
1179     the Privoxy version.
1180    
1181 Notes:
1182    
1183     The User Manual URI is the single best source of information on Privoxy,
1184     and is used for help links from some of the internal CGI pages. The manual
1185     itself is normally packaged with the binary distributions, so you probably
1186     want to set this to a locally installed copy.
1187    
1188     Examples:
1189    
1190     The best all purpose solution is simply to put the full local PATH to where
1191     the User Manual is located:
1192    
1193       user-manual  /usr/share/doc/privoxy/user-manual                  
1194    
1195     The User Manual is then available to anyone with access to the proxy, by
1196     following the built-in URL: http://config.privoxy.org/user-manual/ (or the
1197     shortcut: http://p.p/user-manual/).
1198    
1199     If the documentation is not on the local system, it can be accessed from a
1200     remote server, as:
1201    
1202       user-manual  http://example.com/privoxy/user-manual/             
1203    
1204     +-----------------------------------------------------------------+
1205     |                             Warning                             |
1206     |-----------------------------------------------------------------|
1207     |If set, this option should be the first option in the config     |
1208     |file, because it is used while the config file is being read on  |
1209     |start-up.                                                        |
1210     +-----------------------------------------------------------------+
1211
1212 -------------------------------------------------------------------------------
1213
1214 7.1.2. trust-info-url
1215
1216 Specifies:
1217    
1218     A URL to be displayed in the error page that users will see if access to an
1219     untrusted page is denied.
1220    
1221 Type of value:
1222    
1223     URL
1224    
1225 Default value:
1226    
1227     Two example URL are provided
1228    
1229 Effect if unset:
1230    
1231     No links are displayed on the "untrusted" error page.
1232    
1233 Notes:
1234    
1235     The value of this option only matters if the experimental trust mechanism
1236     has been activated. (See trustfile above.)
1237    
1238     If you use the trust mechanism, it is a good idea to write up some on-line
1239     documentation about your trust policy and to specify the URL(s) here. Use
1240     multiple times for multiple URLs.
1241    
1242     The URL(s) should be added to the trustfile as well, so users don't end up
1243     locked out from the information on why they were locked out in the first
1244     place!
1245    
1246 -------------------------------------------------------------------------------
1247
1248 7.1.3. admin-address
1249
1250 Specifies:
1251    
1252     An email address to reach the proxy administrator.
1253    
1254 Type of value:
1255    
1256     Email address
1257    
1258 Default value:
1259    
1260     Unset
1261    
1262 Effect if unset:
1263    
1264     No email address is displayed on error pages and the CGI user interface.
1265    
1266 Notes:
1267    
1268     If both admin-address and proxy-info-url are unset, the whole "Local
1269     Privoxy Support" box on all generated pages will not be shown.
1270    
1271 -------------------------------------------------------------------------------
1272
1273 7.1.4. proxy-info-url
1274
1275 Specifies:
1276    
1277     A URL to documentation about the local Privoxy setup, configuration or
1278     policies.
1279    
1280 Type of value:
1281    
1282     URL
1283    
1284 Default value:
1285    
1286     Unset
1287    
1288 Effect if unset:
1289    
1290     No link to local documentation is displayed on error pages and the CGI user
1291     interface.
1292    
1293 Notes:
1294    
1295     If both admin-address and proxy-info-url are unset, the whole "Local
1296     Privoxy Support" box on all generated pages will not be shown.
1297    
1298     This URL shouldn't be blocked ;-)
1299    
1300 -------------------------------------------------------------------------------
1301
1302 7.2. Configuration and Log File Locations
1303
1304 Privoxy can (and normally does) use a number of other files for additional
1305 configuration, help and logging. This section of the configuration file tells
1306 Privoxy where to find those other files.
1307
1308 The user running Privoxy, must have read permission for all configuration
1309 files, and write permission to any files that would be modified, such as log
1310 files and actions files.
1311
1312 -------------------------------------------------------------------------------
1313
1314 7.2.1. confdir
1315
1316 Specifies:
1317    
1318     The directory where the other configuration files are located
1319    
1320 Type of value:
1321    
1322     Path name
1323    
1324 Default value:
1325    
1326     /etc/privoxy (Unix) or Privoxy installation dir (Windows)
1327    
1328 Effect if unset:
1329    
1330     Mandatory
1331    
1332 Notes:
1333    
1334     No trailing "/", please
1335    
1336 -------------------------------------------------------------------------------
1337
1338 7.2.2. logdir
1339
1340 Specifies:
1341    
1342     The directory where all logging takes place (i.e. where logfile and jarfile
1343     are located)
1344    
1345 Type of value:
1346    
1347     Path name
1348    
1349 Default value:
1350    
1351     /var/log/privoxy (Unix) or Privoxy installation dir (Windows)
1352    
1353 Effect if unset:
1354    
1355     Mandatory
1356    
1357 Notes:
1358    
1359     No trailing "/", please
1360    
1361 -------------------------------------------------------------------------------
1362
1363 7.2.3. actionsfile
1364
1365 Specifies:
1366    
1367     The actions file(s) to use
1368    
1369 Type of value:
1370    
1371     File name, relative to confdir, without the .action suffix
1372    
1373 Default values:
1374    
1375       standard     # Internal purposes, no editing recommended
1376                                                               
1377       default      # Main actions file                        
1378                                                               
1379       user         # User customizations                      
1380    
1381 Effect if unset:
1382    
1383     No actions are taken at all. Simple neutral proxying.
1384    
1385 Notes:
1386    
1387     Multiple actionsfile lines are permitted, and are in fact recommended!
1388    
1389     The default values include standard.action, which is used for internal
1390     purposes and should be loaded, default.action, which is the "main" actions
1391     file maintained by the developers, and user.action, where you can make your
1392     personal additions.
1393    
1394     Actions files are where all the per site and per URL configuration is done
1395     for ad blocking, cookie management, privacy considerations, etc. There is
1396     no point in using Privoxy without at least one actions file.
1397    
1398 -------------------------------------------------------------------------------
1399
1400 7.2.4. filterfile
1401
1402 Specifies:
1403    
1404     The filter file(s) to use
1405    
1406 Type of value:
1407    
1408     File name, relative to confdir
1409    
1410 Default value:
1411    
1412     default.filter (Unix) or default.filter.txt (Windows)
1413    
1414 Effect if unset:
1415    
1416     No textual content filtering takes place, i.e. all +filter{name} actions in
1417     the actions files are turned neutral.
1418    
1419 Notes:
1420    
1421     Multiple filterfile lines are permitted.
1422    
1423     The filter files contain content modification rules that use regular
1424     expressions. These rules permit powerful changes on the content of Web
1425     pages, and optionally the headers as well, e.g., you could disable your
1426     favorite JavaScript annoyances, re-write the actual displayed text, or just
1427     have some fun playing buzzword bingo with web pages.
1428    
1429     The +filter{name} actions rely on the relevant filter (name) to be defined
1430     in a filter file!
1431    
1432     A pre-defined filter file called default.filter that contains a number of
1433     useful filters for common problems is included in the distribution. See the
1434     section on the filter action for a list.
1435    
1436     It is recommended to place any locally adapted filters into a separate
1437     file, such as user.filter.
1438    
1439 -------------------------------------------------------------------------------
1440
1441 7.2.5. logfile
1442
1443 Specifies:
1444    
1445     The log file to use
1446    
1447 Type of value:
1448    
1449     File name, relative to logdir
1450    
1451 Default value:
1452    
1453     logfile (Unix) or privoxy.log (Windows)
1454    
1455 Effect if unset:
1456    
1457     No log file is used, all log messages go to the console (STDERR).
1458    
1459 Notes:
1460    
1461     The logfile is where all logging and error messages are written. The level
1462     of detail and number of messages are set with the debug option (see below).
1463     The logfile can be useful for tracking down a problem with Privoxy (e.g.,
1464     it's not blocking an ad you think it should block) but in most cases you
1465     probably will never look at it.
1466    
1467     Your logfile will grow indefinitely, and you will probably want to
1468     periodically remove it. On Unix systems, you can do this with a cron job
1469     (see "man cron"). For Red Hat, a logrotate script has been included.
1470    
1471     On SuSE Linux systems, you can place a line like "/var/log/privoxy.* +1024k
1472     644 nobody.nogroup" in /etc/logfiles, with the effect that cron.daily will
1473     automatically archive, gzip, and empty the log, when it exceeds 1M size.
1474    
1475     Any log files must be writable by whatever user Privoxy is being run as
1476     (default on UNIX, user id is "privoxy").
1477    
1478 -------------------------------------------------------------------------------
1479
1480 7.2.6. jarfile
1481
1482 Specifies:
1483    
1484     The file to store intercepted cookies in
1485    
1486 Type of value:
1487    
1488     File name, relative to logdir
1489    
1490 Default value:
1491    
1492     Unset (commented out). When activated: jarfile (Unix) or privoxy.jar
1493     (Windows)
1494    
1495 Effect if unset:
1496    
1497     Intercepted cookies are not stored in a dedicated log file.
1498    
1499 Notes:
1500    
1501     The jarfile may grow to ridiculous sizes over time.
1502    
1503     If debug 8 (show header parsing) is enabled, cookies are written to the
1504     logfile with the rest of the headers.
1505    
1506 -------------------------------------------------------------------------------
1507
1508 7.2.7. trustfile
1509
1510 Specifies:
1511    
1512     The name of the trust file to use
1513    
1514 Type of value:
1515    
1516     File name, relative to confdir
1517    
1518 Default value:
1519    
1520     Unset (commented out). When activated: trust (Unix) or trust.txt (Windows)
1521    
1522 Effect if unset:
1523    
1524     The entire trust mechanism is disabled.
1525    
1526 Notes:
1527    
1528     The trust mechanism is an experimental feature for building white-lists and
1529     should be used with care. It is NOT recommended for the casual user.
1530    
1531     If you specify a trust file, Privoxy will only allow access to sites that
1532     are specified in the trustfile. Sites can be listed in one of two ways:
1533    
1534     Prepending a ~ character limits access to this site only (and any sub-paths
1535     within this site), e.g. ~www.example.com allows access to ~www.example.com/
1536     features/news.html, etc.
1537    
1538     Or, you can designate sites as trusted referrers, by prepending the name
1539     with a + character. The effect is that access to untrusted sites will be
1540     granted -- but only if a link from this trusted referrer was used to get
1541     there. The link target will then be added to the "trustfile" so that
1542     future, direct accesses will be granted. Sites added via this mechanism do
1543     not become trusted referrers themselves (i.e. they are added with a ~
1544     designation). There is a limit of 512 such entries, after which new entries
1545     will not be made.
1546    
1547     If you use the + operator in the trust file, it may grow considerably over
1548     time.
1549    
1550     It is recommended that Privoxy be compiled with the --disable-force,
1551     --disable-toggle and --disable-editor options, if this feature is to be
1552     used.
1553    
1554     Possible applications include limiting Internet access for children.
1555    
1556 -------------------------------------------------------------------------------
1557
1558 7.3. Debugging
1559
1560 These options are mainly useful when tracing a problem. Note that you might
1561 also want to invoke Privoxy with the --no-daemon command line option when
1562 debugging.
1563
1564 -------------------------------------------------------------------------------
1565
1566 7.3.1. debug
1567
1568 Specifies:
1569    
1570     Key values that determine what information gets logged to the logfile.
1571    
1572 Type of value:
1573    
1574     Integer values
1575    
1576 Default value:
1577    
1578     12289 (i.e.: URLs plus informational and warning messages)
1579    
1580 Effect if unset:
1581    
1582     Nothing gets logged.
1583    
1584 Notes:
1585    
1586     The available debug levels are:
1587    
1588       debug         1 # show each GET/POST/CONNECT request             
1589       debug         2 # show each connection status                    
1590       debug         4 # show I/O status                                
1591       debug         8 # show header parsing                            
1592       debug        16 # log all data into the logfile                  
1593       debug        32 # debug force feature                            
1594       debug        64 # debug regular expression filter                
1595       debug       128 # debug fast redirects                           
1596       debug       256 # debug GIF de-animation                         
1597       debug       512 # Common Log Format                              
1598       debug      1024 # debug kill pop-ups                             
1599       debug      2048 # CGI user interface                             
1600       debug      4096 # Startup banner and warnings.                   
1601       debug      8192 # Non-fatal errors                               
1602    
1603     To select multiple debug levels, you can either add them or use multiple
1604     debug lines.
1605    
1606     A debug level of 1 is informative because it will show you each request as
1607     it happens. 1, 4096 and 8192 are highly recommended so that you will notice
1608     when things go wrong. The other levels are probably only of interest if you
1609     are hunting down a specific problem. They can produce a hell of an output
1610     (especially 16).
1611    
1612     The reporting of fatal errors (i.e. ones which crash Privoxy) is always on
1613     and cannot be disabled.
1614    
1615     If you want to use CLF (Common Log Format), you should set "debug 512" ONLY
1616     and not enable anything else.
1617    
1618 -------------------------------------------------------------------------------
1619
1620 7.3.2. single-threaded
1621
1622 Specifies:
1623    
1624     Whether to run only one server thread
1625    
1626 Type of value:
1627    
1628     None
1629    
1630 Default value:
1631    
1632     Unset
1633    
1634 Effect if unset:
1635    
1636     Multi-threaded (or, where unavailable: forked) operation, i.e. the ability
1637     to serve multiple requests simultaneously.
1638    
1639 Notes:
1640    
1641     This option is only there for debug purposes and you should never need to
1642     use it. It will drastically reduce performance.
1643    
1644 -------------------------------------------------------------------------------
1645
1646 7.4. Access Control and Security
1647
1648 This section of the config file controls the security-relevant aspects of
1649 Privoxy's configuration.
1650
1651 -------------------------------------------------------------------------------
1652
1653 7.4.1. listen-address
1654
1655 Specifies:
1656    
1657     The IP address and TCP port on which Privoxy will listen for client
1658     requests.
1659    
1660 Type of value:
1661    
1662     [IP-Address]:Port
1663    
1664 Default value:
1665    
1666     127.0.0.1:8118
1667    
1668 Effect if unset:
1669    
1670     Bind to 127.0.0.1 (localhost), port 8118. This is suitable and recommended
1671     for home users who run Privoxy on the same machine as their browser.
1672    
1673 Notes:
1674    
1675     You will need to configure your browser(s) to this proxy address and port.
1676    
1677     If you already have another service running on port 8118, or if you want to
1678     serve requests from other machines (e.g. on your local network) as well,
1679     you will need to override the default.
1680    
1681     If you leave out the IP address, Privoxy will bind to all interfaces
1682     (addresses) on your machine and may become reachable from the Internet. In
1683     that case, consider using access control lists (ACL's, see below), and/or a
1684     firewall.
1685    
1686     If you open Privoxy to untrusted users, you will also want to turn off the 
1687     enable-edit-actions and enable-remote-toggle options!
1688    
1689 Example:
1690    
1691     Suppose you are running Privoxy on a machine which has the address
1692     192.168.0.1 on your local private network (192.168.0.0) and has another
1693     outside connection with a different address. You want it to serve requests
1694     from inside only:
1695    
1696       listen-address  192.168.0.1:8118                                 
1697    
1698 -------------------------------------------------------------------------------
1699
1700 7.4.2. toggle
1701
1702 Specifies:
1703    
1704     Initial state of "toggle" status
1705    
1706 Type of value:
1707    
1708     1 or 0
1709    
1710 Default value:
1711    
1712     1
1713    
1714 Effect if unset:
1715    
1716     Act as if toggled on
1717    
1718 Notes:
1719    
1720     If set to 0, Privoxy will start in "toggled off" mode, i.e. behave like a
1721     normal, content-neutral proxy where all ad blocking, filtering, etc are
1722     disabled. See enable-remote-toggle below. This is not really useful
1723     anymore, since toggling is much easier via the web interface than via
1724     editing the conf file.
1725    
1726     The windows version will only display the toggle icon in the system tray if
1727     this option is present.
1728    
1729 -------------------------------------------------------------------------------
1730
1731 7.4.3. enable-remote-toggle
1732
1733 Specifies:
1734    
1735     Whether or not the web-based toggle feature may be used
1736    
1737 Type of value:
1738    
1739     0 or 1
1740    
1741 Default value:
1742    
1743     1
1744    
1745 Effect if unset:
1746    
1747     The web-based toggle feature is disabled.
1748    
1749 Notes:
1750    
1751     When toggled off, Privoxy acts like a normal, content-neutral proxy, i.e.
1752     it acts as if none of the actions applied to any URL.
1753    
1754     For the time being, access to the toggle feature can not be controlled
1755     separately by "ACLs" or HTTP authentication, so that everybody who can
1756     access Privoxy (see "ACLs" and listen-address above) can toggle it for all
1757     users. So this option is not recommended for multi-user environments with
1758     untrusted users.
1759    
1760     Note that you must have compiled Privoxy with support for this feature,
1761     otherwise this option has no effect.
1762    
1763 -------------------------------------------------------------------------------
1764
1765 7.4.4. enable-remote-http-toggle
1766
1767 Specifies:
1768    
1769     Whether or not Privoxy recognizes special HTTP headers to change its
1770     behaviour.
1771    
1772 Type of value:
1773    
1774     0 or 1
1775    
1776 Default value:
1777    
1778     1
1779    
1780 Effect if unset:
1781    
1782     Privoxy ignores special HTTP headers.
1783    
1784 Notes:
1785    
1786     When toggled on, the client can change Privoxy's behaviour by setting
1787     special HTTP headers. Currently the only supported special header is
1788     "X-Filter: No", to disable filtering for the ongoing request, even if it is
1789     enabled in one of the action files.
1790    
1791     If you are using Privoxy in a multi-user environment or with untrustworthy
1792     clients and want to enforce filtering, you will have to disable this
1793     option, otherwise you can ignore it.
1794    
1795 -------------------------------------------------------------------------------
1796
1797 7.4.5. enable-edit-actions
1798
1799 Specifies:
1800    
1801     Whether or not the web-based actions file editor may be used
1802    
1803 Type of value:
1804    
1805     0 or 1
1806    
1807 Default value:
1808    
1809     1
1810    
1811 Effect if unset:
1812    
1813     The web-based actions file editor is disabled.
1814    
1815 Notes:
1816    
1817     For the time being, access to the editor can not be controlled separately
1818     by "ACLs" or HTTP authentication, so that everybody who can access Privoxy
1819     (see "ACLs" and listen-address above) can modify its configuration for all
1820     users. So this option is not recommended for multi-user environments with
1821     untrusted users.
1822    
1823     Note that you must have compiled Privoxy with support for this feature,
1824     otherwise this option has no effect.
1825    
1826 -------------------------------------------------------------------------------
1827
1828 7.4.6. ACLs: permit-access and deny-access
1829
1830 Specifies:
1831    
1832     Who can access what.
1833    
1834 Type of value:
1835    
1836     src_addr[/src_masklen] [dst_addr[/dst_masklen]]
1837    
1838     Where src_addr and dst_addr are IP addresses in dotted decimal notation or
1839     valid DNS names, and src_masklen and dst_masklen are subnet masks in CIDR
1840     notation, i.e. integer values from 2 to 30 representing the length (in
1841     bits) of the network address. The masks and the whole destination part are
1842     optional.
1843    
1844 Default value:
1845    
1846     Unset
1847    
1848 Effect if unset:
1849    
1850     Don't restrict access further than implied by listen-address
1851    
1852 Notes:
1853    
1854     Access controls are included at the request of ISPs and systems
1855     administrators, and are not usually needed by individual users. For a
1856     typical home user, it will normally suffice to ensure that Privoxy only
1857     listens on the localhost (127.0.0.1) or internal (home) network address by
1858     means of the listen-address option.
1859    
1860     Please see the warnings in the FAQ that this proxy is not intended to be a
1861     substitute for a firewall or to encourage anyone to defer addressing basic
1862     security weaknesses.
1863    
1864     Multiple ACL lines are OK. If any ACLs are specified, then the Privoxy
1865     talks only to IP addresses that match at least one permit-access line and
1866     don't match any subsequent deny-access line. In other words, the last match
1867     wins, with the default being deny-access.
1868    
1869     If Privoxy is using a forwarder (see forward below) for a particular
1870     destination URL, the dst_addr that is examined is the address of the
1871     forwarder and NOT the address of the ultimate target. This is necessary
1872     because it may be impossible for the local Privoxy to determine the IP
1873     address of the ultimate target (that's often what gateways are used for).
1874    
1875     You should prefer using IP addresses over DNS names, because the address
1876     lookups take time. All DNS names must resolve! You can not use domain
1877     patterns like "*.org" or partial domain names. If a DNS name resolves to
1878     multiple IP addresses, only the first one is used.
1879    
1880     Denying access to particular sites by ACL may have undesired side effects
1881     if the site in question is hosted on a machine which also hosts other
1882     sites.
1883    
1884 Examples:
1885    
1886     Explicitly define the default behavior if no ACL and listen-address are
1887     set: "localhost" is OK. The absence of a dst_addr implies that all
1888     destination addresses are OK:
1889    
1890       permit-access  localhost                                         
1891    
1892     Allow any host on the same class C subnet as www.privoxy.org access to
1893     nothing but www.example.com:
1894    
1895       permit-access  www.privoxy.org/24 www.example.com/32             
1896    
1897     Allow access from any host on the 26-bit subnet 192.168.45.64 to anywhere,
1898     with the exception that 192.168.45.73 may not access
1899     www.dirty-stuff.example.com:
1900    
1901       permit-access  192.168.45.64/26                                  
1902       deny-access    192.168.45.73    www.dirty-stuff.example.com      
1903    
1904 -------------------------------------------------------------------------------
1905
1906 7.4.7. buffer-limit
1907
1908 Specifies:
1909    
1910     Maximum size of the buffer for content filtering.
1911    
1912 Type of value:
1913    
1914     Size in Kbytes
1915    
1916 Default value:
1917    
1918     4096
1919    
1920 Effect if unset:
1921    
1922     Use a 4MB (4096 KB) limit.
1923    
1924 Notes:
1925    
1926     For content filtering, i.e. the +filter and +deanimate-gif actions, it is
1927     necessary that Privoxy buffers the entire document body. This can be
1928     potentially dangerous, since a server could just keep sending data
1929     indefinitely and wait for your RAM to exhaust -- with nasty consequences.
1930     Hence this option.
1931    
1932     When a document buffer size reaches the buffer-limit, it is flushed to the
1933     client unfiltered and no further attempt to filter the rest of the document
1934     is made. Remember that there may be multiple threads running, which might
1935     require up to buffer-limit Kbytes each, unless you have enabled
1936     "single-threaded" above.
1937    
1938 -------------------------------------------------------------------------------
1939
1940 7.5. Forwarding
1941
1942 This feature allows routing of HTTP requests through a chain of multiple
1943 proxies. It can be used to better protect privacy and confidentiality when
1944 accessing specific domains by routing requests to those domains through an
1945 anonymous public proxy. Or to use a caching proxy to speed up browsing. Or
1946 chaining to a parent proxy may be necessary because the machine that Privoxy
1947 runs on has no direct Internet access.
1948
1949 Also specified here are SOCKS proxies. Privoxy supports the SOCKS 4 and SOCKS
1950 4A protocols.
1951
1952 -------------------------------------------------------------------------------
1953
1954 7.5.1. forward
1955
1956 Specifies:
1957    
1958     To which parent HTTP proxy specific requests should be routed.
1959    
1960 Type of value:
1961    
1962     target_pattern http_parent[:port]
1963    
1964     where target_pattern is a URL pattern that specifies to which requests
1965     (i.e. URLs) this forward rule shall apply. Use / to denote "all URLs".
1966     http_parent[:port] is the DNS name or IP address of the parent HTTP proxy
1967     through which the requests should be forwarded, optionally followed by its
1968     listening port (default: 8080). Use a single dot (.) to denote "no
1969     forwarding".
1970    
1971 Default value:
1972    
1973     Unset
1974    
1975 Effect if unset:
1976    
1977     Don't use parent HTTP proxies.
1978    
1979 Notes:
1980    
1981     If http_parent is ".", then requests are not forwarded to another HTTP
1982     proxy but are made directly to the web servers.
1983    
1984     Multiple lines are OK, they are checked in sequence, and the last match
1985     wins.
1986    
1987 Examples:
1988    
1989     Everything goes to an example anonymizing proxy, except SSL on port 443
1990     (which it doesn't handle):
1991    
1992       forward   /      anon-proxy.example.org:8080                     
1993       forward   :443   .                                               
1994    
1995     Everything goes to our example ISP's caching proxy, except for requests to
1996     that ISP's sites:
1997    
1998       forward   /                  caching-proxy.example-isp.net:8000  
1999       forward   .example-isp.net   .                                   
2000    
2001 -------------------------------------------------------------------------------
2002
2003 7.5.2. forward-socks4 and forward-socks4a
2004
2005 Specifies:
2006    
2007     Through which SOCKS proxy (and to which parent HTTP proxy) specific
2008     requests should be routed.
2009    
2010 Type of value:
2011    
2012     target_pattern socks_proxy[:port] http_parent[:port]
2013    
2014     where target_pattern is a URL pattern that specifies to which requests
2015     (i.e. URLs) this forward rule shall apply. Use / to denote "all URLs".
2016     http_parent and socks_proxy are IP addresses in dotted decimal notation or
2017     valid DNS names (http_parent may be "." to denote "no HTTP forwarding"),
2018     and the optional port parameters are TCP ports, i.e. integer values from 1
2019     to 64535
2020    
2021 Default value:
2022    
2023     Unset
2024    
2025 Effect if unset:
2026    
2027     Don't use SOCKS proxies.
2028    
2029 Notes:
2030    
2031     Multiple lines are OK, they are checked in sequence, and the last match
2032     wins.
2033    
2034     The difference between forward-socks4 and forward-socks4a is that in the
2035     SOCKS 4A protocol, the DNS resolution of the target hostname happens on the
2036     SOCKS server, while in SOCKS 4 it happens locally.
2037    
2038     If http_parent is ".", then requests are not forwarded to another HTTP
2039     proxy but are made (HTTP-wise) directly to the web servers, albeit through
2040     a SOCKS proxy.
2041    
2042 Examples:
2043    
2044     From the company example.com, direct connections are made to all "internal"
2045     domains, but everything outbound goes through their ISP's proxy by way of
2046     example.com's corporate SOCKS 4A gateway to the Internet.
2047    
2048       forward-socks4a   /              socks-gw.example.com:1080  www-cache.example-isp.net:8080 
2049       forward           .example.com   .                                                         
2050    
2051     A rule that uses a SOCKS 4 gateway for all destinations but no HTTP parent
2052     looks like this:
2053    
2054       forward-socks4   /               socks-gw.example.com:1080  .    
2055    
2056     To chain Privoxy and Tor, both running on the same system, you should use
2057     the rule:
2058    
2059       forward-socks4   /               127.0.0.1:9050 .                
2060    
2061     The public Tor network can't be used to reach your local network, therefore
2062     it's a good idea to make some exceptions:
2063    
2064       forward         192.168.*.*/     .                               
2065       forward            10.*.*.*/     .                               
2066       forward           127.*.*.*/     .                               
2067    
2068     Unencrypted connections to systems in these address ranges will be as (un)
2069     secure as the local network is, but the alternative is that you can't reach
2070     the network at all.
2071    
2072     If you also want to be able to reach servers in your local network by using
2073     their names, you will need additional exceptions that look like this:
2074    
2075      forward           localhost/     .                                
2076    
2077 -------------------------------------------------------------------------------
2078
2079 7.5.3. Advanced Forwarding Examples
2080
2081 If you have links to multiple ISPs that provide various special content only to
2082 their subscribers, you can configure multiple Privoxies which have connections
2083 to the respective ISPs to act as forwarders to each other, so that your users
2084 can see the internal content of all ISPs.
2085
2086 Assume that host-a has a PPP connection to isp-a.net. And host-b has a PPP
2087 connection to isp-b.net. Both run Privoxy. Their forwarding configuration can
2088 look like this:
2089
2090 host-a:
2091
2092   forward    /           .                                                     
2093   forward    .isp-b.net  host-b:8118                                           
2094
2095 host-b:
2096
2097   forward    /           .                                                     
2098   forward    .isp-a.net  host-a:8118                                           
2099
2100 Now, your users can set their browser's proxy to use either host-a or host-b
2101 and be able to browse the internal content of both isp-a and isp-b.
2102
2103 If you intend to chain Privoxy and squid locally, then chain as browser ->
2104 squid -> privoxy is the recommended way.
2105
2106 Assuming that Privoxy and squid run on the same box, your squid configuration
2107 could then look like this:
2108
2109   # Define Privoxy as parent proxy (without ICP)                               
2110   cache_peer 127.0.0.1 parent 8118 7 no-query                                  
2111                                                                                
2112   # Define ACL for protocol FTP                                                
2113   acl ftp proto FTP                                                            
2114                                                                                
2115   # Do not forward FTP requests to Privoxy                                     
2116   always_direct allow ftp                                                      
2117                                                                                
2118   # Forward all the rest to Privoxy                                            
2119   never_direct allow all                                                       
2120
2121 You would then need to change your browser's proxy settings to squid's address
2122 and port. Squid normally uses port 3128. If unsure consult http_port in
2123 squid.conf.
2124
2125 You could just as well decide to only forward requests for Windows executables
2126 through a virus-scanning parent proxy, say, on antivir.example.com, port 8010:
2127
2128   forward   /                          .                                       
2129   forward   /.*\.(exe|com|dll|zip)$    antivir.example.com:8010                
2130
2131 -------------------------------------------------------------------------------
2132
2133 7.5.4. forwarded-connect-retries
2134
2135 Specifies:
2136    
2137     How often Privoxy retries if a forwarded connection request fails.
2138    
2139 Type of value:
2140    
2141     Number of retries.
2142    
2143 Default value:
2144    
2145     0
2146    
2147 Effect if unset:
2148    
2149     Forwarded connections are treated like direct connections and no retry
2150     attempts are made.
2151    
2152 Notes:
2153    
2154     forwarded-connect-retries is mainly interesting for socks4a connections,
2155     where Privoxy can't detect why the connections failed. The connection might
2156     have failed because of a DNS timeout in which case a retry makes sense, but
2157     it might also have failed because the server doesn't exist or isn't
2158     reachable. In this case the retry will just delay the appearance of
2159     Privoxy's error message.
2160    
2161     Only use this option, if you are getting many forwarding related error
2162     messages, that go away when you try again manually. Start with a small
2163     value and check Privoxy's logfile from time to time, to see how many
2164     retries are usually needed.
2165    
2166 Examples:
2167    
2168     forwarded-connect-retries 1
2169    
2170 -------------------------------------------------------------------------------
2171
2172 7.6. Windows GUI Options
2173
2174 Privoxy has a number of options specific to the Windows GUI interface:
2175
2176 If "activity-animation" is set to 1, the Privoxy icon will animate when
2177 "Privoxy" is active. To turn off, set to 0.
2178
2179   activity-animation 1
2180    
2181
2182 If "log-messages" is set to 1, Privoxy will log messages to the console window:
2183
2184   log-messages 1
2185    
2186
2187 If "log-buffer-size" is set to 1, the size of the log buffer, i.e. the amount
2188 of memory used for the log messages displayed in the console window, will be
2189 limited to "log-max-lines" (see below).
2190
2191 Warning: Setting this to 0 will result in the buffer to grow infinitely and eat
2192 up all your memory!
2193
2194   log-buffer-size 1
2195    
2196
2197 log-max-lines is the maximum number of lines held in the log buffer. See above.
2198
2199   log-max-lines 200
2200    
2201
2202 If "log-highlight-messages" is set to 1, Privoxy will highlight portions of the
2203 log messages with a bold-faced font:
2204
2205   log-highlight-messages 1
2206    
2207
2208 The font used in the console window:
2209
2210   log-font-name Comic Sans MS
2211    
2212
2213 Font size used in the console window:
2214
2215   log-font-size 8
2216    
2217
2218 "show-on-task-bar" controls whether or not Privoxy will appear as a button on
2219 the Task bar when minimized:
2220
2221   show-on-task-bar 0
2222    
2223
2224 If "close-button-minimizes" is set to 1, the Windows close button will minimize
2225 Privoxy instead of closing the program (close with the exit option on the File
2226 menu).
2227
2228   close-button-minimizes 1
2229    
2230
2231 The "hide-console" option is specific to the MS-Win console version of Privoxy.
2232 If this option is used, Privoxy will disconnect from and hide the command
2233 console.
2234
2235   #hide-console
2236    
2237
2238 -------------------------------------------------------------------------------
2239
2240 8. Actions Files
2241
2242 The actions files are used to define what actions Privoxy takes for which URLs,
2243 and thus determines how ad images, cookies and various other aspects of HTTP
2244 content and transactions are handled, and on which sites (or even parts
2245 thereof). There are a number of such actions, with a wide range of
2246 functionality. Each action does something a little different. These actions
2247 give us a veritable arsenal of tools with which to exert our control,
2248 preferences and independence. Actions can be combined so that their effects are
2249 aggregated when applied against a given set of URLs.
2250
2251 There are three action files included with Privoxy with differing purposes:
2252
2253   * default.action - is the primary action file that sets the initial values
2254     for all actions. It is intended to provide a base level of functionality
2255     for Privoxy's array of features. So it is a set of broad rules that should
2256     work reasonably well as-is for most users. This is the file that the
2257     developers are keeping updated, and making available to users. The user's
2258     preferences as set in standard.action, e.g. either Cautious (the default),
2259     Medium, or Advanced (see below).
2260    
2261   * user.action - is intended to be for local site preferences and exceptions.
2262     As an example, if your ISP or your bank has specific requirements, and need
2263     special handling, this kind of thing should go here. This file will not be
2264     upgraded.
2265    
2266   * standard.action - is used by the web based editor at http://
2267     config.privoxy.org/edit-actions-list?f=default, to set various pre-defined
2268     sets of rules for the default actions section in default.action.
2269    
2270     Edit Set to Cautious Set to Medium Set to Advanced
2271    
2272     These have increasing levels of aggressiveness and have no influence on
2273     your browsing unless you select them explicitly in the editor. A default
2274     installation should be pre-set to Cautious (versions prior to 3.0.5 were
2275     set to Medium). New users should try this for a while before adjusting the
2276     settings to more aggressive levels.
2277    
2278     The Edit button allows you to turn each action on/off individually for
2279     fine-tuning. The Cautious button changes the actions list to low/safe
2280     settings which will activate a minimal set of Privoxy's features, and
2281     subsequently there will be less of a chance for accidental problems. The
2282     Medium button sets the list to a medium level of ad blocking and a low
2283     level set of privacy features. The Advanced button sets the list to a high
2284     level of ad blocking and medium level of privacy. See the chart below. The
2285     latter three buttons over-ride any changes via with the Edit button. More
2286     fine-tuning can be done in the lower sections of this internal page.
2287    
2288     It is not recommend to edit the standard.action file itself.
2289    
2290     The default profiles, and their associated actions, as pre-defined in
2291     standard.action are:
2292    
2293     Table 1. Default Configurations
2294    
2295     +-------------------------------------------------------------------------+
2296     |Feature           |Cautious         |Medium            |Advanced         |
2297     |------------------+-----------------+------------------+-----------------|
2298     |Ad-blocking       |medium           |high              |high             |
2299     |Aggressiveness    |                 |                  |                 |
2300     |------------------+-----------------+------------------+-----------------|
2301     |Ad-filtering by   |no               |yes               |yes              |
2302     |size              |                 |                  |                 |
2303     |------------------+-----------------+------------------+-----------------|
2304     |Ad-filtering by   |no               |no                |yes              |
2305     |link              |                 |                  |                 |
2306     |------------------+-----------------+------------------+-----------------|
2307     |Pop-up killing    |blocks only      |blocks only       |all              |
2308     |------------------+-----------------+------------------+-----------------|
2309     |Privacy Features  |low              |medium            |medium/high      |
2310     |------------------+-----------------+------------------+-----------------|
2311     |Cookie handling   |none             |session-only      |kill             |
2312     |------------------+-----------------+------------------+-----------------|
2313     |Referer forging   |no               |yes               |yes              |
2314     |------------------+-----------------+------------------+-----------------|
2315     |GIF de-animation  |no               |yes               |yes              |
2316     |------------------+-----------------+------------------+-----------------|
2317     |Fast redirects    |no               |no                |yes              |
2318     |------------------+-----------------+------------------+-----------------|
2319     |HTML taming       |no               |yes               |yes              |
2320     |------------------+-----------------+------------------+-----------------|
2321     |JavaScript taming |no               |yes               |yes              |
2322     |------------------+-----------------+------------------+-----------------|
2323     |Web-bug killing   |no               |yes               |yes              |
2324     |------------------+-----------------+------------------+-----------------|
2325     |Image tag         |no               |no                |yes              |
2326     |reordering        |                 |                  |                 |
2327     +-------------------------------------------------------------------------+
2328    
2329 The list of actions files to be used are defined in the main configuration
2330 file, and are processed in the order they are defined (e.g. default.action is
2331 typically process before user.action). The content of these can all be viewed
2332 and edited from http://config.privoxy.org/show-status. The over-riding
2333 principle when applying actions, is that the last action that matches a given
2334 URL, wins. The broadest, most general rules go first (defined in
2335 default.action), followed by any exceptions (typically also in default.action),
2336 which are then followed lastly by any local preferences (typically in
2337 user.action). Generally, user.action has the last word.
2338
2339 An actions file typically has multiple sections. If you want to use "aliases"
2340 in an actions file, you have to place the (optional) alias section at the top
2341 of that file. Then comes the default set of rules which will apply universally
2342 to all sites and pages (be very careful with using such a universal set in
2343 user.action or any other actions file after default.action, because it will
2344 override the result from consulting any previous file). And then below that,
2345 exceptions to the defined universal policies. You can regard user.action as an
2346 appendix to default.action, with the advantage that is a separate file, which
2347 makes preserving your personal settings across Privoxy upgrades easier.
2348
2349 Actions can be used to block anything you want, including ads, banners, or just
2350 some obnoxious URL that you would rather not see. Cookies can be accepted or
2351 rejected, or accepted only during the current browser session (i.e. not written
2352 to disk), content can be modified, JavaScripts tamed, user-tracking fooled, and
2353 much more. See below for a complete list of actions.
2354
2355 -------------------------------------------------------------------------------
2356
2357 8.1. Finding the Right Mix
2358
2359 Note that some actions, like cookie suppression or script disabling, may render
2360 some sites unusable that rely on these techniques to work properly. Finding the
2361 right mix of actions is not always easy and certainly a matter of personal
2362 taste. And, things can always change, requiring refinements in the
2363 configuration. In general, it can be said that the more "aggressive" your
2364 default settings (in the top section of the actions file) are, the more
2365 exceptions for "trusted" sites you will have to make later. If, for example,
2366 you want to crunch all cookies per default, you'll have to make exceptions from
2367 that rule for sites that you regularly use and that require cookies for
2368 actually useful purposes, like maybe your bank, favorite shop, or newspaper.
2369
2370 We have tried to provide you with reasonable rules to start from in the
2371 distribution actions files. But there is no general rule of thumb on these
2372 things. There just are too many variables, and sites are constantly changing.
2373 Sooner or later you will want to change the rules (and read this chapter again
2374 :).
2375
2376 -------------------------------------------------------------------------------
2377
2378 8.2. How to Edit
2379
2380 The easiest way to edit the actions files is with a browser by using our
2381 browser-based editor, which can be reached from http://config.privoxy.org/
2382 show-status. The editor allows both fine-grained control over every single
2383 feature on a per-URL basis, and easy choosing from wholesale sets of defaults
2384 like "Cautious", "Medium" or "Advanced". Warning: the "Advanced" setting is
2385 more aggressive, and will be more likely to cause problems for some sites.
2386 Experienced users only!
2387
2388 If you prefer plain text editing to GUIs, you can of course also directly edit
2389 the the actions files with your favorite text editor. Look at default.action
2390 which is richly commented with many good examples.
2391
2392 -------------------------------------------------------------------------------
2393
2394 8.3. How Actions are Applied to URLs
2395
2396 Actions files are divided into sections. There are special sections, like the "
2397 alias" sections which will be discussed later. For now let's concentrate on
2398 regular sections: They have a heading line (often split up to multiple lines
2399 for readability) which consist of a list of actions, separated by whitespace
2400 and enclosed in curly braces. Below that, there is a list of URL patterns, each
2401 on a separate line.
2402
2403 To determine which actions apply to a request, the URL of the request is
2404 compared to all patterns in each "action file" file. Every time it matches, the
2405 list of applicable actions for the URL is incrementally updated, using the
2406 heading of the section in which the pattern is located. If multiple matches for
2407 the same URL set the same action differently, the last match wins. If not, the
2408 effects are aggregated. E.g. a URL might match a regular section with a heading
2409 line of { +handle-as-image }, then later another one with just { +block },
2410 resulting in both actions to apply. And there may well be cases where you will
2411 want to combine actions together. Such a section then might look like:
2412
2413   { +handle-as-image  +block }                                                 
2414   # Block these as if they were images. Send no block page.                    
2415    banners.example.com                                                         
2416    media.example.com/.*banners                                                 
2417    .example.com/images/ads/                                                    
2418
2419 You can trace this process for any given URL by visiting http://
2420 config.privoxy.org/show-url-info.
2421
2422 Examples and more detail on this is provided in the Appendix, Troubleshooting:
2423 Anatomy of an Action section.
2424
2425 -------------------------------------------------------------------------------
2426
2427 8.4. Patterns
2428
2429 As mentioned, Privoxy uses "patterns" to determine what actions might apply to
2430 which sites and pages your browser attempts to access. These "patterns" use
2431 wild card type pattern matching to achieve a high degree of flexibility. This
2432 allows one expression to be expanded and potentially match against many similar
2433 patterns.
2434
2435 Generally, a Privoxy pattern has the form <domain>/<path>, where both the
2436 <domain> and <path> are optional. (This is why the special / pattern matches
2437 all URLs). Note that the protocol portion of the URL pattern (e.g. http://)
2438 should not be included in the pattern. This is assumed already!
2439
2440 The pattern matching syntax is different for the domain and path parts of the
2441 URL. The domain part uses a simple globbing type matching technique, while the
2442 path part uses a more flexible "Regular Expressions (PCRE)" based syntax.
2443
2444 www.example.com/
2445    
2446     is a domain-only pattern and will match any request to www.example.com,
2447     regardless of which document on that server is requested. So ALL pages in
2448     this domain would be covered by the scope of this action. Note that a
2449     simple example.com is different and would NOT match.
2450    
2451 www.example.com
2452    
2453     means exactly the same. For domain-only patterns, the trailing / may be
2454     omitted.
2455    
2456 www.example.com/index.html
2457    
2458     matches only the single document /index.html on www.example.com.
2459    
2460 /index.html
2461    
2462     matches the document /index.html, regardless of the domain, i.e. on any web
2463     server anywhere.
2464    
2465 index.html
2466    
2467     matches nothing, since it would be interpreted as a domain name and there
2468     is no top-level domain called .html. So its a mistake.
2469    
2470 -------------------------------------------------------------------------------
2471
2472 8.4.1. The Domain Pattern
2473
2474 The matching of the domain part offers some flexible options: if the domain
2475 starts or ends with a dot, it becomes unanchored at that end. For example:
2476
2477 .example.com
2478    
2479     matches any domain that ENDS in .example.com
2480    
2481 www.
2482    
2483     matches any domain that STARTS with www.
2484    
2485 .example.
2486    
2487     matches any domain that CONTAINS .example.. And, by the way, also included
2488     would be any files or documents that exist within that domain since no path
2489     limitations are specified. (Correctly speaking: It matches any FQDN that
2490     contains example as a domain.) This might be www.example.com,
2491     news.example.de, or www.example.net/cgi/testing.pl for instance. All these
2492     cases are matched.
2493    
2494 Additionally, there are wild-cards that you can use in the domain names
2495 themselves. These work similarly to shell globbing type wild-cards: "*"
2496 represents zero or more arbitrary characters (this is equivalent to the 
2497 "Regular Expression" based syntax of ".*"), "?" represents any single character
2498 (this is equivalent to the regular expression syntax of a simple "."), and you
2499 can define "character classes" in square brackets which is similar to the same
2500 regular expression technique. All of this can be freely mixed:
2501
2502 ad*.example.com
2503    
2504     matches "adserver.example.com", "ads.example.com", etc but not
2505     "sfads.example.com"
2506    
2507 *ad*.example.com
2508    
2509     matches all of the above, and then some.
2510    
2511 .?pix.com
2512    
2513     matches www.ipix.com, pictures.epix.com, a.b.c.d.e.upix.com etc.
2514    
2515 www[1-9a-ez].example.c*
2516    
2517     matches www1.example.com, www4.example.cc, wwwd.example.cy,
2518     wwwz.example.com etc., but not wwww.example.com.
2519    
2520 While flexibile, this is not the sophistication of full regular expression
2521 based syntax.
2522
2523 -------------------------------------------------------------------------------
2524
2525 8.4.2. The Path Pattern
2526
2527 Privoxy uses Perl compatible (PCRE) "Regular Expression" based syntax (through
2528 the PCRE library) for matching the path portion (after the slash), and is thus
2529 more flexible.
2530
2531 There is an Appendix with a brief quick-start into regular expressions, and
2532 full (very technical) documentation on PCRE regex syntax is available on-line
2533 at http://www.pcre.org/man.txt. You might also find the Perl man page on
2534 regular expressions (man perlre) useful, which is available on-line at http://
2535 perldoc.perl.org/perlre.html.
2536
2537 Note that the path pattern is automatically left-anchored at the "/", i.e. it
2538 matches as if it would start with a "^" (regular expression speak for the
2539 beginning of a line).
2540
2541 Please also note that matching in the path is CASE INSENSITIVE by default, but
2542 you can switch to case sensitive at any point in the pattern by using the "(?
2543 -i)" switch: www.example.com/(?-i)PaTtErN.* will match only documents whose
2544 path starts with PaTtErN in exactly this capitalization.
2545
2546 .example.com/.*
2547    
2548     Is equivalent to just ".example.com", since any documents within that
2549     domain are matched with or without the ".*" regular expression. This is
2550     redundant
2551    
2552 .example.com/.*/index.html
2553    
2554     Will match any page in the domain of "example.com" that is named
2555     "index.html", and that is part of some path. For example, it matches
2556     "www.example.com/testing/index.html" but NOT "www.example.com/index.html"
2557     because the regular expression called for at least two "/'s", thus the path
2558     requirement. It also would match "www.example.com/testing/index_html",
2559     because of the special meta-character ".".
2560    
2561 .example.com/(.*/)?index\.html
2562    
2563     This regular expression is conditional so it will match any page named
2564     "index.html" regardless of path which in this case can have one or more "/
2565     's". And this one must contain exactly ".html" (but does not have to end
2566     with that!).
2567    
2568 .example.com/(.*/)(ads|banners?|junk)
2569    
2570     This regular expression will match any path of "example.com" that contains
2571     any of the words "ads", "banner", "banners" (because of the "?") or "junk".
2572     The path does not have to end in these words, just contain them.
2573    
2574 .example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$
2575    
2576     This is very much the same as above, except now it must end in either
2577     ".jpg", ".jpeg", ".gif" or ".png". So this one is limited to common image
2578     formats.
2579    
2580 There are many, many good examples to be found in default.action, and more
2581 tutorials below in Appendix on regular expressions.
2582
2583 -------------------------------------------------------------------------------
2584
2585 8.5. Actions
2586
2587 All actions are disabled by default, until they are explicitly enabled
2588 somewhere in an actions file. Actions are turned on if preceded with a "+", and
2589 turned off if preceded with a "-". So a +action means "do that action", e.g.
2590 +block means "please block URLs that match the following patterns", and -block
2591 means "don't block URLs that match the following patterns, even if +block
2592 previously applied." 
2593
2594 Again, actions are invoked by placing them on a line, enclosed in curly braces
2595 and separated by whitespace, like in {+some-action -some-other-action
2596 {some-parameter}}, followed by a list of URL patterns, one per line, to which
2597 they apply. Together, the actions line and the following pattern lines make up
2598 a section of the actions file.
2599
2600 Actions fall into three categories:
2601
2602   * Boolean, i.e the action can only be "enabled" or "disabled". Syntax:
2603    
2604       +name        # enable action name                                
2605       -name        # disable action name                               
2606    
2607     Example: +block
2608    
2609   * Parameterized, where some value is required in order to enable this type of
2610     action. Syntax:
2611    
2612       +name{param}  # enable action and set parameter to param,             
2613                    # overwriting parameter from previous match if necessary 
2614       -name         # disable action. The parameter can be omitted          
2615    
2616     Note that if the URL matches multiple positive forms of a parameterized
2617     action, the last match wins, i.e. the params from earlier matches are
2618     simply ignored.
2619    
2620     Example: +hide-user-agent{ Mozilla 1.0 }
2621    
2622   * Multi-value. These look exactly like parameterized actions, but they behave
2623     differently: If the action applies multiple times to the same URL, but with
2624     different parameters, all the parameters from all matches are remembered.
2625     This is used for actions that can be executed for the same request
2626     repeatedly, like adding multiple headers, or filtering through multiple
2627     filters. Syntax:
2628    
2629       +name{param}   # enable action and add param to the list of parameters                 
2630       -name{param}   # remove the parameter param from the list of parameters                
2631                     # If it was the last one left, disable the action.                       
2632       -name          # disable this action completely and remove all parameters from the list
2633    
2634     Examples: +add-header{X-Fun-Header: Some text} and +filter{html-annoyances}
2635    
2636 If nothing is specified in any actions file, no "actions" are taken. So in this
2637 case Privoxy would just be a normal, non-blocking, non-anonymizing proxy. You
2638 must specifically enable the privacy and blocking features you need (although
2639 the provided default actions files will give a good starting point).
2640
2641 Later defined actions always over-ride earlier ones. So exceptions to any rules
2642 you make, should come in the latter part of the file (or in a file that is
2643 processed later when using multiple actions files such as user.action). For
2644 multi-valued actions, the actions are applied in the order they are specified.
2645 Actions files are processed in the order they are defined in config (the
2646 default installation has three actions files). It also quite possible for any
2647 given URL pattern to match more than one pattern and thus more than one set of
2648 actions! Last match wins.
2649
2650 The list of valid Privoxy actions are:
2651
2652 -------------------------------------------------------------------------------
2653
2654 8.5.1. add-header
2655
2656 Typical use:
2657    
2658     Confuse log analysis, custom applications
2659    
2660 Effect:
2661    
2662     Sends a user defined HTTP header to the web server.
2663    
2664 Type:
2665    
2666     Multi-value.
2667    
2668 Parameter:
2669    
2670     Any string value is possible. Validity of the defined HTTP headers is not
2671     checked. It is recommended that you use the "X-" prefix for custom headers.
2672    
2673 Notes:
2674    
2675     This action may be specified multiple times, in order to define multiple
2676     headers. This is rarely needed for the typical user. If you don't know what
2677     "HTTP headers" are, you definitely don't need to worry about this one.
2678    
2679 Example usage:
2680    
2681     +add-header{X-User-Tracking: sucks}                                
2682    
2683 -------------------------------------------------------------------------------
2684
2685 8.5.2. block
2686
2687 Typical use:
2688    
2689     Block ads or other unwanted content
2690    
2691 Effect:
2692    
2693     Requests for URLs to which this action applies are blocked, i.e. the
2694     requests are trapped by Privoxy and the requested URL is never retrieved,
2695     but is answered locally with a substitute page or image, as determined by
2696     the handle-as-image, set-image-blocker, and handle-as-empty-document
2697     actions.
2698    
2699 Type:
2700    
2701     Boolean.
2702    
2703 Parameter:
2704    
2705     N/A
2706    
2707 Notes:
2708    
2709     Privoxy sends a special "BLOCKED" page for requests to blocked pages. This
2710     page contains links to find out why the request was blocked, and a
2711     click-through to the blocked content (the latter only if compiled with the
2712     force feature enabled). The "BLOCKED" page adapts to the available screen
2713     space -- it displays full-blown if space allows, or miniaturized and
2714     text-only if loaded into a small frame or window. If you are using Privoxy
2715     right now, you can take a look at the "BLOCKED" page.
2716    
2717     A very important exception occurs if both block and handle-as-image, apply
2718     to the same request: it will then be replaced by an image. If 
2719     set-image-blocker (see below) also applies, the type of image will be
2720     determined by its parameter, if not, the standard checkerboard pattern is
2721     sent.
2722    
2723     It is important to understand this process, in order to understand how
2724     Privoxy deals with ads and other unwanted content. Blocking is a core
2725     feature, and one upon which various other features depend.
2726    
2727     The filter action can perform a very similar task, by "blocking" banner
2728     images and other content through rewriting the relevant URLs in the
2729     document's HTML source, so they don't get requested in the first place.
2730     Note that this is a totally different technique, and it's easy to confuse
2731     the two.
2732    
2733 Example usage (section):
2734    
2735     {+block}                                                           
2736     # Block and replace with "blocked" page                            
2737      .nasty-stuff.example.com                                          
2738                                                                        
2739     {+block +handle-as-image}                                          
2740     # Block and replace with image                                     
2741      .ad.doubleclick.net                                               
2742      .ads.r.us/banners/                                                
2743                                                                        
2744     {+block +handle-as-empty-document}                                 
2745     # Block and then ignore                                            
2746      adserver.exampleclick.net/.*\.js$                                 
2747    
2748 -------------------------------------------------------------------------------
2749
2750 8.5.3. content-type-overwrite
2751
2752 Typical use:
2753    
2754     Stop useless download menus from popping up, or change the browser's
2755     rendering mode
2756    
2757 Effect:
2758    
2759     Replaces the "Content-Type:" HTTP server header.
2760    
2761 Type:
2762    
2763     Parameterized.
2764    
2765 Parameter:
2766    
2767     Any string.
2768    
2769 Notes:
2770    
2771     The "Content-Type:" HTTP server header is used by the browser to decide
2772     what to do with the document. The value of this header can cause the
2773     browser to open a download menu instead of displaying the document by
2774     itself, even if the document's format is supported by the browser.
2775    
2776     The declared content type can also affect which rendering mode the browser
2777     chooses. If XHTML is delivered as "text/html", many browsers treat it as
2778     yet another broken HTML document. If it is send as "application/xml",
2779     browsers with XHTML support will only display it, if the syntax is correct.
2780    
2781     If you see a web site that proudly uses XHTML buttons, but sets
2782     "Content-Type: text/html", you can use Privoxy to overwrite it with
2783     "application/xml" and validate the web master's claim inside your
2784     XHTML-supporting browser. If the syntax is incorrect, the browser will
2785     complain loudly.
2786    
2787     You can also go the opposite direction: if your browser prints error
2788     messages instead of rendering a document falsely declared as XHTML, you can
2789     overwrite the content type with "text/html" and have it rendered as broken
2790     HTML document.
2791    
2792     By default content-type-overwrite only replaces "Content-Type:" headers
2793     that look like some kind of text. If you want to overwrite it
2794     unconditionally, you have to combine it with force-text-mode. This
2795     limitation exists for a reason, think twice before circumventing it.
2796    
2797     Most of the time it's easier to enable filter-server-headers and replace
2798     this action with a custom regular expression. It allows you to activate it
2799     for every document of a certain site and it will still only replace the
2800     content types you aimed at.
2801    
2802     Of course you can apply content-type-overwrite to a whole site and then
2803     make URL based exceptions, but it's a lot more work to get the same
2804     precision.
2805    
2806 Example usage (sections):
2807    
2808     # Check if www.example.net/ really uses valid XHTML                         
2809     {+content-type-overwrite {application/xml}}                                 
2810     www.example.net/                                                            
2811                                                                                 
2812     # but leave the content type unmodified if the URL looks like a style sheet 
2813     {-content-type-overwrite}                                                   
2814     www.example.net/*.\.css$                                                    
2815     www.example.net/*.style                                                     
2816    
2817 -------------------------------------------------------------------------------
2818
2819 8.5.4. crunch-client-header
2820
2821 Typical use:
2822    
2823     Remove a client header Privoxy has no dedicated action for.
2824    
2825 Effect:
2826    
2827     Deletes every header sent by the client that contains the string the user
2828     supplied as parameter.
2829    
2830 Type:
2831    
2832     Parameterized.
2833    
2834 Parameter:
2835    
2836     Any string.
2837    
2838 Notes:
2839    
2840     This action allows you to block client headers for which no dedicated
2841     Privoxy action exists. Privoxy will remove every client header that
2842     contains the string you supplied as parameter.
2843    
2844     Regular expressions are not supported and you can't use this action to
2845     block different headers in the same request, unless they contain the same
2846     string.
2847    
2848     crunch-client-header is only meant for quick tests. If you have to block
2849     several different headers, or only want to modify parts of them, you should
2850     enable filter-client-headers and create your own filter.
2851    
2852     +-----------------------------------------------------------------+
2853     |                             Warning                             |
2854     |-----------------------------------------------------------------|
2855     |Don't block any header without understanding the consequences.   |
2856     +-----------------------------------------------------------------+
2857 Example usage (section):
2858    
2859     # Block the non-existent "Privacy-Violation:" client header        
2860     {+crunch-client-header {Privacy-Violation:}}                       
2861     /                                                                  
2862                                                                        
2863    
2864 -------------------------------------------------------------------------------
2865
2866 8.5.5. crunch-if-none-match
2867
2868 Typical use:
2869    
2870     Prevent yet another way to track the user's steps between sessions.
2871    
2872 Effect:
2873    
2874     Deletes the "If-None-Match:" HTTP client header.
2875    
2876 Type:
2877    
2878     Boolean.
2879    
2880 Parameter:
2881    
2882     N/A
2883    
2884 Notes:
2885    
2886     Removing the "If-None-Match:" HTTP client header is useful for filter
2887     testing, where you want to force a real reload instead of getting status
2888     code "304" which would cause the browser to use a cached copy of the page.
2889    
2890     It is also useful to make sure the header isn't used as a cookie
2891     replacement.
2892    
2893     Blocking the "If-None-Match:" header shouldn't cause any caching problems,
2894     as long as the "If-Modified-Since:" header isn't blocked as well.
2895    
2896     It is recommended to use this action together with hide-if-modified-since
2897     and overwrite-last-modified.
2898    
2899 Example usage (section):
2900    
2901     # Let the browser revalidate cached documents without being tracked across sessions 
2902     {+hide-if-modified-since {-60} \                                                    
2903     +overwrite-last-modified {randomize} \                                              
2904     +crunch-if-none-match}                                                              
2905     /                                                                                   
2906    
2907 -------------------------------------------------------------------------------
2908
2909 8.5.6. crunch-incoming-cookies
2910
2911 Typical use:
2912    
2913     Prevent the web server from setting any cookies on your system
2914    
2915 Effect:
2916    
2917     Deletes any "Set-Cookie:" HTTP headers from server replies.
2918    
2919 Type:
2920    
2921     Boolean.
2922    
2923 Parameter:
2924    
2925     N/A
2926    
2927 Notes:
2928    
2929     This action is only concerned with incoming cookies. For outgoing cookies,
2930     use crunch-outgoing-cookies. Use both to disable cookies completely.
2931    
2932     It makes no sense at all to use this action in conjunction with the 
2933     session-cookies-only action, since it would prevent the session cookies
2934     from being set. See also filter-content-cookies.
2935    
2936 Example usage:
2937    
2938     +crunch-incoming-cookies                                           
2939    
2940 -------------------------------------------------------------------------------
2941
2942 8.5.7. crunch-server-header
2943
2944 Typical use:
2945    
2946     Remove a server header Privoxy has no dedicated action for.
2947    
2948 Effect:
2949    
2950     Deletes every header sent by the server that contains the string the user
2951     supplied as parameter.
2952    
2953 Type:
2954    
2955     Parameterized.
2956    
2957 Parameter:
2958    
2959     Any string.
2960    
2961 Notes:
2962    
2963     This action allows you to block server headers for which no dedicated
2964     Privoxy action exists. Privoxy will remove every server header that
2965     contains the string you supplied as parameter.
2966    
2967     Regular expressions are not supported and you can't use this action to
2968     block different headers in the same request, unless they contain the same
2969     string.
2970    
2971     crunch-server-header is only meant for quick tests. If you have to block
2972     several different headers, or only want to modify parts of them, you should
2973     enable filter-server-headers and create your own filter.
2974    
2975     +-----------------------------------------------------------------+
2976     |                             Warning                             |
2977     |-----------------------------------------------------------------|
2978     |Don't block any header without understanding the consequences.   |
2979     +-----------------------------------------------------------------+
2980 Example usage (section):
2981    
2982     # Crunch server headers that try to prevent caching                
2983     {+crunch-server-header {no-cache}}                                 
2984     /                                                                  
2985    
2986 -------------------------------------------------------------------------------
2987
2988 8.5.8. crunch-outgoing-cookies
2989
2990 Typical use:
2991    
2992     Prevent the web server from reading any cookies from your system
2993    
2994 Effect:
2995    
2996     Deletes any "Cookie:" HTTP headers from client requests.
2997    
2998 Type:
2999    
3000     Boolean.
3001    
3002 Parameter:
3003    
3004     N/A
3005    
3006 Notes:
3007    
3008     This action is only concerned with outgoing cookies. For incoming cookies,
3009     use crunch-incoming-cookies. Use both to disable cookies completely.
3010    
3011     It makes no sense at all to use this action in conjunction with the 
3012     session-cookies-only action, since it would prevent the session cookies
3013     from being read.
3014    
3015 Example usage:
3016    
3017     +crunch-outgoing-cookies                                           
3018    
3019 -------------------------------------------------------------------------------
3020
3021 8.5.9. deanimate-gifs
3022
3023 Typical use:
3024    
3025     Stop those annoying, distracting animated GIF images.
3026    
3027 Effect:
3028    
3029     De-animate GIF animations, i.e. reduce them to their first or last image.
3030    
3031 Type:
3032    
3033     Parameterized.
3034    
3035 Parameter:
3036    
3037     "last" or "first"
3038    
3039 Notes:
3040    
3041     This will also shrink the images considerably (in bytes, not pixels!). If
3042     the option "first" is given, the first frame of the animation is used as
3043     the replacement. If "last" is given, the last frame of the animation is
3044     used instead, which probably makes more sense for most banner animations,
3045     but also has the risk of not showing the entire last frame (if it is only a
3046     delta to an earlier frame).
3047    
3048     You can safely use this action with patterns that will also match non-GIF
3049     objects, because no attempt will be made at anything that doesn't look like
3050     a GIF.
3051    
3052 Example usage:
3053    
3054     +deanimate-gifs{last}                                              
3055    
3056 -------------------------------------------------------------------------------
3057
3058 8.5.10. downgrade-http-version
3059
3060 Typical use:
3061    
3062     Work around (very rare) problems with HTTP/1.1
3063    
3064 Effect:
3065    
3066     Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0.
3067    
3068 Type:
3069    
3070     Boolean.
3071    
3072 Parameter:
3073    
3074     N/A
3075    
3076 Notes:
3077    
3078     This is a left-over from the time when Privoxy didn't support important
3079     HTTP/1.1 features well. It is left here for the unlikely case that you
3080     experience HTTP/1.1 related problems with some server out there. Not all
3081     (optional) HTTP/1.1 features are supported yet, so there is a chance you
3082     might need this action.
3083    
3084 Example usage (section):
3085    
3086     {+downgrade-http-version}                                          
3087     problem-host.example.com                                           
3088    
3089 -------------------------------------------------------------------------------
3090
3091 8.5.11. fast-redirects
3092
3093 Typical use:
3094    
3095     Fool some click-tracking scripts and speed up indirect links.
3096    
3097 Effect:
3098    
3099     Detects redirection URLs and redirects the browser without contacting the
3100     redirection server first.
3101    
3102 Type:
3103    
3104     Parameterized.
3105    
3106 Parameter:
3107    
3108       + "simple-check" to just search for the string "http://" to detect
3109         redirection URLs.
3110        
3111       + "check-decoded-url" to decode URLs (if necessary) before searching for
3112         redirection URLs.
3113        
3114 Notes:
3115    
3116     Many sites, like yahoo.com, don't just link to other sites. Instead, they
3117     will link to some script on their own servers, giving the destination as a
3118     parameter, which will then redirect you to the final target. URLs resulting
3119     from this scheme typically look like: "http://www.example.org/
3120     click-tracker.cgi?target=http%3a//www.example.net/".
3121    
3122     Sometimes, there are even multiple consecutive redirects encoded in the
3123     URL. These redirections via scripts make your web browsing more traceable,
3124     since the server from which you follow such a link can see where you go to.
3125     Apart from that, valuable bandwidth and time is wasted, while your browser
3126     asks the server for one redirect after the other. Plus, it feeds the
3127     advertisers.
3128    
3129     This feature is currently not very smart and is scheduled for improvement.
3130     If it is enabled by default, you will have to create some exceptions to
3131     this action. It can lead to failures in several ways:
3132    
3133     Not every URLs with other URLs as parameters is evil. Some sites offer a
3134     real service that requires this information to work. For example a
3135     validation service needs to know, which document to validate.
3136     fast-redirects assumes that every URL parameter that looks like another URL
3137     is a redirection target, and will always redirect to the last one. Most of
3138     the time the assumption is correct, but if it isn't, the user gets
3139     redirected anyway.
3140    
3141     Another failure occurs if the URL contains other parameters after the URL
3142     parameter. The URL: "http://www.example.org/?redirect=http%3a//
3143     www.example.net/&foo=bar". contains the redirection URL "http://
3144     www.example.net/", followed by another parameter. fast-redirects doesn't
3145     know that and will cause a redirect to "http://www.example.net/&foo=bar".
3146     Depending on the target server configuration, the parameter will be
3147     silently ignored or lead to a "page not found" error. It is possible to fix
3148     these redirected requests with filter-client-headers but it requires a
3149     little effort.
3150    
3151     To detect a redirection URL, fast-redirects only looks for the string
3152     "http://", either in plain text (invalid but often used) or encoded as
3153     "http%3a//". Some sites use their own URL encoding scheme, encrypt the
3154     address of the target server or replace it with a database id. In theses
3155     cases fast-redirects is fooled and the request reaches the redirection
3156     server where it probably gets logged.
3157    
3158 Example usage:
3159    
3160      { +fast-redirects{simple-check} }                                 
3161        .example.com                                                    
3162                                                                        
3163      { +fast-redirects{check-decoded-url} }                            
3164        another.example.com/testing                                     
3165    
3166 -------------------------------------------------------------------------------
3167
3168 8.5.12. filter
3169
3170 Typical use:
3171    
3172     Get rid of HTML and JavaScript annoyances, banner advertisements (by size),
3173     do fun text replacements, etc.
3174    
3175 Effect:
3176    
3177     All files of text-based type, most notably HTML and JavaScript, to which
3178     this action applies, are filtered on-the-fly through the specified regular
3179     expression based substitutions. (Note: as of version 3.0.3 plain text
3180     documents are exempted from filtering, because web servers often use the
3181     text/plain MIME type for all files whose type they don't know.) By default,
3182     filtering works only on the raw document content itself (that which can be
3183     seen with View Source), not the headers.
3184    
3185 Type:
3186    
3187     Parameterized.
3188    
3189 Parameter:
3190    
3191     The name of a filter, as defined in the filter file. Filters can be defined
3192     in one or more files as defined by the filterfile option in the config file
3193     . default.filter is the collection of filters supplied by the developers.
3194     Locally defined filters should go in their own file, such as user.filter.
3195    
3196     When used in its negative form, and without parameters, all filtering is
3197     completely disabled.
3198    
3199 Notes:
3200    
3201     For your convenience, there are a number of pre-defined filters available
3202     in the distribution filter file that you can use. See the examples below
3203     for a list.
3204    
3205     Filtering requires buffering the page content, which may appear to slow
3206     down page rendering since nothing is displayed until all content has passed
3207     the filters. (It does not really take longer, but seems that way since the
3208     page is not incrementally displayed.) This effect will be more noticeable
3209     on slower connections.
3210    
3211     "Rolling your own" filters requires a knowledge of "Regular Expressions"
3212     and "HTML". This is very powerful feature, and potentially very intrusive.
3213     Use with caution.
3214    
3215     The amount of data that can be filtered is limited to the buffer-limit
3216     option in the main config file. The default is 4096 KB (4 Megs). Once this
3217     limit is exceeded, the buffered data, and all pending data, is passed
3218     through unfiltered.
3219    
3220     Inappropriate MIME types, such as zipped files, are not filtered at all.
3221     (Again, only text-based types except plain text). Encrypted SSL data (from
3222     HTTPS servers) cannot be filtered either, since this would violate the
3223     integrity of the secure transaction. In some situations it might be
3224     necessary to protect certain text, like source code, from filtering by
3225     defining appropriate -filter exceptions.
3226    
3227     At this time, Privoxy cannot uncompress compressed documents. If you want
3228     filtering to work on all documents, even those that would normally be sent
3229     compressed, use the prevent-compression action in conjunction with filter.
3230    
3231     Filtering can achieve some of the same effects as the block action, i.e. it
3232     can be used to block ads and banners. But the mechanism works quite
3233     differently. One effective use, is to block ad banners based on their size
3234     (see below), since many of these seem to be somewhat standardized.
3235    
3236     Feedback with suggestions for new or improved filters is particularly
3237     welcome!
3238    
3239     The below list has only the names and a one-line description of each
3240     predefined filter. There are more verbose explanations of what these
3241     filters do in the filter file chapter.
3242    
3243 Example usage (with filters from the distribution default.filter file). See the
3244     Predefined Filters section for more explanation on each:
3245    
3246     +filter{js-annoyances}       # Get rid of particularly annoying JavaScript abuse
3247    
3248     +filter{js-events}           # Kill all JS event bindings (Radically destructive! Only for extra nasty sites)
3249    
3250     +filter{html-annoyances}     # Get rid of particularly annoying HTML abuse
3251    
3252     +filter{content-cookies}     # Kill cookies that come in the HTML or JS content
3253    
3254     +filter{refresh-tags}        # Kill automatic refresh tags (for dial-on-demand setups)
3255    
3256     +filter{unsolicited-popups}  # Disable only unsolicited pop-up windows
3257    
3258     +filter{all-popups}          # Kill all popups in JavaScript and HTML
3259    
3260     +filter{img-reorder}         # Reorder attributes in <img> tags to make the banners-by-* filters more effective
3261    
3262     +filter{banners-by-size}     # Kill banners by size                
3263    
3264     +filter{banners-by-link}     # Kill banners by their links to known clicktrackers
3265    
3266     +filter{webbugs}             # Squish WebBugs (1x1 invisible GIFs used for user tracking)
3267    
3268     +filter{tiny-textforms}      # Extend those tiny textareas up to 40x80 and kill the hard wrap
3269    
3270     +filter{jumping-windows}     # Prevent windows from resizing and moving themselves
3271    
3272     +filter{frameset-borders}    # Give frames a border and make them resizeable
3273    
3274     +filter{demoronizer}         # Fix MS's non-standard use of standard charsets
3275    
3276     +filter{shockwave-flash}     # Kill embedded Shockwave Flash objects
3277    
3278     +filter{quicktime-kioskmode} # Make Quicktime movies savable       
3279    
3280     +filter{fun}                 # Text replacements for subversive browsing fun!
3281    
3282     +filter{crude-parental}      # Crude parental filtering (demo only)
3283    
3284     +filter{ie-exploits}         # Disable some known Internet Explorer bug exploits
3285    
3286 -------------------------------------------------------------------------------
3287
3288 8.5.13. filter-client-headers
3289
3290 Typical use:
3291    
3292     To apply filtering to the client's (browser's) headers
3293    
3294 Effect:
3295    
3296     By default, Privoxy's filters only apply to the document content itself.
3297     This will extend those filters to include the client's headers as well.
3298    
3299 Type:
3300    
3301     Boolean.
3302    
3303 Parameter:
3304    
3305     N/A
3306    
3307 Notes:
3308    
3309     Regular expressions can be used to filter headers as well. Check your
3310     filters closely before activating this action, as it can easily lead to
3311     broken requests.
3312    
3313     These filters are applied to each header on its own, not to them all at
3314     once. This makes it easier to diagnose problems, but on the downside you
3315     can't write filters that only change header x if header y's value is z.
3316    
3317     The filters are used after the other header actions have finished and can
3318     use their output as input.
3319    
3320     Whenever possible one should specify ^, $, the whole header name and the
3321     colon, to make sure the filter doesn't cause havoc to other headers or the
3322     page itself. For example if you want to transform Galeon User-Agents to
3323     Firefox User-Agents you shouldn't use:
3324    
3325     s@Galeon/\d\.\d\.\d @@                                             
3326    
3327     but:
3328    
3329     s@^(User-Agent:.*) Galeon/\d\.\d\.\d (Firefox/\d\.\d\.\d\.\d)$@$1 $2@
3330    
3331 Example usage (section):
3332    
3333     {+filter-client-headers +filter{test_filter}}                      
3334     problem-host.example.com                                           
3335                                                                        
3336    
3337 -------------------------------------------------------------------------------
3338
3339 8.5.14. filter-server-headers
3340
3341 Typical use:
3342    
3343     To apply filtering to the server's headers
3344    
3345 Effect:
3346    
3347     By default, Privoxy's filters only apply to the document content itself.
3348     This will extend those filters to include the server's headers as well.
3349    
3350 Type:
3351    
3352     Boolean.
3353    
3354 Parameter:
3355    
3356     N/A
3357    
3358 Notes:
3359    
3360     Similar to filter-client-headers, but works on the server instead. To
3361     filter both server and client, use both.
3362    
3363     As with filter-client-headers, check your filters before activating this
3364     action, as it can easily lead to broken requests.
3365    
3366     These filters are applied to each header on its own, not to them all at
3367     once. This makes it easier to diagnose problems, but on the downside you
3368     can't write filters that only change header x if header y's value is z.
3369    
3370     The filters are used after the other header actions have finished and can
3371     use their output as input.
3372    
3373     Remember too, whenever possible one should specify ^, $, the whole header
3374     name and the colon, to make sure the filter doesn't cause havoc to other
3375     headers or the page itself. See above for example.
3376    
3377 Example usage (section):
3378    
3379     {+filter-server-headers +filter{test_filter}}                      
3380     problem-host.example.com                                           
3381                                                                        
3382    
3383 -------------------------------------------------------------------------------
3384
3385 8.5.15. force-text-mode
3386
3387 Typical use:
3388    
3389     Force Privoxy to treat a document as if it was in some kind of text format.
3390    
3391 Effect:
3392    
3393     Declares a document as text, even if the "Content-Type:" isn't detected as
3394     such.
3395    
3396 Type:
3397    
3398     Boolean.
3399    
3400 Parameter:
3401    
3402     N/A
3403    
3404 Notes:
3405    
3406     As explained above, Privoxy tries to only filter files that are in some
3407     kind of text format. The same restrictions apply to content-type-overwrite.
3408     force-text-mode declares a document as text, without looking at the
3409     "Content-Type:" first.
3410    
3411     +-----------------------------------------------------------------+
3412     |                             Warning                             |
3413     |-----------------------------------------------------------------|
3414     |Think twice before activating this action. Filtering binary data |
3415     |with regular expressions can cause file damage.                  |
3416     +-----------------------------------------------------------------+
3417 Example usage:
3418    
3419     +force-text-mode                                                   
3420                                                                        
3421    
3422 -------------------------------------------------------------------------------
3423
3424 8.5.16. handle-as-empty-document
3425
3426 Typical use:
3427    
3428     Mark URLs that should be replaced by empty documents if they get blocked
3429    
3430 Effect:
3431    
3432     This action alone doesn't do anything noticeable. It just marks URLs. If
3433     the block action also applies, the presence or absence of this mark decides
3434     whether an HTML "blocked" page, or an empty document will be sent to the
3435     client as a substitute for the blocked content. The empty document isn't
3436     literally empty, but actually contains a single space.
3437    
3438 Type:
3439    
3440     Boolean.
3441    
3442 Parameter:
3443    
3444     N/A
3445    
3446 Notes:
3447    
3448     Some browsers complain about syntax errors if JavaScript documents are
3449     blocked with Privoxy's default HTML page; this option can be used to
3450     silence them.
3451    
3452     The content type for the empty document can be specified with 
3453     content-type-overwrite{}, but usually this isn't necessary.
3454    
3455 Example usage:
3456    
3457     # Block all documents on example.org that end with ".js",          
3458     # but send an empty document instead of the usual HTML message.    
3459     {+block +handle-as-empty-document}                                 
3460     example.org/.*\.js$                                                
3461                                                                        
3462    
3463 -------------------------------------------------------------------------------
3464
3465 8.5.17. handle-as-image
3466
3467 Typical use:
3468    
3469     Mark URLs as belonging to images (so they'll be replaced by images if they
3470     do get blocked, rather than HTML pages)
3471    
3472 Effect:
3473    
3474     This action alone doesn't do anything noticeable. It just marks URLs as
3475     images. If the block action also applies, the presence or absence of this
3476     mark decides whether an HTML "blocked" page, or a replacement image (as
3477     determined by the set-image-blocker action) will be sent to the client as a
3478     substitute for the blocked content.
3479    
3480 Type:
3481    
3482     Boolean.
3483    
3484 Parameter:
3485    
3486     N/A
3487    
3488 Notes:
3489    
3490     The below generic example section is actually part of default.action. It
3491     marks all URLs with well-known image file name extensions as images and
3492     should be left intact.
3493    
3494     Users will probably only want to use the handle-as-image action in
3495     conjunction with block, to block sources of banners, whose URLs don't
3496     reflect the file type, like in the second example section.
3497    
3498     Note that you cannot treat HTML pages as images in most cases. For
3499     instance, (in-line) ad frames require an HTML page to be sent, or they
3500     won't display properly. Forcing handle-as-image in this situation will not
3501     replace the ad frame with an image, but lead to error messages.
3502    
3503 Example usage (sections):
3504    
3505     # Generic image extensions:                                        
3506     #                                                                  
3507     {+handle-as-image}                                                 
3508     /.*\.(gif|jpg|jpeg|png|bmp|ico)$                                   
3509                                                                        
3510     # These don't look like images, but they're banners and should be  
3511     # blocked as images:                                               
3512     #                                                                  
3513     {+block +handle-as-image}                                          
3514     some.nasty-banner-server.com/junk.cgi?output=trash                 
3515                                                                        
3516     # Banner source! Who cares if they also have non-image content?    
3517     ad.doubleclick.net                                                 
3518    
3519 -------------------------------------------------------------------------------
3520
3521 8.5.18. hide-accept-language
3522
3523 Typical use:
3524    
3525     Pretend to use different language settings.
3526    
3527 Effect:
3528    
3529     Deletes or replaces the "Accept-Language:" HTTP header in client requests.
3530    
3531 Type:
3532    
3533     Parameterized.
3534    
3535 Parameter:
3536    
3537     Keyword: "block", or any user defined value.
3538    
3539 Notes:
3540    
3541     Faking the browser's language settings can be useful to make a foreign
3542     User-Agent set with hide-user-agent more believable.
3543    
3544     However some sites with content in different languages check the
3545     "Accept-Language:" to decide which one to take by default. Sometimes it
3546     isn't possible to later switch to another language without changing the
3547     "Accept-Language:" header first.
3548    
3549     Therefore it's a good idea to either only change the "Accept-Language:"
3550     header to languages you understand, or to languages that aren't wide
3551     spread.
3552    
3553     Before setting the "Accept-Language:" header to a rare language, you should
3554     consider that it helps to make your requests unique and thus easier to
3555     trace. If you don't plan to change this header frequently, you should stick
3556     to a common language.
3557    
3558 Example usage (section):
3559    
3560     # Pretend to use Canadian language settings.                                                             
3561     {+hide-accept-language{en-ca} \                                                                          
3562     +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \ 
3563     }                                                                                                        
3564     /                                                                                                        
3565    
3566 -------------------------------------------------------------------------------
3567
3568 8.5.19. hide-content-disposition
3569
3570 Typical use:
3571    
3572     Prevent download menus for content you prefer to view inside the browser.
3573    
3574 Effect:
3575    
3576     Deletes or replaces the "Content-Disposition:" HTTP header set by some
3577     servers.
3578    
3579 Type:
3580    
3581     Parameterized.
3582    
3583 Parameter:
3584    
3585     Keyword: "block", or any user defined value.
3586    
3587 Notes:
3588    
3589     Some servers set the "Content-Disposition:" HTTP header for documents they
3590     assume you want to save locally before viewing them. The
3591     "Content-Disposition:" header contains the file name the browser is
3592     supposed to use by default.
3593    
3594     In most browsers that understand this header, it makes it impossible to
3595     just view the document, without downloading it first, even if it's just a
3596     simple text file or an image.
3597    
3598     Removing the "Content-Disposition:" header helps to prevent this annoyance,
3599     but some browsers additionally check the "Content-Type:" header, before
3600     they decide if they can display a document without saving it first. In
3601     these cases, you have to change this header as well, before the browser
3602     stops displaying download menus.
3603    
3604     It is also possible to change the server's file name suggestion to another
3605     one, but in most cases it isn't worth the time to set it up.
3606    
3607 Example usage:
3608    
3609     # Disarm the download link in Sourceforge's patch tracker          
3610     {-filter\                                                          
3611     +content-type-overwrite {text/plain}\                              
3612     +hide-content-disposition {block} }                                
3613     .sourceforge.net/tracker/download.php                              
3614    
3615 -------------------------------------------------------------------------------
3616
3617 8.5.20. hide-if-modified-since
3618
3619 Typical use:
3620    
3621     Prevent yet another way to track the user's steps between sessions.
3622    
3623 Effect:
3624    
3625     Deletes the "If-Modified-Since:" HTTP client header or modifies its value.
3626    
3627 Type:
3628    
3629     Parameterized.
3630    
3631 Parameter:
3632    
3633     Keyword: "block", or a user defined value that specifies a range of hours.
3634    
3635 Notes:
3636    
3637     Removing this header is useful for filter testing, where you want to force
3638     a real reload instead of getting status code "304", which would cause the
3639     browser to use a cached copy of the page.
3640    
3641     Instead of removing the header, hide-if-modified-since can also add or
3642     subtract a random amount of time to/from the header's value. You specify a
3643     range of minutes where the random factor should be chosen from and Privoxy
3644     does the rest. A negative value means subtracting, a positive value adding.
3645    
3646     Randomizing the value of the "If-Modified-Since:" makes sure it isn't used
3647     as a cookie replacement, but you will run into caching problems if the
3648     random range is too high.
3649    
3650     It is a good idea to only use a small negative value and let 
3651     overwrite-last-modified handle the greater changes.
3652    
3653     It is also recommended to use this action together with 
3654     crunch-if-none-match.
3655    
3656 Example usage (section):
3657    
3658     # Let the browser revalidate without being tracked across sessions 
3659     {+hide-if-modified-since {-60}\                                    
3660     +overwrite-last-modified {randomize}\                              
3661     +crunch-if-none-match}                                             
3662     /                                                                  
3663    
3664 -------------------------------------------------------------------------------
3665
3666 8.5.21. hide-forwarded-for-headers
3667
3668 Typical use:
3669    
3670     Improve privacy by hiding the true source of the request
3671    
3672 Effect:
3673    
3674     Deletes any existing "X-Forwarded-for:" HTTP header from client requests,
3675     and prevents adding a new one.
3676    
3677 Type:
3678    
3679     Boolean.
3680    
3681 Parameter:
3682    
3683     N/A
3684    
3685 Notes:
3686    
3687     It is fairly safe to leave this on.
3688    
3689     This action is scheduled for improvement: It should be able to generate
3690     forged "X-Forwarded-for:" headers using random IP addresses from a
3691     specified network, to make successive requests from the same client look
3692     like requests from a pool of different users sharing the same proxy.
3693    
3694 Example usage:
3695    
3696     +hide-forwarded-for-headers                                        
3697    
3698 -------------------------------------------------------------------------------
3699
3700 8.5.22. hide-from-header
3701
3702 Typical use:
3703    
3704     Keep your (old and ill) browser from telling web servers your email address
3705    
3706 Effect:
3707    
3708     Deletes any existing "From:" HTTP header, or replaces it with the specified
3709     string.
3710    
3711 Type:
3712    
3713     Parameterized.
3714    
3715 Parameter:
3716    
3717     Keyword: "block", or any user defined value.
3718    
3719 Notes:
3720    
3721     The keyword "block" will completely remove the header (not to be confused
3722     with the block action).
3723    
3724     Alternately, you can specify any value you prefer to be sent to the web
3725     server. If you do, it is a matter of fairness not to use any address that
3726     is actually used by a real person.
3727    
3728     This action is rarely needed, as modern web browsers don't send "From:"
3729     headers anymore.
3730    
3731 Example usage:
3732    
3733     +hide-from-header{block}                                           
3734    
3735     or
3736    
3737     +hide-from-header{spam-me-senseless@sittingduck.example.com}       
3738    
3739 -------------------------------------------------------------------------------
3740
3741 8.5.23. hide-referrer
3742
3743 Typical use:
3744    
3745     Conceal which link you followed to get to a particular site
3746    
3747 Effect:
3748    
3749     Deletes the "Referer:" (sic) HTTP header from the client request, or
3750     replaces it with a forged one.
3751    
3752 Type:
3753    
3754     Parameterized.
3755    
3756 Parameter:
3757    
3758       + "conditional-block" to delete the header completely if the host has
3759         changed.
3760        
3761       + "block" to delete the header unconditionally.
3762        
3763       + "forge" to pretend to be coming from the homepage of the server we are
3764         talking to.
3765        
3766       + Any other string to set a user defined referrer.
3767        
3768 Notes:
3769    
3770     conditional-block is the only parameter, that isn't easily detected in the
3771     server's log file. If it blocks the referrer, the request will look like
3772     the visitor used a bookmark or typed in the address directly.
3773    
3774     Leaving the referrer unmodified for requests on the same host allows the
3775     server owner to see the visitor's "click path", but in most cases she could
3776     also get that information by comparing other parts of the log file: for
3777     example the User-Agent if it isn't a very common one, or the user's IP
3778     address if it doesn't change between different requests.
3779    
3780     Always blocking the referrer, or using a custom one, can lead to failures
3781     on servers that check the referrer before they answer any requests, in an
3782     attempt to prevent their valuable content from being embedded or linked to
3783     elsewhere.
3784    
3785     Both conditional-block and forge will work with referrer checks, as long as
3786     content and valid referring page are on the same host. Most of the time
3787     that's the case.
3788    
3789     hide-referer is an alternate spelling of hide-referrer and the two can be
3790     can be freely substituted with each other. ("referrer" is the correct
3791     English spelling, however the HTTP specification has a bug - it requires it
3792     to be spelled as "referer".)
3793    
3794 Example usage:
3795    
3796     +hide-referrer{forge}                                              
3797    
3798     or
3799    
3800     +hide-referrer{http://www.yahoo.com/}                              
3801    
3802 -------------------------------------------------------------------------------
3803
3804 8.5.24. hide-user-agent
3805
3806 Typical use:
3807    
3808     Conceal your type of browser and client operating system
3809    
3810 Effect:
3811    
3812     Replaces the value of the "User-Agent:" HTTP header in client requests with
3813     the specified value.
3814    
3815 Type:
3816    
3817     Parameterized.
3818    
3819 Parameter:
3820    
3821     Any user-defined string.
3822    
3823 Notes:
3824    
3825     +-----------------------------------------------------------------+
3826     |                             Warning                             |
3827     |-----------------------------------------------------------------|
3828     |This can lead to problems on web sites that depend on looking at |
3829     |this header in order to customize their content for different    |
3830     |browsers (which, by the way, is NOT the right thing to do: good  |
3831     |web sites work browser-independently).                           |
3832     +-----------------------------------------------------------------+
3833    
3834     Using this action in multi-user setups or wherever different types of
3835     browsers will access the same Privoxy is not recommended. In single-user,
3836     single-browser setups, you might use it to delete your OS version
3837     information from the headers, because it is an invitation to exploit known
3838     bugs for your OS. It is also occasionally useful to forge this in order to
3839     access sites that won't let you in otherwise (though there may be a good
3840     reason in some cases). Example of this: some MSN sites will not let Mozilla
3841     enter, yet forging to a Netscape 6.1 user-agent works just fine. (Must be
3842     just a silly MS goof, I'm sure :-).
3843    
3844     This action is scheduled for improvement.
3845    
3846 Example usage:
3847    
3848     +hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}         
3849    
3850 -------------------------------------------------------------------------------
3851
3852 8.5.25. inspect-jpegs
3853
3854 Typical use:
3855    
3856     To protect against the MS buffer over-run in JPEG processing
3857    
3858 Effect:
3859    
3860     Protect against a known exploit
3861    
3862 Type:
3863    
3864     Boolean.
3865    
3866 Parameter:
3867    
3868     N/A
3869    
3870 Notes:
3871    
3872     See Microsoft Security Bulletin MS04-028. JPEG images are one of the most
3873     common image types found across the Internet. The exploit as described can
3874     allow execution of code on the target system, giving an attacker access to
3875     the system in question by merely planting an altered JPEG image, which
3876     would have no obvious indications of what lurks inside. This action
3877     prevents unwanted intrusion.
3878    
3879 Example usage:
3880    
3881     +inspect-jpegs                                                     
3882    
3883 -------------------------------------------------------------------------------
3884
3885 8.5.26. kill-popups
3886
3887 Typical use:
3888    
3889     Eliminate those annoying pop-up windows (deprecated)
3890    
3891 Effect:
3892    
3893     While loading the document, replace JavaScript code that opens pop-up
3894     windows with (syntactically neutral) dummy code on the fly.
3895    
3896 Type:
3897    
3898     Boolean.
3899    
3900 Parameter:
3901    
3902     N/A
3903    
3904 Notes:
3905    
3906     This action is basically a built-in, hardwired special-purpose filter
3907     action, but there are important differences: For kill-popups, the document
3908     need not be buffered, so it can be incrementally rendered while
3909     downloading. But kill-popups doesn't catch as many pop-ups as filter
3910     {all-popups} does and is not as smart as filter{unsolicited-popups} is.
3911    
3912     Think of it as a fast and efficient replacement for a filter that you can
3913     use if you don't want any filtering at all. Note that it doesn't make sense
3914     to combine it with any filter action, since as soon as one filter applies,
3915     the whole document needs to be buffered anyway, which destroys the
3916     advantage of the kill-popups action over its filter equivalent.
3917    
3918     Killing all pop-ups unconditionally is problematic. Many shops and banks
3919     rely on pop-ups to display forms, shopping carts etc, and the filter
3920     {unsolicited-popups} does a fairly good job of catching only the unwanted
3921     ones.
3922    
3923     If the only kind of pop-ups that you want to kill are exit consoles (those
3924     really nasty windows that appear when you close an other one), you might
3925     want to use filter{js-annoyances} instead.
3926    
3927 Example usage:
3928    
3929     +kill-popups                                                       
3930    
3931 -------------------------------------------------------------------------------
3932
3933 8.5.27. limit-connect
3934
3935 Typical use:
3936    
3937     Prevent abuse of Privoxy as a TCP proxy relay or disable SSL for untrusted
3938     sites
3939    
3940 Effect:
3941    
3942     Specifies to which ports HTTP CONNECT requests are allowable.
3943    
3944 Type:
3945    
3946     Parameterized.
3947    
3948 Parameter:
3949    
3950     A comma-separated list of ports or port ranges (the latter using dashes,
3951     with the minimum defaulting to 0 and the maximum to 65K).
3952    
3953 Notes:
3954    
3955     By default, i.e. if no limit-connect action applies, Privoxy only allows
3956     HTTP CONNECT requests to port 443 (the standard, secure HTTPS port). Use
3957     limit-connect if more fine-grained control is desired for some or all
3958     destinations.
3959    
3960     The CONNECT methods exists in HTTP to allow access to secure websites
3961     ("https://" URLs) through proxies. It works very simply: the proxy connects
3962     to the server on the specified port, and then short-circuits its
3963     connections to the client and to the remote server. This can be a big
3964     security hole, since CONNECT-enabled proxies can be abused as TCP relays
3965     very easily.
3966    
3967     Privoxy relays HTTPS traffic without seeing the decoded content. Websites
3968     can leverage this limitation to circumvent Privoxy's filters. By specifying
3969     an invalid port range you can disable HTTPS entirely. If you plan to
3970     disable SSL by default, consider enabling 
3971     treat-forbidden-connects-like-blocks as well, to be able to quickly create
3972     exceptions.
3973    
3974 Example usages:
3975    
3976     +limit-connect{443}                   # This is the default and need not be specified.        
3977     +limit-connect{80,443}                # Ports 80 and 443 are OK.                              
3978     +limit-connect{-3, 7, 20-100, 500-}   # Ports less than 3, 7, 20 to 100 and above 500 are OK. 
3979     +limit-connect{-}                     # All ports are OK                                      
3980     +limit-connect{,}                     # No HTTPS/SSL traffic is allowed                       
3981    
3982 -------------------------------------------------------------------------------
3983
3984 8.5.28. prevent-compression
3985
3986 Typical use:
3987    
3988     Ensure that servers send the content uncompressed, so it can be passed
3989     through filters.
3990    
3991 Effect:
3992    
3993     Removes the Accept-Encoding header which can be used to ask for compressed
3994     transfer.
3995    
3996 Type:
3997    
3998     Boolean.
3999    
4000 Parameter:
4001    
4002     N/A
4003    
4004 Notes:
4005    
4006     More and more websites send their content compressed by default, which is
4007     generally a good idea and saves bandwidth. But for the filter, 
4008     deanimate-gifs and kill-popups actions to work, Privoxy needs access to the
4009     uncompressed data. Unfortunately, Privoxy can't yet(!) uncompress, filter,
4010     and re-compress the content on the fly. So if you want to ensure that all
4011     websites, including those that normally compress, can be filtered, you need
4012     to use this action.
4013    
4014     This will slow down transfers from those websites, though. If you use any
4015     of the above-mentioned actions, you will typically want to use
4016     prevent-compression in conjunction with them.
4017    
4018     Note that some (rare) ill-configured sites don't handle requests for
4019     uncompressed documents correctly (they send an empty document body). If you
4020     use prevent-compression per default, you'll have to add exceptions for
4021     those sites. See the example for how to do that.
4022    
4023 Example usage (sections):
4024    
4025     # Set default:                                                     
4026     #                                                                  
4027     {+prevent-compression}                                             
4028     / # Match all sites                                                
4029                                                                        
4030     # Make exceptions for ill sites:                                   
4031     #                                                                  
4032     {-prevent-compression}                                             
4033     www.debianhelp.org                                                 
4034     www.pclinuxonline.com                                              
4035    
4036 -------------------------------------------------------------------------------
4037
4038 8.5.29. overwrite-last-modified
4039
4040 Typical use:
4041    
4042     Prevent yet another way to track the user's steps between sessions.
4043    
4044 Effect:
4045    
4046     Deletes the "Last-Modified:" HTTP server header or modifies its value.
4047    
4048 Type:
4049    
4050     Parameterized.
4051    
4052 Parameter:
4053    
4054     One of the keywords: "block", "reset-to-request-time" and "randomize"
4055    
4056 Notes:
4057    
4058     Removing the "Last-Modified:" header is useful for filter testing, where
4059     you want to force a real reload instead of getting status code "304", which
4060     would cause the browser to reuse the old version of the page.
4061    
4062     The "randomize" option overwrites the value of the "Last-Modified:" header
4063     with a randomly chosen time between the original value and the current
4064     time. In theory the server could send each document with a different
4065     "Last-Modified:" header to track visits without using cookies. "Randomize"
4066     makes it impossible and the browser can still revalidate cached documents.
4067    
4068     "reset-to-request-time" overwrites the value of the "Last-Modified:" header
4069     with the current time. You could use this option together with 
4070     hided-if-modified-since to further customize your random range.
4071    
4072     The preferred parameter here is "randomize". It is safe to use, as long as
4073     the time settings are more or less correct. If the server sets the
4074     "Last-Modified:" header to the time of the request, the random range
4075     becomes zero and the value stays the same. Therefore you should later
4076     randomize it a second time with hided-if-modified-since, just to be sure.
4077    
4078     It is also recommended to use this action together with 
4079     crunch-if-none-match.
4080    
4081 Example usage:
4082    
4083     # Let the browser revalidate without being tracked across sessions 
4084     {+hide-if-modified-since {-60}\                                    
4085     +overwrite-last-modified {randomize}\                              
4086     +crunch-if-none-match}                                             
4087     /                                                                  
4088    
4089 -------------------------------------------------------------------------------
4090
4091 8.5.30. redirect
4092
4093 Typical use:
4094    
4095     Redirect requests to other sites.
4096    
4097 Effect:
4098    
4099     Convinces the browser that the requested document has been moved to another
4100     location and the browser should get it from there.
4101    
4102 Type:
4103    
4104     Parameterized
4105    
4106 Parameter:
4107    
4108     Any URL.
4109    
4110 Notes:
4111    
4112     This action is useful to replace whole documents with ones of your
4113     choosing. This can be used to enforce safe surfing, or just as a simple
4114     convenience.
4115    
4116     You can do the same by combining the actions block, handle-as-image and 
4117     set-image-blocker{URL}. It doesn't sound right for non-image documents, and
4118     that's why this action was created.
4119    
4120     This action will be ignored if you use it together with block.
4121    
4122 Example usages:
4123    
4124     # Replace example.com's style sheet with another one                
4125     { +redirect{http://localhost/css-replacements/example.com.css} }    
4126      example.com/stylesheet.css                                         
4127                                                                         
4128     # Create a short, easy to remember nickname for a favorite site     
4129     { +redirect{http://www.privoxy.org/user-manual/actions-file.html} } 
4130      a                                                                  
4131    
4132 -------------------------------------------------------------------------------
4133
4134 8.5.31. send-vanilla-wafer
4135
4136 Typical use:
4137    
4138     Feed log analysis scripts with useless data.
4139    
4140 Effect:
4141    
4142     Sends a cookie with each request stating that you do not accept any
4143     copyright on cookies sent to you, and asking the site operator not to track
4144     you.
4145    
4146 Type:
4147    
4148     Boolean.
4149    
4150 Parameter:
4151    
4152     N/A
4153    
4154 Notes:
4155    
4156     The vanilla wafer is a (relatively) unique header and could conceivably be
4157     used to track you.
4158    
4159     This action is rarely used and not enabled in the default configuration.
4160    
4161 Example usage:
4162    
4163     +send-vanilla-wafer                                                
4164    
4165 -------------------------------------------------------------------------------
4166
4167 8.5.32. send-wafer
4168
4169 Typical use:
4170    
4171     Send custom cookies or feed log analysis scripts with even more useless
4172     data.
4173    
4174 Effect:
4175    
4176     Sends a custom, user-defined cookie with each request.
4177    
4178 Type:
4179    
4180     Multi-value.
4181    
4182 Parameter:
4183    
4184     A string of the form "name=value".
4185    
4186 Notes:
4187    
4188     Being multi-valued, multiple instances of this action can apply to the same
4189     request, resulting in multiple cookies being sent.
4190    
4191     This action is rarely used and not enabled in the default configuration.
4192    
4193 Example usage (section):
4194    
4195     {+send-wafer{UsingPrivoxy=true}}                                   
4196     my-internal-testing-server.void                                    
4197    
4198 -------------------------------------------------------------------------------
4199
4200 8.5.33. session-cookies-only
4201
4202 Typical use:
4203    
4204     Allow only temporary "session" cookies (for the current browser session
4205     only).
4206    
4207 Effect:
4208    
4209     Deletes the "expires" field from "Set-Cookie:" server headers. Most
4210     browsers will not store such cookies permanently and forget them in between
4211     sessions.
4212    
4213 Type:
4214    
4215     Boolean.
4216    
4217 Parameter:
4218    
4219     N/A
4220    
4221 Notes:
4222    
4223     This is less strict than crunch-incoming-cookies / crunch-outgoing-cookies
4224     and allows you to browse websites that insist or rely on setting cookies,
4225     without compromising your privacy too badly.
4226    
4227     Most browsers will not permanently store cookies that have been processed
4228     by session-cookies-only and will forget about them between sessions. This
4229     makes profiling cookies useless, but won't break sites which require
4230     cookies so that you can log in for transactions. This is generally turned
4231     on for all sites, and is the recommended setting.
4232    
4233     It makes no sense at all to use session-cookies-only together with 
4234     crunch-incoming-cookies or crunch-outgoing-cookies. If you do, cookies will
4235     be plainly killed.
4236    
4237     Note that it is up to the browser how it handles such cookies without an
4238     "expires" field. If you use an exotic browser, you might want to try it out
4239     to be sure.
4240    
4241     This setting also has no effect on cookies that may have been stored
4242     previously by the browser before starting Privoxy. These would have to be
4243     removed manually.
4244    
4245     Privoxy also uses the content-cookies filter to block some types of
4246     cookies. Content cookies are not effected by session-cookies-only.
4247    
4248 Example usage:
4249    
4250     +session-cookies-only                                              
4251    
4252 -------------------------------------------------------------------------------
4253
4254 8.5.34. set-image-blocker
4255
4256 Typical use:
4257    
4258     Choose the replacement for blocked images
4259    
4260 Effect:
4261    
4262     This action alone doesn't do anything noticeable. If both block and 
4263     handle-as-image also apply, i.e. if the request is to be blocked as an
4264     image, then the parameter of this action decides what will be sent as a
4265     replacement.
4266    
4267 Type:
4268    
4269     Parameterized.
4270    
4271 Parameter:
4272    
4273       + "pattern" to send a built-in checkerboard pattern image. The image is
4274         visually decent, scales very well, and makes it obvious where banners
4275         were busted.
4276        
4277       + "blank" to send a built-in transparent image. This makes banners
4278         disappear completely, but makes it hard to detect where Privoxy has
4279         blocked images on a given page and complicates troubleshooting if
4280         Privoxy has blocked innocent images, like navigation icons.
4281        
4282       + "target-url" to send a redirect to target-url. You can redirect to any
4283         image anywhere, even in your local filesystem via "file:///" URL. (But
4284         note that not all browsers support redirecting to a local file system).
4285        
4286         A good application of redirects is to use special Privoxy-built-in
4287         URLs, which send the built-in images, as target-url. This has the same
4288         visual effect as specifying "blank" or "pattern" in the first place,
4289         but enables your browser to cache the replacement image, instead of
4290         requesting it over and over again.
4291        
4292 Notes:
4293    
4294     The URLs for the built-in images are "http://config.privoxy.org/
4295     send-banner?type=type", where type is either "blank" or "pattern".
4296    
4297     There is a third (advanced) type, called "auto". It is NOT to be used in
4298     set-image-blocker, but meant for use from filters. Auto will select the
4299     type of image that would have applied to the referring page, had it been an
4300     image.
4301    
4302 Example usage:
4303    
4304     Built-in pattern:
4305    
4306     +set-image-blocker{pattern}                                        
4307    
4308     Redirect to the BSD devil:
4309    
4310     +set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}        
4311    
4312     Redirect to the built-in pattern for better caching:
4313    
4314     +set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}
4315    
4316 -------------------------------------------------------------------------------
4317
4318 8.5.35. treat-forbidden-connects-like-blocks
4319
4320 Typical use:
4321    
4322     Block forbidden connects with an easy to find error message.
4323    
4324 Effect:
4325    
4326     If this action is enabled, Privoxy no longer makes a difference between
4327     forbidden connects and ordinary blocks.
4328    
4329 Type:
4330    
4331     Boolean
4332    
4333 Parameter:
4334    
4335     N/A
4336    
4337 Notes:
4338    
4339     By default Privoxy answers forbidden "Connect" requests with a short error
4340     message inside the headers. If the browser doesn't display headers (most
4341     don't), you just see an empty page.
4342    
4343     With this action enabled, Privoxy displays the message that is used for
4344     ordinary blocks instead. If you decide to make an exception for the page in
4345     question, you can do so by following the "See why" link.
4346    
4347     For "Connect" requests the clients tell Privoxy which host they are
4348     interested in, but not which document they plan to get later. As a result,
4349     the "Go there anyway" link becomes rather useless: it lets the client
4350     request the home page of the forbidden host through unencrypted HTTP, still
4351     using the port of the last request.
4352    
4353     If you previously configured Privoxy to do the request through a SSL
4354     tunnel, everything will work. Most likely you haven't and the server will
4355     respond with an error message because it is expecting HTTPS (SSL).
4356    
4357 Example usage:
4358    
4359     +treat-forbidden-connects-like-blocks                              
4360    
4361 -------------------------------------------------------------------------------
4362
4363 8.5.36. Summary
4364
4365 Note that many of these actions have the potential to cause a page to
4366 misbehave, possibly even not to display at all. There are many ways a site
4367 designer may choose to design his site, and what HTTP header content, and other
4368 criteria, he may depend on. There is no way to have hard and fast rules for all
4369 sites. See the Appendix for a brief example on troubleshooting actions.
4370
4371 -------------------------------------------------------------------------------
4372
4373 8.6. Aliases
4374
4375 Custom "actions", known to Privoxy as "aliases", can be defined by combining
4376 other actions. These can in turn be invoked just like the built-in actions.
4377 Currently, an alias name can contain any character except space, tab, "=", "{"
4378 and "}", but we strongly recommend that you only use "a" to "z", "0" to "9",
4379 "+", and "-". Alias names are not case sensitive, and are not required to start
4380 with a "+" or "-" sign, since they are merely textually expanded.
4381
4382 Aliases can be used throughout the actions file, but they must be defined in a
4383 special section at the top of the file! And there can only be one such section
4384 per actions file. Each actions file may have its own alias section, and the
4385 aliases defined in it are only visible within that file.
4386
4387 There are two main reasons to use aliases: One is to save typing for frequently
4388 used combinations of actions, the other one is a gain in flexibility: If you
4389 decide once how you want to handle shops by defining an alias called "shop",
4390 you can later change your policy on shops in one place, and your changes will
4391 take effect everywhere in the actions file where the "shop" alias is used.
4392 Calling aliases by their purpose also makes your actions files more readable.
4393
4394 Currently, there is one big drawback to using aliases, though: Privoxy's
4395 built-in web-based action file editor honors aliases when reading the actions
4396 files, but it expands them before writing. So the effects of your aliases are
4397 of course preserved, but the aliases themselves are lost when you edit sections
4398 that use aliases with it. This is likely to change in future versions of
4399 Privoxy.
4400
4401 Now let's define some aliases...
4402
4403  # Useful custom aliases we can use later.                                                    
4404  #                                                                                            
4405  # Note the (required!) section header line and that this section                             
4406  # must be at the top of the actions file!                                                    
4407  #                                                                                            
4408  {{alias}}                                                                                    
4409                                                                                               
4410  # These aliases just save typing later:                                                      
4411  # (Note that some already use other aliases!)                                                
4412  #                                                                                            
4413  +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies                      
4414  -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies                      
4415  +block-as-image      = +block +handle-as-image                                               
4416  mercy-for-cookies   = -crunch-all-cookies -session-cookies-only -filter{content-cookies}     
4417                                                                                               
4418  # These aliases define combinations of actions                                               
4419  # that are useful for certain types of sites:                                                
4420  #                                                                                            
4421  fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -kill-popups 
4422  shop        = -crunch-all-cookies -filter{all-popups} -kill-popups                           
4423                                                                                               
4424  # Short names for other aliases, for really lazy people ;-)                                  
4425  #                                                                                            
4426  c0 = +crunch-all-cookies                                                                     
4427  c1 = -crunch-all-cookies                                                                     
4428
4429 ...and put them to use. These sections would appear in the lower part of an
4430 actions file and define exceptions to the default actions (as specified further
4431 up for the "/" pattern):
4432
4433  # These sites are either very complex or very keen on                         
4434  # user data and require minimal interference to work:                         
4435  #                                                                             
4436  {fragile}                                                                     
4437  .office.microsoft.com                                                         
4438  .windowsupdate.microsoft.com                                                  
4439  .nytimes.com                                                                  
4440                                                                                
4441  # Shopping sites:                                                             
4442  # Allow cookies (for setting and retrieving your customer data)               
4443  #                                                                             
4444  {shop}                                                                        
4445  .quietpc.com                                                                  
4446  .worldpay.com   # for quietpc.com                                             
4447  .scan.co.uk                                                                   
4448                                                                                
4449  # These shops require pop-ups:                                                
4450  #                                                                             
4451  {shop -kill-popups -filter{all-popups}}                                       
4452   .dabs.com                                                                    
4453   .overclockers.co.uk                                                          
4454
4455 Aliases like "shop" and "fragile" are often used for "problem" sites that
4456 require some actions to be disabled in order to function properly.
4457
4458 -------------------------------------------------------------------------------
4459
4460 8.7. Actions Files Tutorial
4461
4462 The above chapters have shown which actions files there are and how they are
4463 organized, how actions are specified and applied to URLs, how patterns work,
4464 and how to define and use aliases. Now, let's look at an example default.action
4465 and user.action file and see how all these pieces come together:
4466
4467 -------------------------------------------------------------------------------
4468
4469 8.7.1. default.action
4470
4471 Every config file should start with a short comment stating its purpose:
4472
4473 # Sample default.action file <ijbswa-developers@lists.sourceforge.net>         
4474
4475 Then, since this is the default.action file, the first section is a special
4476 section for internal use that you needn't change or worry about:
4477
4478 ##########################################################################     
4479 # Settings -- Don't change! For internal Privoxy use ONLY.                     
4480 ##########################################################################     
4481                                                                                
4482 {{settings}}                                                                   
4483 for-privoxy-version=3.0                                                        
4484
4485 After that comes the (optional) alias section. We'll use the example section
4486 from the above chapter on aliases, that also explains why and how aliases are
4487 used:
4488
4489 ##########################################################################                    
4490 # Aliases                                                                                     
4491 ##########################################################################                    
4492 {{alias}}                                                                                     
4493                                                                                               
4494  # These aliases just save typing later:                                                      
4495  # (Note that some already use other aliases!)                                                
4496  #                                                                                            
4497  +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies                      
4498  -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies                      
4499  +block-as-image      = +block +handle-as-image                                               
4500  mercy-for-cookies   = -crunch-all-cookies -session-cookies-only -filter{content-cookies}     
4501                                                                                               
4502  # These aliases define combinations of actions                                               
4503  # that are useful for certain types of sites:                                                
4504  #                                                                                            
4505  fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -kill-popups 
4506  shop        = -crunch-all-cookies -filter{all-popups} -kill-popups                           
4507
4508 Now come the regular sections, i.e. sets of actions, accompanied by URL
4509 patterns to which they apply. Remember all actions are disabled when matching
4510 starts, so we have to explicitly enable the ones we want.
4511
4512 The first regular section is probably the most important. It has only one
4513 pattern, "/", but this pattern matches all URLs. Therefore, the set of actions
4514 used in this "default" section will be applied to all requests as a start. It
4515 can be partly or wholly overridden by later matches further down this file, or
4516 in user.action, but it will still be largely responsible for your overall
4517 browsing experience.
4518
4519 Again, at the start of matching, all actions are disabled, so there is no real
4520 need to disable any actions here, but we will do that nonetheless, to have a
4521 complete listing for your reference. (Remember: a "+" preceding the action name
4522 enables the action, a "-" disables!). Also note how this long line has been
4523 made more readable by splitting it into multiple lines with line continuation.
4524
4525 ##########################################################################     
4526 # "Defaults" section:                                                          
4527 ##########################################################################     
4528  { \                                                                           
4529  -add-header \                                                                 
4530  -block \                                                                      
4531  -content-type-overwrite \                                                     
4532  -crunch-client-header \                                                       
4533  -crunch-if-none-match \                                                       
4534  -crunch-incoming-cookies \                                                    
4535  -crunch-server-header \                                                       
4536  -crunch-outgoing-cookies \                                                    
4537  +deanimate-gifs \                                                             
4538  -downgrade-http-version \                                                     
4539  +fast-redirects{check-decoded-url} \                                          
4540  +filter{js-annoyances} \                                                      
4541  -filter{js-events} \                                                          
4542  +filter{html-annoyances} \                                                    
4543  -filter{content-cookies} \                                                    
4544  +filter{refresh-tags} \                                                       
4545  +filter{unsolicited-popups} \                                                 
4546  -filter{all-popups} \                                                         
4547  +filter{img-reorder} \                                                        
4548  +filter{banners-by-size} \                                                    
4549  -filter{banners-by-link} \                                                    
4550  +filter{webbugs} \                                                            
4551  -filter{tiny-textforms} \                                                     
4552  +filter{jumping-windows} \                                                    
4553  -filter{frameset-borders} \                                                   
4554  -filter{demoronizer} \                                                        
4555  -filter{shockwave-flash} \                                                    
4556  -filter{quicktime-kioskmode} \                                                
4557  -filter{fun} \                                                                
4558  -filter{crude-parental} \                                                     
4559  +filter{ie-exploits} \                                                        
4560  -filter-client-headers \                                                      
4561  -filter-server-headers \                                                      
4562  -force-text-mode \                                                            
4563  -handle-as-empty-document \                                                   
4564  -handle-as-image \                                                            
4565  -hide-accept-language \                                                       
4566  -hide-content-disposition \                                                   
4567  -hide-if-modified-since \                                                     
4568  +hide-forwarded-for-headers \                                                 
4569  +hide-from-header{block} \                                                    
4570  +hide-referrer{forge} \                                                       
4571  -hide-user-agent \                                                            
4572  -inspect-jpegs \                                                              
4573  -kill-popups \                                                                
4574  -limit-connect \                                                              
4575  +prevent-compression \                                                        
4576  -overwrite-last-modified \                                                    
4577  -redirect \                                                                   
4578  -send-vanilla-wafer \                                                         
4579  -send-wafer \                                                                 
4580  +session-cookies-only \                                                       
4581  +set-image-blocker{pattern} \                                                 
4582  -treat-forbidden-connects-like-blocks \                                       
4583  }                                                                             
4584  / # forward slash will match *all* potential URL patterns.                    
4585
4586 The default behavior is now set. Note that some actions, like not hiding the
4587 user agent, are part of a "general policy" that applies universally and won't
4588 get any exceptions defined later. Other choices, like not blocking (which is
4589 understandably the default!) need exceptions, i.e. we need to specify
4590 explicitly what we want to block in later sections.
4591
4592 The first of our specialized sections is concerned with "fragile" sites, i.e.
4593 sites that require minimum interference, because they are either very complex
4594 or very keen on tracking you (and have mechanisms in place that make them
4595 unusable for people who avoid being tracked). We will simply use our
4596 pre-defined fragile alias instead of stating the list of actions explicitly:
4597
4598 ##########################################################################     
4599 # Exceptions for sites that'll break under the default action set:             
4600 ##########################################################################     
4601                                                                                
4602 # "Fragile" Use a minimum set of actions for these sites (see alias above):    
4603 #                                                                              
4604 { fragile }                                                                    
4605 .office.microsoft.com           # surprise, surprise!                          
4606 .windowsupdate.microsoft.com                                                   
4607
4608 Shopping sites are not as fragile, but they typically require cookies to log
4609 in, and pop-up windows for shopping carts or item details. Again, we'll use a
4610 pre-defined alias:
4611
4612 # Shopping sites:                                                              
4613 #                                                                              
4614 { shop }                                                                       
4615 .quietpc.com                                                                   
4616 .worldpay.com   # for quietpc.com                                              
4617 .jungle.com                                                                    
4618 .scan.co.uk                                                                    
4619
4620 The fast-redirects action, which we enabled per default above, breaks some
4621 sites. So disable it for popular sites where we know it misbehaves:
4622
4623 { -fast-redirects }                                                            
4624 login.yahoo.com                                                                
4625 edit.*.yahoo.com                                                               
4626 .google.com                                                                    
4627 .altavista.com/.*(like|url|link):http                                          
4628 .altavista.com/trans.*urltext=http                                             
4629 .nytimes.com                                                                   
4630
4631 It is important that Privoxy knows which URLs belong to images, so that if they
4632 are to be blocked, a substitute image can be sent, rather than an HTML page.
4633 Contacting the remote site to find out is not an option, since it would destroy
4634 the loading time advantage of banner blocking, and it would feed the
4635 advertisers (in terms of money and information). We can mark any URL as an
4636 image with the handle-as-image action, and marking all URLs that end in a known
4637 image file extension is a good start:
4638
4639 ##########################################################################     
4640 # Images:                                                                      
4641 ##########################################################################     
4642                                                                                
4643 # Define which file types will be treated as images, in case they get          
4644 # blocked further down this file:                                              
4645 #                                                                              
4646 { +handle-as-image }                                                           
4647 /.*\.(gif|jpe?g|png|bmp|ico)$                                                  
4648
4649 And then there are known banner sources. They often use scripts to generate the
4650 banners, so it won't be visible from the URL that the request is for an image.
4651 Hence we block them and mark them as images in one go, with the help of our
4652 +block-as-image alias defined above. (We could of course just as well use +
4653 block +handle-as-image here.) Remember that the type of the replacement image
4654 is chosen by the set-image-blocker action. Since all URLs have matched the
4655 default section with its +set-image-blocker{pattern} action before, it still
4656 applies and needn't be repeated:
4657
4658 # Known ad generators:                                                         
4659 #                                                                              
4660 { +block-as-image }                                                            
4661 ar.atwola.com                                                                  
4662 .ad.doubleclick.net                                                            
4663 .ad.*.doubleclick.net                                                          
4664 .a.yimg.com/(?:(?!/i/).)*$                                                     
4665 .a[0-9].yimg.com/(?:(?!/i/).)*$                                                
4666 bs*.gsanet.com                                                                 
4667 bs*.einets.com                                                                 
4668 .qkimg.net                                                                     
4669
4670 One of the most important jobs of Privoxy is to block banners. A huge bunch of
4671 them can be "blocked" by the filter{banners-by-size} action, which we enabled
4672 above, and which deletes the references to banner images from the pages while
4673 they are loaded, so the browser doesn't request them anymore, and hence they
4674 don't need to be blocked here. But this naturally doesn't catch all banners,
4675 and some people choose not to use filters, so we need a comprehensive list of
4676 patterns for banner URLs here, and apply the block action to them.
4677
4678 First comes a bunch of generic patterns, which do most of the work, by matching
4679 typical domain and path name components of banners. Then comes a list of
4680 individual patterns for specific sites, which is omitted here to keep the
4681 example short:
4682
4683 ##########################################################################     
4684 # Block these fine banners:                                                    
4685 ##########################################################################     
4686 { +block }                                                                     
4687                                                                                
4688 # Generic patterns:                                                            
4689 #                                                                              
4690 ad*.                                                                           
4691 .*ads.                                                                         
4692 banner?.                                                                       
4693 count*.                                                                        
4694 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)                                   
4695 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/       
4696                                                                                
4697 # Site-specific patterns (abbreviated):                                        
4698 #                                                                              
4699 .hitbox.com                                                                    
4700
4701 You wouldn't believe how many advertisers actually call their banner servers
4702 ads.company.com, or call the directory in which the banners are stored simply
4703 "banners". So the above generic patterns are surprisingly effective.
4704
4705 But being very generic, they necessarily also catch URLs that we don't want to
4706 block. The pattern .*ads. e.g. catches "nasty-ads.nasty-corp.com" as intended,
4707 but also "downloads.sourcefroge.net" or "adsl.some-provider.net." So here come
4708 some well-known exceptions to the +block section above.
4709
4710 Note that these are exceptions to exceptions from the default! Consider the URL
4711 "downloads.sourcefroge.net": Initially, all actions are deactivated, so it
4712 wouldn't get blocked. Then comes the defaults section, which matches the URL,
4713 but just deactivates the block action once again. Then it matches .*ads., an
4714 exception to the general non-blocking policy, and suddenly +block applies. And
4715 now, it'll match .*loads., where -block applies, so (unless it matches again
4716 further down) it ends up with no block action applying.
4717
4718 ##########################################################################     
4719 # Save some innocent victims of the above generic block patterns:              
4720 ##########################################################################     
4721                                                                                
4722 # By domain:                                                                   
4723 #                                                                              
4724 { -block }                                                                     
4725 adv[io]*.  # (for advogato.org and advice.*)                                   
4726 adsl.      # (has nothing to do with ads)                                      
4727 ad[ud]*.   # (adult.* and add.*)                                               
4728 .edu       # (universities don't host banners (yet!))                          
4729 .*loads.   # (downloads, uploads etc)                                          
4730                                                                                
4731 # By path:                                                                     
4732 #                                                                              
4733 /.*loads/                                                                      
4734                                                                                
4735 # Site-specific:                                                               
4736 #                                                                              
4737 www.globalintersec.com/adv # (adv = advanced)                                  
4738 www.ugu.com/sui/ugu/adv                                                        
4739
4740 Filtering source code can have nasty side effects, so make an exception for our
4741 friends at sourceforge.net, and all paths with "cvs" in them. Note that -filter
4742 disables all filters in one fell swoop!
4743
4744 # Don't filter code!                                                           
4745 #                                                                              
4746 { -filter }                                                                    
4747 /.*cvs                                                                         
4748 .sourceforge.net                                                               
4749
4750 The actual default.action is of course much more comprehensive, but we hope
4751 this example made clear how it works.
4752
4753 -------------------------------------------------------------------------------
4754
4755 8.7.2. user.action
4756
4757 So far we are painting with a broad brush by setting general policies, which
4758 would be a reasonable starting point for many people. Now, you might want to be
4759 more specific and have customized rules that are more suitable to your personal
4760 habits and preferences. These would be for narrowly defined situations like
4761 your ISP or your bank, and should be placed in user.action, which is parsed
4762 after all other actions files and hence has the last word, over-riding any
4763 previously defined actions. user.action is also a safe place for your personal
4764 settings, since default.action is actively maintained by the Privoxy developers
4765 and you'll probably want to install updated versions from time to time.
4766
4767 So let's look at a few examples of things that one might typically do in
4768 user.action:
4769
4770 # My user.action file. <fred@foobar.com>                                       
4771
4772 As aliases are local to the actions file that they are defined in, you can't
4773 use the ones from default.action, unless you repeat them here:
4774
4775 # Aliases are local to the file they are defined in.                                                     
4776 # (Re-)define aliases for this file:                                                                     
4777 #                                                                                                        
4778 {{alias}}                                                                                                
4779 #                                                                                                        
4780 # These aliases just save typing later, and the alias names should                                       
4781 # be self explanatory.                                                                                   
4782 #                                                                                                        
4783 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies                                  
4784 -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies                                  
4785  allow-all-cookies  = -crunch-all-cookies -session-cookies-only                                          
4786  allow-popups       = -filter{all-popups} -kill-popups                                                   
4787 +block-as-image     = +block +handle-as-image                                                            
4788 -block-as-image     = -block                                                                             
4789                                                                                                          
4790 # These aliases define combinations of actions that are useful for                                       
4791 # certain types of sites:                                                                                
4792 #                                                                                                        
4793 fragile     = -block -crunch-all-cookies -filter -fast-redirects -hide-referrer -kill-popups             
4794 shop        = -crunch-all-cookies allow-popups                                                           
4795                                                                                                          
4796 # Allow ads for selected useful free sites:                                                              
4797 #                                                                                                        
4798 allow-ads   = -block -filter{banners-by-size} -filter{banners-by-link}                                   
4799                                                                                                          
4800 # Alias for specific file types that are text, but might have conflicting                                
4801 # MIME types. We want the browser to force these to be text documents.                                   
4802 handle-as-text = -filter +-content-type-overwrite{text/plain} +-force-text-mode -hide-content-disposition
4803
4804  
4805
4806 Say you have accounts on some sites that you visit regularly, and you don't
4807 want to have to log in manually each time. So you'd like to allow persistent
4808 cookies for these sites. The allow-all-cookies alias defined above does exactly
4809 that, i.e. it disables crunching of cookies in any direction, and the
4810 processing of cookies to make them only temporary.
4811
4812 { allow-all-cookies }                                                          
4813  sourceforge.net                                                               
4814  .yahoo.com                                                                    
4815  .msdn.microsoft.com                                                           
4816  .redhat.com                                                                   
4817
4818 Your bank is allergic to some filter, but you don't know which, so you disable
4819 them all:
4820
4821 { -filter }                                                                    
4822  .your-home-banking-site.com                                                   
4823
4824 Some file types you may not want to filter for various reasons:
4825
4826 # Technical documentation is likely to contain strings that might              
4827 # erroneously get altered by the JavaScript-oriented filters:                  
4828 #                                                                              
4829 .tldp.org                                                                      
4830 /(.*/)?selfhtml/                                                               
4831                                                                                
4832 # And this stupid host sends streaming video with a wrong MIME type,           
4833 # so that Privoxy thinks it is getting HTML and starts filtering:              
4834 #                                                                              
4835 stupid-server.example.com/                                                     
4836
4837 Example of a simple block action. Say you've seen an ad on your favourite page
4838 on example.com that you want to get rid of. You have right-clicked the image,
4839 selected "copy image location" and pasted the URL below while removing the
4840 leading http://, into a { +block } section. Note that { +handle-as-image } need
4841 not be specified, since all URLs ending in .gif will be tagged as images by the
4842 general rules as set in default.action anyway:
4843
4844 { +block }                                                                     
4845  www.example.com/nasty-ads/sponsor.gif                                         
4846  another.popular.site.net/more/junk/here/                                      
4847
4848 The URLs of dynamically generated banners, especially from large banner farms,
4849 often don't use the well-known image file name extensions, which makes it
4850 impossible for Privoxy to guess the file type just by looking at the URL. You
4851 can use the +block-as-image alias defined above for these cases. Note that
4852 objects which match this rule but then turn out NOT to be an image are
4853 typically rendered as a "broken image" icon by the browser. Use cautiously.
4854
4855 { +block-as-image }                                                            
4856  .doubleclick.net                                                              
4857  .fastclick.net                                                                
4858  /Realmedia/ads/                                                               
4859  ar.atwola.com/                                                                
4860
4861 Now you noticed that the default configuration breaks Forbes Magazine, but you
4862 were too lazy to find out which action is the culprit, and you were again too
4863 lazy to give feedback, so you just used the fragile alias on the site, and --
4864 whoa! -- it worked. The fragile aliases disables those actions that are most
4865 likely to break a site. Also, good for testing purposes to see if it is Privoxy
4866 that is causing the problem or not. We later find other regular sites that
4867 misbehave, and add those to our personalized list of troublemakers:
4868
4869 { fragile }                                                                    
4870  .forbes.com                                                                   
4871  mail.example.com                                                              
4872  .mybank.com                                                                   
4873
4874 You like the "fun" text replacements in default.filter, but it is disabled in
4875 the distributed actions file. (My colleagues on the team just don't have a
4876 sense of humour, that's why! ;-). So you'd like to turn it on in your private,
4877 update-safe config, once and for all:
4878
4879 { +filter{fun} }                                                               
4880  / # For ALL sites!                                                            
4881
4882 Note that the above is not really a good idea: There are exceptions to the
4883 filters in default.action for things that really shouldn't be filtered, like
4884 code on CVS->Web interfaces. Since user.action has the last word, these
4885 exceptions won't be valid for the "fun" filtering specified here.
4886
4887 You might also worry about how your favourite free websites are funded, and
4888 find that they rely on displaying banner advertisements to survive. So you
4889 might want to specifically allow banners for those sites that you feel provide
4890 value to you:
4891
4892 { allow-ads }                                                                  
4893  .sourceforge.net                                                              
4894  .slashdot.org                                                                 
4895  .osdn.net                                                                     
4896
4897 Note that allow-ads has been aliased to -block, -filter{banners-by-size}, and -
4898 filter{banners-by-link} above.
4899
4900 Invoke another alias here to force an over-ride of the MIME type application/
4901 x-sh which typically would open a download type dialog. In my case, I want to
4902 look at the shell script, and then I can save it should I choose to.
4903
4904 { handle-as-text }                                                             
4905  /.*\.sh$                                                                      
4906
4907 user.action is generally the best place to define exceptions and additions to
4908 the default policies of default.action. Some actions are safe to have their
4909 default policies set here though. So let's set a default policy to have a
4910 "blank" image as opposed to the checkerboard pattern for ALL sites. "/" of
4911 course matches all URL paths and patterns:
4912
4913 { +set-image-blocker{blank} }                                                  
4914 / # ALL sites                                                                  
4915
4916 -------------------------------------------------------------------------------
4917
4918 9. Filter Files
4919
4920 On-the-fly text substitutions that can be invoked through the filter action
4921 need to be defined in a "filter file". Once defined, they can then be invoked
4922 as an "action". Multiple filter files can be defined through the filterfile
4923 config directive. The filters as supplied by the developers will be found in
4924 default.filter. It is recommended that any locally defined or modified filters
4925 go in a separately defined file such as user.filter.
4926
4927 Typical reasons for doing these kinds of substitutions are to eliminate common
4928 annoyances in HTML and JavaScript, such as pop-up windows, exit consoles,
4929 crippled windows without navigation tools, the infamous <BLINK> tag etc, to
4930 suppress images with certain width and height attributes (standard banner sizes
4931 or web-bugs), or just to have fun. The possibilities are endless.
4932
4933 Filtering works on any text-based document type, including HTML, JavaScript,
4934 CSS etc. (all text/* MIME types, except text/plain). Substitutions are made at
4935 the source level, so if you want to "roll your own" filters, you should first
4936 be familiar with HTML syntax, and, of course, regular expressions. By default,
4937 filters are only applied to the raw document content, but can be extended to
4938 the HTTP headers with the supplemental actions: filter-client-headers and 
4939 filter-server-headers.
4940
4941 Just like the actions files, the filter file is organized in sections, which
4942 are called filters here. Each filter consists of a heading line, that starts
4943 with the keyword FILTER:, followed by the filter's name, and a short (one line)
4944 description of what it does. Below that line come the jobs, i.e. lines that
4945 define the actual text substitutions. By convention, the name of a filter
4946 should describe what the filter eliminates. The comment is used in the 
4947 web-based user interface.
4948
4949 Once a filter called name has been defined in the filter file, it can be
4950 invoked by using an action of the form +filter{name} in any actions file.
4951
4952 A filter header line for a filter called "foo" could look like this:
4953
4954 FILTER: foo Replace all "foo" with "bar"                                       
4955
4956 Below that line, and up to the next header line, come the jobs that define what
4957 text replacements the filter executes. They are specified in a syntax that
4958 imitates Perl's s/// operator. If you are familiar with Perl, you will find
4959 this to be quite intuitive, and may want to look at the PCRS documentation for
4960 the subtle differences to Perl behaviour. Most notably, the non-standard option
4961 letter U is supported, which turns the default to ungreedy matching.
4962
4963 If you are new to "Regular Expressions", you might want to take a look at the 
4964 Appendix on regular expressions, and see the Perl manual for the s///
4965 operator's syntax and Perl-style regular expressions in general. The below
4966 examples might also help to get you started.
4967
4968 -------------------------------------------------------------------------------
4969
4970 9.1. Filter File Tutorial
4971
4972 Now, let's complete our "foo" filter. We have already defined the heading, but
4973 the jobs are still missing. Since all it does is to replace "foo" with "bar",
4974 there is only one (trivial) job needed:
4975
4976 s/foo/bar/                                                                     
4977
4978 But wait! Didn't the comment say that all occurrences of "foo" should be
4979 replaced? Our current job will only take care of the first "foo" on each page.
4980 For global substitution, we'll need to add the g option:
4981
4982 s/foo/bar/g                                                                    
4983
4984 Our complete filter now looks like this:
4985
4986 FILTER: foo Replace all "foo" with "bar"                                       
4987 s/foo/bar/g                                                                    
4988
4989 Let's look at some real filters for more interesting examples. Here you see a
4990 filter that protects against some common annoyances that arise from JavaScript
4991 abuse. Let's look at its jobs one after the other:
4992
4993 FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse                         
4994                                                                                                 
4995 # Get rid of JavaScript referrer tracking. Test page: http://www.randomoddness.com/untitled.htm 
4996 #                                                                                               
4997 s|(<script.*)document\.referrer(.*</script>)|$1"Not Your Business!"$2|Usg                       
4998
4999 Following the header line and a comment, you see the job. Note that it uses |
5000 as the delimiter instead of /, because the pattern contains a forward slash,
5001 which would otherwise have to be escaped by a backslash (\).
5002
5003 Now, let's examine the pattern: it starts with the text <script.* enclosed in
5004 parentheses. Since the dot matches any character, and * means: "Match an
5005 arbitrary number of the element left of myself", this matches "<script",
5006 followed by any text, i.e. it matches the whole page, from the start of the
5007 first <script> tag.
5008
5009 That's more than we want, but the pattern continues: document\.referrer matches
5010 only the exact string "document.referrer". The dot needed to be escaped, i.e.
5011 preceded by a backslash, to take away its special meaning as a joker, and make
5012 it just a regular dot. So far, the meaning is: Match from the start of the
5013 first <script> tag in a the page, up to, and including, the text
5014 "document.referrer", if both are present in the page (and appear in that
5015 order).
5016
5017 But there's still more pattern to go. The next element, again enclosed in
5018 parentheses, is .*</script>. You already know what .* means, so the whole
5019 pattern translates to: Match from the start of the first <script> tag in a page
5020 to the end of the last <script> tag, provided that the text "document.referrer"
5021 appears somewhere in between.
5022
5023 This is still not the whole story, since we have ignored the options and the
5024 parentheses: The portions of the page matched by sub-patterns that are enclosed
5025 in parentheses, will be remembered and be available through the variables $1,
5026 $2, ... in the substitute. The U option switches to ungreedy matching, which
5027 means that the first .* in the pattern will only "eat up" all text in between "
5028 <script" and the first occurrence of "document.referrer", and that the second .
5029 * will only span the text up to the first "</script>" tag. Furthermore, the s
5030 option says that the match may span multiple lines in the page, and the g
5031 option again means that the substitution is global.
5032
5033 So, to summarize, the pattern means: Match all scripts that contain the text
5034 "document.referrer". Remember the parts of the script from (and including) the
5035 start tag up to (and excluding) the string "document.referrer" as $1, and the
5036 part following that string, up to and including the closing tag, as $2.
5037
5038 Now the pattern is deciphered, but wasn't this about substituting things? So
5039 lets look at the substitute: $1"Not Your Business!"$2 is easy to read: The text
5040 remembered as $1, followed by "Not Your Business!" (including the quotation
5041 marks!), followed by the text remembered as $2. This produces an exact copy of
5042 the original string, with the middle part (the "document.referrer") replaced by
5043 "Not Your Business!".
5044
5045 The whole job now reads: Replace "document.referrer" by "Not Your Business!"
5046 wherever it appears inside a <script> tag. Note that this job won't break
5047 JavaScript syntax, since both the original and the replacement are
5048 syntactically valid string objects. The script just won't have access to the
5049 referrer information anymore.
5050
5051 We'll show you two other jobs from the JavaScript taming department, but this
5052 time only point out the constructs of special interest:
5053
5054 # The status bar is for displaying link targets, not pointless blahblah        
5055 #                                                                              
5056 s/window\.status\s*=\s*(['"]).*?\1/dUmMy=1/ig                                  
5057
5058 \s stands for whitespace characters (space, tab, newline, carriage return, form
5059 feed), so that \s* means: "zero or more whitespace". The ? in .*? makes this
5060 matching of arbitrary text ungreedy. (Note that the U option is not set). The
5061 ['"] construct means: "a single or a double quote". Finally, \1 is a
5062 back-reference to the first parenthesis just like $1 above, with the difference
5063 that in the pattern, a backslash indicates a back-reference, whereas in the
5064 substitute, it's the dollar.
5065
5066 So what does this job do? It replaces assignments of single- or double-quoted
5067 strings to the "window.status" object with a dummy assignment (using a variable
5068 name that is hopefully odd enough not to conflict with real variables in
5069 scripts). Thus, it catches many cases where e.g. pointless descriptions are
5070 displayed in the status bar instead of the link target when you move your mouse
5071 over links.
5072
5073 # Kill OnUnload popups. Yummy. Test: http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html 
5074 #                                                                                    
5075 s/(<body [^>]*)onunload(.*>)/$1never$2/iU                                            
5076
5077 Including the OnUnload event binding in the HTML DOM was a CRIME. When I close
5078 a browser window, I want it to close and die. Basta. This job replaces the
5079 "onunload" attribute in "<body>" tags with the dummy word never. Note that the
5080 i option makes the pattern matching case-insensitive. Also note that ungreedy
5081 matching alone doesn't always guarantee a minimal match: In the first
5082 parenthesis, we had to use [^>]* instead of .* to prevent the match from
5083 exceeding the <body> tag if it doesn't contain "OnUnload", but the page's
5084 content does.
5085
5086 The last example is from the fun department:
5087
5088 FILTER: fun Fun text replacements                                              
5089                                                                                
5090 # Spice the daily news:                                                        
5091 #                                                                              
5092 s/microsoft(?!\.com)/MicroSuck/ig                                              
5093
5094 Note the (?!\.com) part (a so-called negative lookahead) in the job's pattern,
5095 which means: Don't match, if the string ".com" appears directly following
5096 "microsoft" in the page. This prevents links to microsoft.com from being
5097 trashed, while still replacing the word everywhere else.
5098
5099 # Buzzword Bingo (example for extended regex syntax)                           
5100 #                                                                              
5101 s* industry[ -]leading \                                                       
5102 |  cutting[ -]edge \                                                           
5103 |  customer[ -]focused \                                                       
5104 |  market[ -]driven \                                                          
5105 |  award[ -]winning # Comments are OK, too! \                                  
5106 |  high[ -]performance \                                                       
5107 |  solutions[ -]based \                                                        
5108 |  unmatched \                                                                 
5109 |  unparalleled \                                                              
5110 |  unrivalled \                                                                
5111 *<font color="red"><b>BINGO!</b></font> \                                      
5112 *igx                                                                           
5113
5114 The x option in this job turns on extended syntax, and allows for e.g. the
5115 liberal use of (non-interpreted!) whitespace for nicer formatting.
5116
5117 You get the idea?
5118
5119 -------------------------------------------------------------------------------
5120
5121 9.2. The Pre-defined Filters
5122
5123 The distribution default.filter file contains a selection of pre-defined
5124 filters for your convenience:
5125
5126 js-annoyances
5127    
5128     The purpose of this filter is to get rid of particularly annoying
5129     JavaScript abuse. To that end, it
5130    
5131       + replaces JavaScript references to the browser's referrer information
5132         with the string "Not Your Business!". This compliments the 
5133         hide-referrer action on the content level.
5134        
5135       + removes the bindings to the DOM's unload event which we feel has no
5136         right to exist and is responsible for most "exit consoles", i.e. nasty
5137         windows that pop up when you close another one.
5138        
5139       + removes code that causes new windows to be opened with undesired
5140         properties, such as being full-screen, non-resizeable, without
5141         location, status or menu bar etc.
5142        
5143 js-events
5144    
5145     This is a very radical measure. It removes virtually all JavaScript event
5146     bindings, which means that scripts can not react to user actions such as
5147     mouse movements or clicks, window resizing etc, anymore.
5148    
5149     We strongly discourage using this filter as a default since it breaks many
5150     legitimate scripts. It is meant for use only on extra-nasty sites (should
5151     you really need to go there).
5152    
5153 html-annoyances
5154    
5155     This filter will undo many common instances of HTML based abuse.
5156    
5157     The BLINK and MARQUEE tags are neutralized (yeah baby!), and browser
5158     windows will be created as resizeable (as of course they should be!), and
5159     will have location, scroll and menu bars -- even if specified otherwise.
5160    
5161 content-cookies
5162    
5163     Most cookies are set in the HTTP dialog, where they can be intercepted by
5164     the crunch-incoming-cookies and crunch-outgoing-cookies actions. But web
5165     sites increasingly make use of HTML meta tags and JavaScript to sneak
5166     cookies to the browser on the content level.
5167    
5168     This filter disables HTML and JavaScript code that reads or sets cookies.
5169     Use it wherever you would also use the cookie crunch actions.
5170    
5171 refresh tags
5172    
5173     Disable any refresh tags if the interval is greater than nine seconds (so
5174     that redirections done via refresh tags are not destroyed). This is useful
5175     for dial-on-demand setups, or for those who find this HTML feature
5176     annoying.
5177    
5178 unsolicited-popups
5179    
5180     This filter attempts to prevent only "unsolicited" pop-up windows from
5181     opening, yet still allow pop-up windows that the user has explicitly chosen
5182     to open. It was added in version 3.0.1, as an improvement over earlier such
5183     filters.
5184    
5185     Technical note: The filter works by redefining the window.open JavaScript
5186     function to a dummy function during the loading and rendering phase of each
5187     HTML page access, and restoring the function afterward.
5188    
5189 all-popups
5190    
5191     Attempt to prevent all pop-up windows from opening. Note this should be
5192     used with more discretion than the above, since it is more likely to break
5193     some sites that require pop-ups for normal usage. Use with caution.
5194    
5195 img-reorder
5196    
5197     This is a helper filter that has no value if used alone. It makes the
5198     banners-by-size and banners-by-link (see below) filters more effective and
5199     should be enabled together with them.
5200    
5201 banners-by-size
5202    
5203     This filter removes image tags purely based on what size they are.
5204     Fortunately for us, many ads and banner images tend to conform to certain
5205     standardized sizes, which makes this filter quite effective for ad
5206     stripping purposes.
5207    
5208     Occasionally this filter will cause false positives on images that are not
5209     ads, but just happen to be of one of the standard banner sizes.
5210    
5211 banners-by-link
5212    
5213     This is an experimental filter that attempts to kill any banners if their
5214     URLs seem to point to known or suspected click trackers. It is currently
5215     not of much value and is not recommended for use by default.
5216    
5217 webbugs
5218    
5219     Webbugs are small, invisible images (technically 1X1 GIF images), that are
5220     used to track users across websites, and collect information on them. As an
5221     HTML page is loaded by the browser, an embedded image tag causes the
5222     browser to contact a third-party site, disclosing the tracking information
5223     through the requested URL and/or cookies for that third-party domain,
5224     without the use ever becoming aware of the interaction with the third-party
5225     site. HTML-ized spam also uses a similar technique to verify email
5226     addresses.
5227    
5228     This filter removes the HTML code that loads such "webbugs".
5229    
5230 tiny-textforms
5231    
5232     A rather special-purpose filter that can be used to enlarge textareas
5233     (those multi-line text boxes in web forms) and turn off hard word wrap in
5234     them. It was written for the sourceforge.net tracker system where such
5235     boxes are a nuisance, but it can be handy on other sites, too.
5236    
5237     It is not recommended to use this filter as a default.
5238    
5239 jumping-windows
5240    
5241     Many consider windows that move, or resize themselves to be abusive. This
5242     filter neutralizes the related JavaScript code. Note that some sites might
5243     not display or behave as intended when using this filter.
5244    
5245 frameset-borders
5246    
5247     Some web designers seem to assume that everyone in the world will view
5248     their web sites using the same browser brand and version, screen resolution
5249     etc, because only that assumption could explain why they'd use static frame
5250     sizes, yet prevent their frames from being resized by the user, should they
5251     be too small to show their whole content.
5252    
5253     This filter removes the related HTML code. It should only be applied to
5254     sites which need it.
5255    
5256 demoronizer
5257    
5258     Many Microsoft products that generate HTML use non-standard extensions
5259     (read: violations) of the ISO 8859-1 aka Latin-1 character set. This can
5260     cause those HTML documents to display with errors on standard-compliant
5261     platforms.
5262    
5263     This filter translates the MS-only characters into Latin-1 equivalents. It
5264     is not necessary when using MS products, and will cause corruption of all
5265     documents that use 8-bit character sets other than Latin-1. It's mostly
5266     worthwhile for Europeans on non-MS platforms, if weird garbage characters
5267     sometimes appear on some pages, or user agents that don't correct for this
5268     on the fly.
5269    
5270 shockwave-flash
5271    
5272     A filter for shockwave haters. As the name suggests, this filter strips
5273     code out of web pages that is used to embed shockwave flash objects.
5274    
5275 quicktime-kioskmode
5276    
5277     Change HTML code that embeds Quicktime objects so that kioskmode, which
5278     prevents saving, is disabled.
5279    
5280 fun
5281    
5282     Text replacements for subversive browsing fun. Make fun of your favorite
5283     Monopolist or play buzzword bingo.
5284    
5285 crude-parental
5286    
5287     A demonstration-only filter that shows how Privoxy can be used to delete
5288     web content on a keyword basis.
5289    
5290 ie-exploits
5291    
5292     A collection of text replacements to disable malicious HTML and JavaScript
5293     code that exploits known security holes in Internet Explorer.
5294    
5295     Presently, it only protects against Nimda and a cross-site scripting bug,
5296     and would need active maintenance to provide more substantial protection.
5297    
5298 site-specifics
5299    
5300     Some web sites have very specific problems, the cure for which doesn't
5301     apply anywhere else, or could even cause damage on other sites.
5302    
5303     This is a collection of such site-specific cures which should only be
5304     applied to the sites they were intended for, which is what the supplied
5305     default.action file does. Users shouldn't need to change anything regarding
5306     this filter.
5307    
5308 -------------------------------------------------------------------------------
5309
5310 10. Privoxy's Template Files
5311
5312 All Privoxy built-in pages, i.e. error pages such as the "404 - No Such Domain"
5313 error page, the "BLOCKED" page and all pages of its web-based user interface,
5314 are generated from templates. (Privoxy must be running for the above links to
5315 work as intended.)
5316
5317 These templates are stored in a subdirectory of the configuration directory
5318 called templates. On Unixish platforms, this is typically /etc/privoxy/
5319 templates/.
5320
5321 The templates are basically normal HTML files, but with place-holders (called
5322 symbols or exports), which Privoxy fills at run time. You can edit the
5323 templates with a normal text editor, should you want to customize them. (Not
5324 recommended for the casual user). Note that just like in configuration files,
5325 lines starting with # are ignored when the templates are filled in.
5326
5327 The place-holders are of the form @name@, and you will find a list of available
5328 symbols, which vary from template to template, in the comments at the start of
5329 each file. Note that these comments are not always accurate, and that it's
5330 probably best to look at the existing HTML code to find out which symbols are
5331 supported and what they are filled in with.
5332
5333 A special application of this substitution mechanism is to make whole blocks of
5334 HTML code disappear when a specific symbol is set. We use this for many
5335 purposes, one of them being to include the beta warning in all our user
5336 interface (CGI) pages when Privoxy is in an alpha or beta development stage:
5337
5338 <!-- @if-unstable-start -->                                                    
5339                                                                                
5340   ... beta warning HTML code goes here ...                                     
5341                                                                                
5342 <!-- if-unstable-end@ -->                                                      
5343
5344 If the "unstable" symbol is set, everything in between and including
5345 @if-unstable-start and if-unstable-end@ will disappear, leaving nothing but an
5346 empty comment:
5347
5348 <!--  -->                                                                      
5349
5350 There's also an if-then-else construct and an #include mechanism, but you'll
5351 sure find out if you are inclined to edit the templates ;-)
5352
5353 All templates refer to a style located at http://config.privoxy.org/
5354 send-stylesheet. This is, of course, locally served by Privoxy and the source
5355 for it can be found and edited in the cgi-style.css template.
5356
5357 -------------------------------------------------------------------------------
5358
5359 11. Contacting the Developers, Bug Reporting and Feature Requests
5360
5361 We value your feedback. In fact, we rely on it to improve Privoxy and its
5362 configuration. However, please note the following hints, so we can provide you
5363 with the best support:
5364
5365 -------------------------------------------------------------------------------
5366
5367 11.1. Get Support
5368
5369 For casual users, our support forum at SourceForge is probably best suited: 
5370 http://sourceforge.net/tracker/?group_id=11118&atid=211118
5371
5372 All users are of course welcome to discuss their issues on the users mailing
5373 list, where the developers also hang around.
5374
5375 -------------------------------------------------------------------------------
5376
5377 11.2. Reporting Problems
5378
5379 "Problems" for our purposes, come in two forms:
5380
5381   * Configuration issues, such as ads that slip through, or sites that don't
5382     function properly due to one Privoxy "action" or another being turned "on".
5383    
5384   * "Bugs" in the programming code that makes up Privoxy, such as that might
5385     cause a crash.
5386    
5387 -------------------------------------------------------------------------------
5388
5389 11.2.1. Reporting Ads or Other Configuration Problems
5390
5391 Please send feedback on ads that slipped through, innocent images that were
5392 blocked, sites that don't work properly, and other configuration related
5393 problem of default.action file, to http://sourceforge.net/tracker/?group_id=
5394 11118&atid=460288, the Actions File Tracker.
5395
5396 New, improved default.action files may occasionally be made available based on
5397 your feedback. These will be announced on the ijbswa-announce list and
5398 available from our the files section of our project page.
5399
5400 -------------------------------------------------------------------------------
5401
5402 11.2.2. Reporting Bugs
5403
5404 Please report all bugs only through our bug tracker: http://sourceforge.net/
5405 tracker/?group_id=11118&atid=111118.
5406
5407 Before doing so, please make sure that the bug has not already been submitted
5408 and observe the additional hints at the top of the submit form. If already
5409 submitted, please feel free to add any info to the original report that might
5410 help to solve the issue.
5411
5412 Please try to verify that it is a Privoxy bug, and not a browser or site bug
5413 first. If unsure, try toggling off Privoxy, and see if the problem persists. If
5414 you are using your own custom configuration, please try the stock configs to
5415 see if the problem is configuration related.
5416
5417 If not using the latest version, the bug may have been found and fixed in the
5418 meantime. We would appreciate if you could take the time to upgrade to the
5419 latest version (or even the latest CVS snapshot) and verify your bug.
5420
5421 Please be sure to provide the following information:
5422
5423   * The exact Privoxy version of the proxy software (if you got the source from
5424     CVS, please also provide the source code revisions as shown in http://
5425     config.privoxy.org/show-version).
5426    
5427   * The operating system and versions you run Privoxy on, (e.g. Windows XP
5428     SP2), if you are using some kind of Unix flavour, sending the output of
5429     "uname -a" should do.
5430    
5431   * The name, platform, and version of the browser you were using (e.g.
5432     Internet Explorer v5.5 for Mac).
5433    
5434   * The URL where the problem occurred, or some way for us to duplicate the
5435     problem (e.g. http://somesite.example.com/?somethingelse=123).
5436    
5437   * Whether your version of Privoxy is one supplied by the developers of
5438     Privoxy via SourceForge, or somewhere else.
5439    
5440   * Whether you are using Privoxy in tandem with another proxy such as Tor. If
5441     so, please try disabling the other proxy.
5442    
5443   * Whether you are using a personal firewall product. If so, does Privoxy work
5444     without it?
5445    
5446   * Any other pertinent information to help identify the problem such as config
5447     or log file excerpts (yes, you should have log file entries for each action
5448     taken).
5449    
5450   * Please provide your SF login, or email address, in case we need to contact
5451     you.
5452    
5453 The appendix of the Privoxy User Manual also has helpful information on
5454 understanding actions, and action debugging.
5455
5456 -------------------------------------------------------------------------------
5457
5458 11.3. Request New Features
5459
5460 You are welcome to submit ideas on new features or other proposals for
5461 improvement through our feature request tracker at http://sourceforge.net/
5462 tracker/?atid=361118&group_id=11118.
5463
5464 -------------------------------------------------------------------------------
5465
5466 11.4. Other
5467
5468 For any other issues, feel free to use the mailing lists. Technically
5469 interested users and people who wish to contribute to the project are also
5470 welcome on the developers list! You can find an overview of all Privoxy-related
5471 mailing lists, including list archives, at: http://sourceforge.net/mail/?
5472 group_id=11118.
5473
5474 -------------------------------------------------------------------------------
5475
5476 12. Privoxy Copyright, License and History
5477
5478 Copyright © 2001 - 2006 by Privoxy Developers <
5479 ijbswa-developers@lists.sourceforge.net>
5480
5481 Some source code is based on code Copyright © 1997 by Anonymous Coders and
5482 Junkbusters, Inc. and licensed under the GNU General Public License.
5483
5484 -------------------------------------------------------------------------------
5485
5486 12.1. License
5487
5488 Privoxy is free software; you can redistribute it and/or modify it under the
5489 terms of the GNU General Public License, version 2, as published by the Free
5490 Software Foundation.
5491
5492 This program is distributed in the hope that it will be useful, but WITHOUT ANY
5493 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
5494 PARTICULAR PURPOSE. See the GNU General Public License for more details, which
5495 is available from the Free Software Foundation, Inc, 51 Franklin Street, Fifth
5496 Floor, Boston, MA 02110-1301, USA
5497
5498 You should have received a copy of the GNU General Public License along with
5499 this program; if not, write to the
5500
5501  Free Software
5502  Foundation, Inc. 51 Franklin Street, Fifth Floor
5503  Boston, MA 02110-1301
5504  USA 
5505
5506 -------------------------------------------------------------------------------
5507
5508 12.2. History
5509
5510 Along time ago, there was the Internet Junkbuster, by Anonymous Coders and 
5511 Junkbusters Corporation. This saved many users a lot of pain in the early days
5512 of web advertising and user tracking.
5513
5514 But the web, its protocols and standards, and with it, the techniques for
5515 forcing ads on users, give up autonomy over their browsing, and for tracking
5516 them, keeps evolving. Unfortunately, the Internet Junkbuster did not. Version
5517 2.0.2, published in 1998, was (and is) the last official release available from
5518 Junkbusters Corporation. Fortunately, it had been released under the GNU GPL,
5519 which allowed further development by others.
5520
5521 So Stefan Waldherr started maintaining an improved version of the software, to
5522 which eventually a number of people contributed patches. It could already
5523 replace banners with a transparent image, and had a first version of pop-up
5524 killing, but it was still very closely based on the original, with all its
5525 limitations, such as the lack of HTTP/1.1 support, flexible per-site
5526 configuration, or content modification. The last release from this effort was
5527 version 2.0.2-10, published in 2000.
5528
5529 Then, some developers picked up the thread, and started turning the software
5530 inside out, upside down, and then reassembled it, adding many new features
5531 along the way.
5532
5533 The result of this is Privoxy, whose first stable version, 3.0, was released
5534 August, 2002.
5535
5536 -------------------------------------------------------------------------------
5537
5538 12.3. Authors
5539
5540 Current Privoxy Team:
5541
5542  Fabian Keil, developer
5543  David Schmidt, developer
5544  
5545  Hal Burgiss
5546  Ian Cummings
5547  Félix Rauch
5548  Roland Rosenfeld
5549
5550 Former Privoxy Team Members:
5551
5552  Johny Agotnes 
5553  Rodrigo Barbosa
5554  Moritz Barsnick
5555  Brian Dessent
5556  Jon Foster
5557  Karsten Hopp
5558  Alexander Lazic
5559  Daniel Leite
5560  Gábor Lipták
5561  Adam Lock
5562  Guy Laroche
5563  Mark Martinec 
5564  Andreas Oesterhelt
5565  Haroon Rafique
5566  Georg Sauthoff
5567  Thomas Steudten
5568  Joerg Strohmayer
5569  Rodney Stromlund
5570  Sviatoslav Sviridov
5571  Sarantis Paskalis
5572  Stefan Waldherr
5573
5574 Thanks to the many people who have tested Privoxy, reported bugs, made
5575 suggestions or contributed in some way. These include (in alphabetical order):
5576
5577  Ken Arromdee
5578  Devin Bayer
5579  Reiner Buehl
5580  Andrew J. Caines
5581  Clifford Caoile
5582  Michael T. Davis
5583  Mattes Dolak 
5584  Ulrich Drepper
5585  Peter E
5586  Aaron Hamid
5587  Magnus Holmgren
5588  Don Libes  
5589  Paul Lieverse
5590  Jindrich Makovicka 
5591  David Mediavilla 
5592  Oliver Stoeneberg
5593  Roberto Ragusa
5594  Maynard Riley
5595  Bart Schelstraete
5596  Bobby G. Vinyard
5597  Darren Wiebe
5598  Jörg Weinmann 
5599  Oliver Yeoh
5600  Jamie Zawinski
5601
5602 Privoxy is based in part on code originally developed by:
5603
5604  Junkbusters Corp.
5605  Anonymous Coders
5606
5607 -------------------------------------------------------------------------------
5608
5609 13. See Also
5610
5611 Other references and sites of interest to Privoxy users:
5612
5613 http://www.privoxy.org/, the Privoxy Home page.
5614
5615 http://www.privoxy.org/faq/, the Privoxy FAQ.
5616
5617 http://sourceforge.net/projects/ijbswa/, the Project Page for Privoxy on       
5618 SourceForge.                                                                   
5619
5620 http://config.privoxy.org/, the web-based user interface. Privoxy must be      
5621 running for this to work. Shortcut: http://p.p/                                
5622
5623 http://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit "misses" 
5624 and other configuration related suggestions to the developers.                 
5625
5626 http://www.junkbusters.com/ht/en/cookies.html, an explanation how cookies are  
5627 used to track web users.                                                       
5628
5629 http://www.junkbusters.com/ijb.html, the original Internet Junkbuster.
5630
5631 http://privacy.net/, a useful site to check what information about you is      
5632 leaked while you browse the web.                                               
5633
5634 http://www.squid-cache.org/, a very popular caching proxy, which is often used 
5635 together with Privoxy.                                                         
5636
5637 http://tor.eff.org/, Tor can help anonymize web browsing, web publishing,      
5638 instant messaging, IRC, SSH, and other applications.                           
5639
5640 http://www.privoxy.org/developer-manual/, the Privoxy developer manual.
5641
5642 -------------------------------------------------------------------------------
5643
5644 14. Appendix
5645
5646 14.1. Regular Expressions
5647
5648 Privoxy uses Perl-style "regular expressions" in its actions files and filter
5649 file, through the PCRE and PCRS libraries.
5650
5651 If you are reading this, you probably don't understand what "regular
5652 expressions" are, or what they can do. So this will be a very brief
5653 introduction only. A full explanation would require a book ;-)
5654
5655 Regular expressions provide a language to describe patterns that can be run
5656 against strings of characters (letter, numbers, etc), to see if they match the
5657 string or not. The patterns are themselves (sometimes complex) strings of
5658 literal characters, combined with wild-cards, and other special characters,
5659 called meta-characters. The "meta-characters" have special meanings and are
5660 used to build complex patterns to be matched against. Perl Compatible Regular
5661 Expressions are an especially convenient "dialect" of the regular expression
5662 language.
5663
5664 To make a simple analogy, we do something similar when we use wild-card
5665 characters when listing files with the dir command in DOS. *.* matches all
5666 filenames. The "special" character here is the asterisk which matches any and
5667 all characters. We can be more specific and use ? to match just individual
5668 characters. So "dir file?.text" would match "file1.txt", "file2.txt", etc. We
5669 are pattern matching, using a similar technique to "regular expressions"!
5670
5671 Regular expressions do essentially the same thing, but are much, much more
5672 powerful. There are many more "special characters" and ways of building complex
5673 patterns however. Let's look at a few of the common ones, and then some
5674 examples:
5675
5676 . - Matches any single character, e.g. "a", "A", "4", ":", or "@".
5677
5678 ? - The preceding character or expression is matched ZERO or ONE times. Either/
5679 or.                                                                            
5680
5681 + - The preceding character or expression is matched ONE or MORE times.
5682
5683 * - The preceding character or expression is matched ZERO or MORE times.
5684
5685 \ - The "escape" character denotes that the following character should be taken
5686 literally. This is used where one of the special characters (e.g. ".") needs to
5687 be taken literally and not as a special meta-character. Example: "example      
5688 \.com", makes sure the period is recognized only as a period (and not expanded 
5689 to its meta-character meaning of any single character).                        
5690
5691 [ ] - Characters enclosed in brackets will be matched if any of the enclosed   
5692 characters are encountered. For instance, "[0-9]" matches any numeric digit    
5693 (zero through nine). As an example, we can combine this with "+" to match any  
5694 digit one of more times: "[0-9]+".                                             
5695
5696 ( ) - parentheses are used to group a sub-expression, or multiple              
5697 sub-expressions.                                                               
5698
5699 | - The "bar" character works like an "or" conditional statement. A match is   
5700 successful if the sub-expression on either side of "|" matches. As an example: 
5701 "/(this|that) example/" uses grouping and the bar character and would match    
5702 either "this example" or "that example", and nothing else.                     
5703
5704 These are just some of the ones you are likely to use when matching URLs with
5705 Privoxy, and is a long way from a definitive list. This is enough to get us
5706 started with a few simple examples which may be more illuminating:
5707
5708 /.*/banners/.* - A simple example that uses the common combination of "." and "
5709 *" to denote any character, zero or more times. In other words, any string at
5710 all. So we start with a literal forward slash, then our regular expression
5711 pattern (".*") another literal forward slash, the string "banners", another
5712 forward slash, and lastly another ".*". We are building a directory path here.
5713 This will match any file with the path that has a directory named "banners" in
5714 it. The ".*" matches any characters, and this could conceivably be more forward
5715 slashes, so it might expand into a much longer looking path. For example, this
5716 could match: "/eye/hate/spammers/banners/annoy_me_please.gif", or just "/
5717 banners/annoying.html", or almost an infinite number of other possible
5718 combinations, just so it has "banners" in the path somewhere.
5719
5720 And now something a little more complex:
5721
5722 /.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have several literal forward
5723 slashes again ("/"), so we are building another expression that is a file path
5724 statement. We have another ".*", so we are matching against any conceivable
5725 sub-path, just so it matches our expression. The only true literal that must
5726 match our pattern is adv, together with the forward slashes. What comes after
5727 the "adv" string is the interesting part.
5728
5729 Remember the "?" means the preceding expression (either a literal character or
5730 anything grouped with "(...)" in this case) can exist or not, since this means
5731 either zero or one match. So "((er)?ts?|ertis(ing|ements?))" is optional, as
5732 are the individual sub-expressions: "(er)", "(ing|ements?)", and the "s". The "
5733 |" means "or". We have two of those. For instance, "(ing|ements?)", can expand
5734 to match either "ing" OR "ements?". What is being done here, is an attempt at
5735 matching as many variations of "advertisement", and similar, as possible. So
5736 this would expand to match just "adv", or "advert", or "adverts", or
5737 "advertising", or "advertisement", or "advertisements". You get the idea. But
5738 it would not match "advertizements" (with a "z"). We could fix that by changing
5739 our regular expression to: "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/", which
5740 would then match either spelling.
5741
5742 /.*/advert[0-9]+\.(gif|jpe?g) - Again another path statement with forward
5743 slashes. Anything in the square brackets "[ ]" can be matched. This is using
5744 "0-9" as a shorthand expression to mean any digit one through nine. It is the
5745 same as saying "0123456789". So any digit matches. The "+" means one or more of
5746 the preceding expression must be included. The preceding expression here is
5747 what is in the square brackets -- in this case, any digit one through nine.
5748 Then, at the end, we have a grouping: "(gif|jpe?g)". This includes a "|", so
5749 this needs to match the expression on either side of that bar character also. A
5750 simple "gif" on one side, and the other side will in turn match either "jpeg"
5751 or "jpg", since the "?" means the letter "e" is optional and can be matched
5752 once or not at all. So we are building an expression here to match image GIF or
5753 JPEG type image file. It must include the literal string "advert", then one or
5754 more digits, and a "." (which is now a literal, and not a special character,
5755 since it is escaped with "\"), and lastly either "gif", or "jpeg", or "jpg".
5756 Some possible matches would include: "//advert1.jpg", "/nasty/ads/
5757 advert1234.gif", "/banners/from/hell/advert99.jpg". It would not match
5758 "advert1.gif" (no leading slash), or "/adverts232.jpg" (the expression does not
5759 include an "s"), or "/advert1.jsp" ("jsp" is not in the expression anywhere).
5760
5761 We are barely scratching the surface of regular expressions here so that you
5762 can understand the default Privoxy configuration files, and maybe use this
5763 knowledge to customize your own installation. There is much, much more that can
5764 be done with regular expressions. Now that you know enough to get started, you
5765 can learn more on your own :/
5766
5767 More reading on Perl Compatible Regular expressions: http://perldoc.perl.org/
5768 perlre.html
5769
5770 For information on regular expression based substitutions and their
5771 applications in filters, please see the filter file tutorial in this manual.
5772
5773 -------------------------------------------------------------------------------
5774
5775 14.2. Privoxy's Internal Pages
5776
5777 Since Privoxy proxies each requested web page, it is easy for Privoxy to trap
5778 certain special URLs. In this way, we can talk directly to Privoxy, and see how
5779 it is configured, see how our rules are being applied, change these rules and
5780 other configuration options, and even turn Privoxy's filtering off, all with a
5781 web browser. 
5782
5783 The URLs listed below are the special ones that allow direct access to Privoxy.
5784 Of course, Privoxy must be running to access these. If not, you will get a
5785 friendly error message. Internet access is not necessary either.
5786
5787   * Privoxy main page:
5788    
5789         http://config.privoxy.org/
5790        
5791     There is a shortcut: http://p.p/ (But it doesn't provide a fall-back to a
5792     real page, in case the request is not sent through Privoxy)
5793    
5794   * Show information about the current configuration, including viewing and
5795     editing of actions files:
5796    
5797         http://config.privoxy.org/show-status
5798        
5799   * Show the source code version numbers:
5800    
5801         http://config.privoxy.org/show-version
5802        
5803   * Show the browser's request headers:
5804    
5805         http://config.privoxy.org/show-request
5806        
5807   * Show which actions apply to a URL and why:
5808    
5809         http://config.privoxy.org/show-url-info
5810        
5811   * Toggle Privoxy on or off. In this case, "Privoxy" continues to run, but
5812     only as a pass-through proxy, with no actions taking place:
5813    
5814         http://config.privoxy.org/toggle
5815        
5816     Short cuts. Turn off, then on:
5817    
5818         http://config.privoxy.org/toggle?set=disable
5819        
5820         http://config.privoxy.org/toggle?set=enable
5821        
5822 These may be bookmarked for quick reference. See next. 
5823
5824 -------------------------------------------------------------------------------
5825
5826 14.2.1. Bookmarklets
5827
5828 Below are some "bookmarklets" to allow you to easily access a "mini" version of
5829 some of Privoxy's special pages. They are designed for MS Internet Explorer,
5830 but should work equally well in Netscape, Mozilla, and other browsers which
5831 support JavaScript. They are designed to run directly from your bookmarks - not
5832 by clicking the links below (although that should work for testing).
5833
5834 To save them, right-click the link and choose "Add to Favorites" (IE) or "Add
5835 Bookmark" (Netscape). You will get a warning that the bookmark "may not be
5836 safe" - just click OK. Then you can run the Bookmarklet directly from your
5837 favorites/bookmarks. For even faster access, you can put them on the "Links"
5838 bar (IE) or the "Personal Toolbar" (Netscape), and run them with a single
5839 click.
5840
5841   * Privoxy - Enable
5842    
5843   * Privoxy - Disable
5844    
5845   * Privoxy - Toggle Privoxy (Toggles between enabled and disabled)
5846    
5847   * Privoxy- View Status
5848    
5849   * Privoxy - Why?
5850    
5851 Credit: The site which gave us the general idea for these bookmarklets is 
5852 www.bookmarklets.com. They have more information about bookmarklets.
5853
5854 -------------------------------------------------------------------------------
5855
5856 14.3. Chain of Events
5857
5858 Let's take a quick look at the basic sequence of events when a web page is
5859 requested by your browser and Privoxy is on duty:
5860
5861   * First, your web browser requests a web page. The browser knows to send the
5862     request to Privoxy, which will in turn, relay the request to the remote web
5863     server after passing the following tests:
5864    
5865   * Privoxy traps any request for its own internal CGI pages (e.g http://p.p/)
5866     and sends the CGI page back to the browser.
5867    
5868   * Next, Privoxy checks to see if the URL matches any "+block" patterns. If
5869     so, the URL is then blocked, and the remote web server will not be
5870     contacted. "+handle-as-image" is then checked and if it does not match, an
5871     HTML "BLOCKED" page is sent back. Otherwise, if it does match, an image is
5872     returned. The type of image depends on the setting of "+set-image-blocker"
5873     (blank, checkerboard pattern, or an HTTP redirect to an image elsewhere).
5874    
5875   * Untrusted URLs are blocked. If URLs are being added to the trust file, then
5876     that is done.
5877    
5878   * If the URL pattern matches the "+fast-redirects" action, it is then
5879     processed. Unwanted parts of the requested URL are stripped.
5880    
5881   * Now the rest of the client browser's request headers are processed. If any
5882     of these match any of the relevant actions (e.g. "+hide-user-agent", etc.),
5883     headers are suppressed or forged as determined by these actions and their
5884     parameters.
5885    
5886   * Now the web server starts sending its response back (i.e. typically a web
5887     page and related data).
5888    
5889   * First, the server headers are read and processed to determine, among other
5890     things, the MIME type (document type) and encoding. The headers are then
5891     filtered as determined by the "+crunch-incoming-cookies", 
5892     "+session-cookies-only", and "+downgrade-http-version" actions.
5893    
5894   * If the "+kill-popups" action applies, and it is an HTML or JavaScript
5895     document, the popup-code in the response is filtered on-the-fly as it is
5896     received.
5897    
5898   * If a "+filter" or "+deanimate-gifs" action applies (and the document type
5899     fits the action), the rest of the page is read into memory (up to a
5900     configurable limit). Then the filter rules (from default.filter and any
5901     other filter files) are processed against the buffered content. Filters are
5902     applied in the order they are specified in one of the filter files.
5903     Animated GIFs, if present, are reduced to either the first or last frame,
5904     depending on the action setting.The entire page, which is now filtered, is
5905     then sent by Privoxy back to your browser.
5906    
5907     If neither "+filter" or "+deanimate-gifs" matches, then Privoxy passes the
5908     raw data through to the client browser as it becomes available.
5909    
5910   * As the browser receives the now (possibly filtered) page content, it reads
5911     and then requests any URLs that may be embedded within the page source,
5912     e.g. ad images, stylesheets, JavaScript, other HTML documents (e.g.
5913     frames), sounds, etc. For each of these objects, the browser issues a new
5914     request. And each such request is in turn processed as above. Note that a
5915     complex web page may have many such embedded URLs.
5916    
5917 -------------------------------------------------------------------------------
5918
5919 14.4. Troubleshooting: Anatomy of an Action
5920
5921 The way Privoxy applies actions and filters to any given URL can be complex,
5922 and not always so easy to understand what is happening. And sometimes we need
5923 to be able to see just what Privoxy is doing. Especially, if something Privoxy
5924 is doing is causing us a problem inadvertently. It can be a little daunting to
5925 look at the actions and filters files themselves, since they tend to be filled
5926 with regular expressions whose consequences are not always so obvious.
5927
5928 One quick test to see if Privoxy is causing a problem or not, is to disable it
5929 temporarily. This should be the first troubleshooting step. See the
5930 Bookmarklets section on a quick and easy way to do this (be sure to flush
5931 caches afterward!). Looking at the logs is a good idea too.
5932
5933 Another easy troubleshooting step to try is if you have done any customization
5934 of your installation, revert back to the installed defaults and see if that
5935 helps. There are times the developers get complaints about one thing or
5936 another, and the problem is more related to a customized configuration issue.
5937
5938 Privoxy also provides the http://config.privoxy.org/show-url-info page that can
5939 show us very specifically how actions are being applied to any given URL. This
5940 is a big help for troubleshooting.
5941
5942 First, enter one URL (or partial URL) at the prompt, and then Privoxy will tell
5943 us how the current configuration will handle it. This will not help with
5944 filtering effects (i.e. the "+filter" action) from one of the filter files
5945 since this is handled very differently and not so easy to trap! It also will
5946 not tell you about any other URLs that may be embedded within the URL you are
5947 testing. For instance, images such as ads are expressed as URLs within the raw
5948 page source of HTML pages. So you will only get info for the actual URL that is
5949 pasted into the prompt area -- not any sub-URLs. If you want to know about
5950 embedded URLs like ads, you will have to dig those out of the HTML source. Use
5951 your browser's "View Page Source" option for this. Or right click on the ad,
5952 and grab the URL.
5953
5954 Let's try an example, google.com, and look at it one section at a time in a
5955 sample configuration (your real configuration may vary):
5956
5957  Matches for http://google.com:                                                
5958                                                                                
5959  In file: default.action [ View ] [ Edit ]                                     
5960                                                                                
5961  {-add-header                                                                  
5962  -block                                                                        
5963  -content-type-overwrite                                                       
5964  -crunch-client-header                                                         
5965  -crunch-if-none-match                                                         
5966  -crunch-incoming-cookies                                                      
5967  -crunch-outgoing-cookies                                                      
5968  -crunch-server-header                                                         
5969  +deanimate-gifs {last}                                                        
5970  -downgrade-http-version                                                       
5971  +fast-redirects {check-decoded-url}                                           
5972  -filter {js-events}                                                           
5973  -filter {content-cookies}                                                     
5974  -filter {all-popups}                                                          
5975  -filter {banners-by-link}                                                     
5976  -filter {tiny-textforms}                                                      
5977  -filter {frameset-borders}                                                    
5978  -filter {demoronizer}                                                         
5979  -filter {shockwave-flash}                                                     
5980  -filter {quicktime-kioskmode}                                                 
5981  -filter {fun}                                                                 
5982  -filter {crude-parental}                                                      
5983  -filter {site-specifics}                                                      
5984  +filter {js-annoyances}                                                       
5985  +filter {html-annoyances}                                                     
5986  +filter {refresh-tags}                                                        
5987  +filter {unsolicited-popups}                                                  
5988  +filter {img-reorder}                                                         
5989  +filter {banners-by-size}                                                     
5990  +filter {webbugs}                                                             
5991  +filter {jumping-windows}                                                     
5992  +filter {ie-exploits}                                                         
5993  -filter-client-headers                                                        
5994  -filter-server-headers                                                        
5995  -force-text-mode                                                              
5996  -handle-as-empty-document                                                     
5997  -handle-as-image                                                              
5998  -hide-accept-language                                                         
5999  -hide-content-disposition                                                     
6000  +hide-forwarded-for-headers                                                   
6001  +hide-from-header {block}                                                     
6002  -hide-if-modified-since                                                       
6003  +hide-referrer {forge}                                                        
6004  -hide-user-agent                                                              
6005  -inspect-jpegs                                                                
6006  -kill-popups                                                                  
6007  -limit-connect                                                                
6008  -overwrite-last-modified                                                      
6009  +prevent-compression                                                          
6010  -redirect                                                                     
6011  -send-vanilla-wafer                                                           
6012  -send-wafer                                                                   
6013  +session-cookies-only                                                         
6014  +set-image-blocker {pattern}                                                  
6015  -treat-forbidden-connects-like-blocks }                                       
6016 /                                                                              
6017                                                                                
6018  { -session-cookies-only }                                                     
6019  .google.com                                                                   
6020                                                                                
6021  { -fast-redirects }                                                           
6022  .google.com                                                                   
6023                                                                                
6024 In file: user.action [ View ] [ Edit ]                                         
6025 (no matches in this file)                                                      
6026
6027 This is telling us how we have defined our "actions", and which ones match for
6028 our test case, "google.com". Displayed is all the actions that are available to
6029 us. Remember, the + sign denotes "on". - denotes "off". So some are "on" here,
6030 but many are "off". Each example we try may provide a slightly different end
6031 result, depending on our configuration directives.
6032
6033 The first listing is for our default.action file. The large, multi-line
6034 listing, is how the actions are set to match for all URLs, i.e. our default
6035 settings. If you look at your "actions" file, this would be the section just
6036 below the "aliases" section near the top. This will apply to all URLs as
6037 signified by the single forward slash at the end of the listing -- " / ".
6038
6039 But we have defined additional actions that would be exceptions to these
6040 general rules, and then we list specific URLs (or patterns) that these
6041 exceptions would apply to. Last match wins. Just below this then are two
6042 explicit matches for ".google.com". The first is negating our previous cookie
6043 setting, which was for "+session-cookies-only" (i.e. not persistent). So we
6044 will allow persistent cookies for google, at least that is how it is in this
6045 example. The second turns off any "+fast-redirects" action, allowing this to
6046 take place unmolested. Note that there is a leading dot here -- ".google.com".
6047 This will match any hosts and sub-domains, in the google.com domain also, such
6048 as "www.google.com" or "mail.google.com". But it would not match
6049 "www.google.de"! So, apparently, we have these two actions defined as
6050 exceptions to the general rules at the top somewhere in the lower part of our
6051 default.action file, and "google.com" is referenced somewhere in these latter
6052 sections.
6053
6054 Then, for our user.action file, we again have no hits. So there is nothing
6055 google-specific that we might have added to our own, local configuration. If
6056 there was, those actions would over-rule any actions from previously processed
6057 files, such as default.action. user.action typically has the last word. This is
6058 the best place to put hard and fast exceptions,
6059
6060 And finally we pull it all together in the bottom section and summarize how
6061 Privoxy is applying all its "actions" to "google.com": 
6062
6063  Final results:                                                                
6064                                                                                
6065  -add-header                                                                   
6066  -block                                                                        
6067  -content-type-overwrite                                                       
6068  -crunch-client-header                                                         
6069  -crunch-if-none-match                                                         
6070  -crunch-incoming-cookies                                                      
6071  -crunch-outgoing-cookies                                                      
6072  -crunch-server-header                                                         
6073  +deanimate-gifs {last}                                                        
6074  -downgrade-http-version                                                       
6075  -fast-redirects                                                               
6076  +filter {js-annoyances}                                                       
6077  +filter {html-annoyances}                                                     
6078  +filter {refresh-tags}                                                        
6079  +filter {unsolicited-popups}                                                  
6080  +filter {img-reorder}                                                         
6081  +filter {banners-by-size}                                                     
6082  +filter {webbugs}                                                             
6083  +filter {jumping-windows}                                                     
6084  +filter {ie-exploits}                                                         
6085  -filter-client-headers                                                        
6086  -filter-server-headers                                                        
6087  -force-text-mode                                                              
6088  -handle-as-empty-document                                                     
6089  -handle-as-image                                                              
6090  -hide-accept-language                                                         
6091  -hide-content-disposition                                                     
6092  +hide-forwarded-for-headers                                                   
6093  +hide-from-header {block}                                                     
6094  -hide-if-modified-since                                                       
6095  +hide-referrer {forge}                                                        
6096  -hide-user-agent                                                              
6097  -inspect-jpegs                                                                
6098  -kill-popups                                                                  
6099  -limit-connect                                                                
6100  -overwrite-last-modified                                                      
6101  +prevent-compression                                                          
6102  -redirect                                                                     
6103  -send-vanilla-wafer                                                           
6104  -send-wafer                                                                   
6105  -session-cookies-only                                                         
6106  +set-image-blocker {pattern}                                                  
6107  -treat-forbidden-connects-like-blocks                                         
6108
6109 Notice the only difference here to the previous listing, is to "fast-redirects"
6110 and "session-cookies-only", which are activated specifically for this site in
6111 our configuration, and thus show in the "Final Results".
6112
6113 Now another example, "ad.doubleclick.net":
6114
6115  { +block }                                                                    
6116   ad*.                                                                         
6117                                                                                
6118  { +block }                                                                    
6119   .ad.                                                                         
6120                                                                                
6121  { +block +handle-as-image }                                                   
6122   .[a-vx-z]*.doubleclick.net                                                   
6123
6124 We'll just show the interesting part here - the explicit matches. It is matched
6125 three different times. Two "+block" sections, and a "+block +handle-as-image",
6126 which is the expanded form of one of our aliases that had been defined as:
6127 "+block-as-image". ("Aliases" are defined in the first section of the actions
6128 file and typically used to combine more than one action.)
6129
6130 Any one of these would have done the trick and blocked this as an unwanted
6131 image. This is unnecessarily redundant since the last case effectively would
6132 also cover the first. No point in taking chances with these guys though ;-)
6133 Note that if you want an ad or obnoxious URL to be invisible, it should be
6134 defined as "ad.doubleclick.net" is done here -- as both a "+block" and an 
6135 "+handle-as-image". The custom alias "+block-as-image" just simplifies the
6136 process and make it more readable.
6137
6138 One last example. Let's try "http://www.example.net/adsl/HOWTO/". This one is
6139 giving us problems. We are getting a blank page. Hmmm ...
6140
6141  Matches for http://www.example.net/adsl/HOWTO/:                               
6142                                                                                
6143  In file: default.action [ View ] [ Edit ]                                     
6144                                                                                
6145  {-add-header                                                                  
6146   -block                                                                       
6147   -content-type-overwrite                                                      
6148   -crunch-client-header                                                        
6149   -crunch-if-none-match                                                        
6150   -crunch-incoming-cookies                                                     
6151   -crunch-outgoing-cookies                                                     
6152   -crunch-server-header                                                        
6153   +deanimate-gifs                                                              
6154   -downgrade-http-version                                                      
6155   +fast-redirects{check-decoded-url}                                           
6156   +filter{html-annoyances}                                                     
6157   +filter{js-annoyances}                                                       
6158   +filter{kill-popups}                                                         
6159   +filter{webbugs}                                                             
6160   +filter{nimda}                                                               
6161   +filter{banners-by-size}                                                     
6162   +filter{hal}                                                                 
6163   +filter{fun}                                                                 
6164   -filter-client-headers                                                       
6165   -filter-server-headers                                                       
6166   -force-text-mode                                                             
6167   -handle-as-empty-document                                                    
6168   -handle-as-image                                                             
6169   -hide-accept-language                                                        
6170   -hide-content-disposition                                                    
6171   +hide-forwarded-for-headers                                                  
6172   +hide-from-header{block}                                                     
6173   +hide-referer{forge}                                                         
6174   -hide-user-agent                                                             
6175   -inspect-jpegs                                                               
6176   +kill-popups                                                                 
6177   -overwrite-last-modified                                                     
6178   +prevent-compression                                                         
6179   -redirect                                                                    
6180   -send-vanilla-wafer                                                          
6181   -send-wafer                                                                  
6182   +session-cookies-only                                                        
6183   +set-image-blocker{blank}                                                    
6184   -treat-forbidden-connects-like-blocks }                                      
6185    /                                                                           
6186                                                                                
6187  { +block +handle-as-image }                                                   
6188   /ads                                                                         
6189
6190 Ooops, the "/adsl/" is matching "/ads" in our configuration! But we did not
6191 want this at all! Now we see why we get the blank page. It is actually
6192 triggering two different actions here, and the effects are aggregated so that
6193 the URL is blocked, and Privoxy is told to treat the block as if it were an
6194 image. But this is, of course, all wrong. We could now add a new action below
6195 this (or better in our own user.action file) that explicitly un blocks ( "
6196 {-block}") paths with "adsl" in them (remember, last match in the configuration
6197 wins). There are various ways to handle such exceptions. Example:
6198
6199  { -block }                                                                    
6200   /adsl                                                                        
6201
6202 Now the page displays ;-) Remember to flush your browser's caches when making
6203 these kinds of changes to your configuration to insure that you get a freshly
6204 delivered page! Or, try using Shift+Reload.
6205
6206 But now what about a situation where we get no explicit matches like we did
6207 with:
6208
6209  { +block +handle-as-image }                                                   
6210  /ads                                                                          
6211
6212 That actually was very helpful and pointed us quickly to where the problem was.
6213 If you don't get this kind of match, then it means one of the default rules in
6214 the first section of default.action is causing the problem. This would require
6215 some guesswork, and maybe a little trial and error to isolate the offending
6216 rule. One likely cause would be one of the "+filter" actions. These tend to be
6217 harder to troubleshoot. Try adding the URL for the site to one of aliases that
6218 turn off "+filter":
6219
6220  { shop }                                                                      
6221  .quietpc.com                                                                  
6222  .worldpay.com   # for quietpc.com                                             
6223  .jungle.com                                                                   
6224  .scan.co.uk                                                                   
6225  .forbes.com                                                                   
6226
6227 "{ shop }" is an "alias" that expands to "{ -filter -session-cookies-only }".
6228 Or you could do your own exception to negate filtering: 
6229
6230  { -filter }                                                                   
6231  # Disable ALL filter actions for sites in this section                        
6232  .forbes.com                                                                   
6233  developer.ibm.com                                                             
6234  localhost                                                                     
6235
6236 This would turn off all filtering for these sites. This is best put in
6237 user.action, for local site exceptions. Note that when a simple domain pattern
6238 is used by itself (without the subsequent path portion), all sub-pages within
6239 that domain are included automatcially in the scope of the action.
6240
6241 Images that are inexplicably being blocked, may well be hitting the "+filter
6242 {banners-by-size}" rule, which assumes that images of certain sizes are ad
6243 banners (works well most of the time since these tend to be standardized).
6244
6245 "{ fragile }" is an alias that disables most actions that are the most likely
6246 to cause trouble. This can be used as a last resort for problem sites.
6247
6248  { fragile }                                                                   
6249  # Handle with care: easy to break                                             
6250  mail.google.                                                                  
6251  mybank.example.com                                                            
6252
6253 Remember to flush caches! Note that the mail.google reference lacks the TLD
6254 portion (e.g. ".com". This will effectively match any TLD with google in it,
6255 such as mail.google.de, just as an example.
6256
6257 If this still does not work, you will have to go through the remaining actions
6258 one by one to find which one(s) is causing the problem.
6259