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