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