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