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