This is the break up of configuration.html into multiple files. This
[privoxy.git] / doc / source / user-manual.sgml
1 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
2 <!entity % dummy "IGNORE"> 
3 <!entity supported SYSTEM "supported.sgml">
4 <!entity newfeatures SYSTEM "newfeatures.sgml">
5 <!entity p-intro SYSTEM "privoxy.sgml">
6 <!entity seealso SYSTEM "seealso.sgml">
7 <!entity buildsource SYSTEM "buildsource.sgml">
8 <!entity contacting SYSTEM "contacting.sgml">
9 <!entity history SYSTEM "history.sgml">
10 <!entity copyright SYSTEM "copyright.sgml">
11 <!entity p-version "2.9.14">
12 <!entity p-status "beta">
13 <!entity % p-not-stable "INCLUDE">
14 <!entity % p-stable "IGNORE">
15 <!entity % p-text "IGNORE">        <!-- define we are not a text only doc -->
16 <!entity % p-doc "INCLUDE">        <!-- and we are a formal doc           -->
17 <!entity % p-readme "IGNORE">
18 <!entity % p-config "IGNORE">
19 <!entity % p-supp-userman "IGNORE"> <!-- Omit some from supported.sgml    -->
20 ]>
21 <!--
22  File        :  $Source: /cvsroot/ijbswa/current/doc/source/user-manual.sgml,v $
23
24  Purpose     :  user manual
25                 This file belongs into
26                 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
27                 
28  $Id: user-manual.sgml,v 1.97 2002/04/27 21:04:42 hal9 Exp $
29
30  Written by and Copyright (C) 2001 the SourceForge
31  Privoxy team. http://www.privoxy.org/
32
33  Based on the Internet Junkbuster originally written
34  by and Copyright (C) 1997 Anonymous Coders and 
35  Junkbusters Corporation.  http://www.junkbusters.com
36
37
38  ========================================================================
39  NOTE: Please read developer-manual/documentation.html before touching 
40  anything in this, or other Privoxy documentation.
41  ========================================================================
42
43 -->
44
45 <article id="index">
46 <artheader>
47 <title>Privoxy User Manual</title>
48
49 <pubdate>$Id: user-manual.sgml,v 1.97 2002/04/27 21:04:42 hal9 Exp $</pubdate>
50
51 <authorgroup>
52  <author>
53   <affiliation>
54    <orgname>By: Privoxy Developers</orgname>
55    </affiliation>
56  </author>
57 </authorgroup>
58
59 <abstract>
60 <![%dummy;[
61  <para>
62  <comment>
63   This is here to keep vim syntax file from breaking :/
64   If I knew enough to fix it, I would.
65   PLEASE DO NOT REMOVE! HB: hal@foobox.net
66  </comment>
67  </para>
68 ]]>
69
70  <para>
71   The user manual gives users information on how to install, configure and use
72   <ulink
73   url="http://www.privoxy.org/"><application>Privoxy</application></ulink>.
74   </para>
75
76 <!-- Include privoxy.sgml boilerplate: -->
77  &p-intro;
78 <!-- end privoxy.sgml -->
79
80  <para>
81   You can find the latest version of the user manual at  <ulink
82   url="http://www.privoxy.org/user-manual/">http://www.privoxy.org/user-manual/</ulink>.
83   Please see the <ulink url="contact.html">Contact section</ulink> on how to
84   contact the developers.
85   </para>
86
87 <!--   <para> -->
88 <!--    Feel free to send a note to the developers at <email>ijbswa-developers@lists.sourceforge.net</email>. -->
89 <!--   </para> -->
90 </abstract>
91
92 </artheader>
93
94 <!--   ~~~~~       New section      ~~~~~     -->
95 <sect1 id="intro" label=""><title></title>
96 <!-- dummy section to force TOC on page by itself -->
97 <!-- DO NOT REMOVE! please ;) -->
98 <para> </para>
99 </sect1>
100
101 <!--   ~~~~~       New section      ~~~~~     -->
102 <sect1 label="1" id="introduction"><title>Introduction</title>
103 <para>
104  This documentation is included with the current &p-status; version of
105  <application>Privoxy</application>, v.&p-version;<![%p-not-stable;[, 
106  and is mostly complete at this point. The most up to date reference for the
107  time being is still the comments in the source files and in the individual
108  configuration files. Development of version 3.0 is currently nearing
109  completion, and includes many significant changes and enhancements over
110  earlier versions. The target release date for
111  stable v3.0 is <quote>soon</quote> ;-)]]>.
112 </para>
113
114 <!-- include only in non-stable versions -->
115 <![%p-not-stable;[
116 <para>
117  Since this is a &p-status; version, not all new features are well tested. This
118  documentation may be slightly out of sync as a result (especially with 
119  CVS sources). And there <emphasis>may be</emphasis> bugs, though hopefully
120  not many! 
121 </para>
122 ]]>
123
124 <!--   ~~~~~       New section      ~~~~~     -->
125 <sect2 id="features"><title>Features</title>
126 <para>
127  In addition to <application>Internet Junkbuster's</application> traditional
128  features of ad and banner blocking and cookie management,
129  <application>Privoxy</application> provides new features<![%p-not-stable;[,
130  some of them currently under development]]>:
131 </para>
132 <!-- Include newfeatures.sgml boilerplate here: -->
133  &newfeatures;
134 <!-- end boilerplate -->
135 </sect2>
136
137 </sect1>
138
139 <!--  ~  End section  ~  -->
140
141
142 <!--   ~~~~~       New section      ~~~~~     -->
143 <sect1 id="installation"><title>Installation</title>
144
145 <para>
146  <application>Privoxy</application> is available both in convenient pre-compiled
147  packages for a wide range of operating systems, and as raw source code.
148  For most users, we recommend using the packages, which can be downloaded from our
149  <ulink url="http://sourceforge.net/projects/ijbswa/">Privoxy Project
150  Page</ulink>. For installing and compiling the source code, please look 
151  into our Developer Manual.
152 </para>
153
154 <para>
155  If you like to live on the bleeding edge and are not afraid of using
156  possibly unstable development versions, you can check out the up-to-the-minute
157  version directly from <ulink url="http://sourceforge.net/cvs/?group_id=11118">the
158  CVS repository</ulink> or simply download <ulink
159  url="http://cvs.sourceforge.net/cvstarballs/ijbswa-cvsroot.tar.gz">the nightly CVS
160  tarball.</ulink> Again, we refer you to the Developer Manual.
161 </para>
162
163 <!-- Include supported.sgml boilerplate -->
164  &supported; 
165 <!-- end boilerplate -->
166
167 <para>
168  Note: If you have a previous <application>Junkbuster</application> or
169  <application>Privoxy</application> installation on your system, you
170  will need to remove it.  Some platforms do this for you as part 
171  of their installation procedure. (See below for your platform).
172 </para>
173
174 <para>
175  In any case <emphasis>be sure to backup your old configuration
176  if it is valuable to you.</emphasis> See the
177  <link linkend="upgradersnote">note to upgraders</link> section
178  below.
179 </para>
180
181 <!--   ~~~~~       New section      ~~~~~     -->
182 <sect2 id="installation-pack-rpm"><title>Red Hat and SuSE RPMs</title>
183
184 <para>
185  RPMs can be installed with <literal>rpm -Uvh privoxy-&p-version;-1.rpm</literal>,
186  and will use <filename>/etc/privoxy</filename> for the location 
187  of configuration files.
188 </para>
189
190 <para>
191  Note that on Red Hat, <application>Privoxy</application> will
192  <emphasis>not</emphasis> be automatically started on system boot. You will
193  need to enable that using <command>chkconfig</command>,
194  <command>ntsysv</command>, or similar methods. Note that SuSE will 
195 automatically start Privoxy in the boot process.
196 </para>
197
198 <para>
199  If you have problems with failed dependencies, try rebuilding the SRC RPM: 
200  <literal>rpm --rebuild privoxy-&p-version;-1.src.rpm;</literal>. This 
201  will use your locally installed libraries and RPM version. 
202 </para>
203
204 <para>
205  Also note that if you have a <application>Junkbuster</application> RPM installed
206  on your system, you need to remove it first, because the packages conflict.
207  Otherwise, RPM will try to remove <application>Junkbuster</application>
208  automatically, before installing <application>Privoxy</application>.
209 </para>
210 </sect2>
211
212 <!--   ~~~~~       New section      ~~~~~     -->
213 <sect2 id="installation-deb"><title>Debian</title>
214 <para>
215  FIXME.
216 </para>
217 </sect2>
218
219 <!--   ~~~~~       New section      ~~~~~     -->
220 <sect2 id="installation-pack-win"><title>Windows</title>
221
222 <para>
223  Just double-click the installer, which will guide you through
224  the installation process. You will find the configuration files
225  in the same directory as you installed Privoxy in. We do not
226  use the registry of Windows. 
227 </para>
228 </sect2>
229
230 <!--   ~~~~~       New section      ~~~~~     -->
231 <sect2 id="installation-pack-bintgz"><title>Solaris, NetBSD, FreeBSD, HP-UX</title>
232
233 <para>
234  Create a new directory, <literal>cd</literal> to it, then unzip and
235  untar the archive. For the most part, you'll have to figure out where
236  things go. FIXME.
237 </para>
238 </sect2>
239
240 <!--   ~~~~~       New section      ~~~~~     -->
241 <sect2 id="installation-os2"><title>OS/2</title>
242
243 <para>
244  First, make sure that no previous installations of
245  <application>Junkbuster</application> and / or 
246  <application>Privoxy</application> are left on your
247  system. You can do this by 
248 </para>
249
250 <para>
251  Then, just double-click the WarpIN self-installing archive, which will
252  guide you through the installation process. A shadow of the
253  <application>Privoxy</application> executable will be placed in your
254  startup folder so it will start automatically whenever OS/2 starts.
255 </para>
256
257 <para>
258  The directory you choose to install <application>Privoxy</application>
259  into will contain all of the configuration files.
260 </para>
261 </sect2>
262
263 <!--   ~~~~~       New section      ~~~~~     -->
264 <sect2 id="installation-mac"><title>Max OSX</title>
265 <para>
266  Unzip the downloaded package (you can either double-click on the file
267  in the finder, or on the desktop if you downloaded it there).  Then,
268  double-click on the package installer icon and follow the installation
269  process.
270  <application>Privoxy</application> will be installed in the subdirectory
271  <literal>/Applications/Privoxy.app</literal>.
272  <application>Privoxy</application> will set itself up to start 
273  automatically on system bring-up via
274  <literal>/System/Library/StartupItems/Privoxy</literal>.
275 </para>
276 </sect2>
277
278 <!--   ~~~~~       New section      ~~~~~     -->
279 <sect2 id="installation-amiga"><title>AmigaOS</title>
280 <para>
281  Copy and then unpack the <filename>lha</filename> archive to a suitable location. 
282  All necessary files will be installed into <application>Privoxy</application>
283  directory, including all configuration and log files. To uninstall, just 
284  remove this directory.
285 </para>
286 <para>
287  Start <application>Privoxy</application> (with RUN &lt;&gt;NIL:) in your
288  <filename>startnet</filename> script (AmiTCP), in
289  <filename>s:user-startup</filename> (RoadShow), as startup program in your
290  startup script (Genesis), or as startup action (Miami and MiamiDx). 
291  <application>Privoxy</application> will automatically quit when you quit your
292  TCP/IP stack (just ignore the harmless warning your TCP/IP stack may display that
293  <application>Privoxy</application> is still running).
294 </para>
295 </sect2>
296 </sect1>
297
298 <!--  ~  End section  ~  -->
299
300 <!--   ~~~~~       New section      ~~~~~     -->
301 <sect1 id="upgradersnote">
302 <title>Note to Upgraders</title>
303 <para>
304  There are very significant changes from older versions of 
305  <application>Junkbuster</application> to the current
306  <application>Privoxy</application>. Configuration is substantially 
307  changed. <application>Junkbuster 2.0.x</application> and earlier 
308  configuration files will not migrate. The functionality of the old
309  <filename>blockfile</filename>, <filename>cookiefile</filename> and
310  <filename>imagelist</filename>, are now combined into the
311  <ulink url="actions-file.html"><quote>actions files</quote></ulink>.  
312  <filename>default.action</filename>, is the main actions file. Local
313  exceptions should best be put into <filename>user.action</filename>.
314 </para>
315 <para>
316  A <ulink url="filter-file.html"><quote>filter file</quote></ulink> (typically
317  <filename>default.filter</filename>) is new as of <application>Privoxy
318  2.9.x</application>, and provides some of the new sophistication (explained
319  below). <filename>config</filename> is much the same as before.
320 </para>
321 <para>
322  If upgrading from a 2.0.x version, you will have to use the new config 
323  files, and possibly adapt any personal rules from your older files.
324  When porting personal rules over from the old <filename>blockfile</filename>
325  to the new actions files, please note that even the pattern syntax has
326  changed. If upgrading from 2.9.x development versions, it is still
327  recommended to use the new configuration files.
328 </para>
329 <para>
330  A quick list of things to be aware of before upgrading: 
331 </para>
332
333 <para>
334  <itemizedlist>
335
336  <listitem>
337   <para>
338    The default listening port is now 8118 due to a conflict with another 
339    service (NAS).
340   </para>
341  </listitem>  
342  <listitem>
343   <para>  
344     Some installers may remove earlier versions completely. Save any 
345     important configuration files!
346   </para>
347  </listitem>
348  <listitem>
349   <para>
350    <application>Privoxy</application> is controllable with a web browser 
351    at the special URL: <ulink
352    url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
353    (Shortcut: <ulink url="http://p.p/">http://p.p/</ulink>). Many
354    aspects of configuration can be done here, including temporarily disabling
355    <application>Privoxy</application>.
356   </para>
357  </listitem> 
358  <listitem>
359   <para>
360    The primary configuration file for cookie management, ad and banner 
361    blocking, and many other aspects of <application>Privoxy</application>
362    configuration is in the <ulink url="actions-file.html">actions
363    files</ulink>. It is strongly recommended to become familiar with the new
364    actions concept below, before modifying these files. Locally defined rules 
365    should go into <filename>user.action</filename>.
366   </para>
367  </listitem> 
368   <listitem>
369   <para>
370 <!-- I think it is best to keep this somewhat vague, in case  -->
371 <!-- the situation changes under our feet. -->   
372    Some installers may not automatically start
373    <application>Privoxy</application> after installation.
374   </para>
375  </listitem> 
376
377  </itemizedlist>
378 </para>
379 </sect1>
380
381 <!--   ~~~~~       New section      ~~~~~     -->
382 <sect1 id="quickstart"><title>Quickstart to Using <application>Privoxy</application></title>
383 <para>
384  <itemizedlist>
385
386  <listitem>
387   <para>
388   Install <application>Privoxy</application>. See the section <link linkend="installation">Installing</link>.
389   </para>
390  </listitem>  
391
392  <listitem>
393   <para>
394   Start <application>Privoxy</application>. See the section <link linkend="startup">Starting <application>Privoxy</application></link>.
395   </para>
396  </listitem>  
397
398  <listitem>
399   <para>
400   Change your browser's configuration to use the proxy <literal>localhost</literal> on port
401   <literal>8118</literal>. See the section <link linkend="startup">Starting <application>Privoxy</application></link>.
402   </para>
403  </listitem>  
404
405  <listitem>
406   <para>
407   Enjoy surfing with enhanced comfort and privacy. Please see the section
408   <link linkend="contact">Contacting the Developers</link> on how to report
409   bugs or problems with websites or to get help. You may want to change the
410   file <filename>user.action</filename> to further tweak your new browsing
411   experience.
412   </para>
413  </listitem>  
414
415  </itemizedlist>
416 </para>
417
418 </sect1>
419
420 <!--   ~~~~~       New section      ~~~~~     -->
421 <sect1 id="startup">
422 <title>Starting <application>Privoxy</application></title>
423 <para>
424  Before launching <application>Privoxy</application> for the first time, you 
425  will want to configure your browser(s) to use <application>Privoxy</application>
426  as a HTTP and HTTPS proxy. The default is localhost for the proxy address,
427  and port 8118 (earlier versions used port 8000). This is the one
428  configuration step that must be done! 
429 </para>
430  
431 <para> 
432  With <application>Netscape</application> (and
433  <application>Mozilla</application>), this can be set under <literal>Edit
434  -&gt; Preferences -&gt; Advanced -&gt; Proxies -&gt; HTTP Proxy</literal>.
435  For <application>Internet Explorer</application>: <literal>Tools -&gt;
436  Internet Properties -&gt; Connections -&gt; LAN Setting</literal>. Then,
437  check <quote>Use Proxy</quote> and fill in the appropriate info (Address:
438  localhost, Port: 8118). Include if HTTPS proxy support too.
439 </para>
440
441 <para>
442  After doing this, flush your browser's disk and memory caches to force a
443  re-reading of all pages and to get rid of any ads that may be cached. You 
444  are now ready to start enjoying the benefits of using
445  <application>Privoxy</application>!
446 </para>
447
448
449 <para>
450  <application>Privoxy</application> is typically started by specifying the
451  main configuration file to be used on the command line. Example Unix startup
452  command:
453 </para>
454
455 <para>
456  <screen>
457  # /usr/sbin/privoxy /etc/privoxy/config
458 </screen>
459 </para>
460
461 <para>
462  See <link linkend="cmdoptions">below</link> for other command line options.
463 </para>
464
465 <para>
466  An init script is provided for SuSE and Red Hat.
467 </para>
468
469 <para>
470  For for SuSE: <command>rcprivoxy start</command>
471 </para>
472
473 <para>
474  For Red Hat and Debian: <command>/etc/rc.d/init.d/privoxy start</command>
475 </para>
476
477
478 <para>
479  If no configuration file is specified on the command line,
480  <application>Privoxy</application> will look for a file named
481  <filename>config</filename> in the current directory. Except on Win32 where
482  it will try <filename>config.txt</filename>. If no file is specified on the
483  command line and no default configuration file can be found, 
484  <application>Privoxy</application> will fail to start.
485 </para>
486
487
488 <para>
489  The included default configuration files should give a reasonable starting
490  point. Most of the per site configuration is done in the
491  <ulink url="actions-file.html"><quote>actions</quote></ulink> files. These are
492  where various cookie actions are defined, ad and banner blocking, and other
493  aspects of <application>Privoxy</application> configuration. There are several
494  such files included, with varying levels of aggressiveness. 
495 </para>
496
497 <para>
498  You will probably want to keep an eye out for sites for which you may prefer
499  persistent cookies, and add these to your actions configuration as needed. By
500  default, most of these will be accepted only during the current browser
501  session (aka <quote>session cookies</quote>), unless you add them to the
502  configuration. If you want the browser to handle this instead, you will need
503  to edit <filename>user.action</filename> (or through the web based interface)
504  and disable this feature. If you use more than one browser, it would make
505  more sense to let <application>Privoxy</application> handle this. In which
506  case, the browser(s) should be set to accept all cookies.
507 </para>
508
509 <para>
510  Another feature where you will probably want to define exceptions for trusted
511  sites is the popup-killing (through the <ulink
512  url="actions-file.html#KILL-POPUPS"><quote>+kill-popups</quote></ulink>and
513  <ulink
514  url="actions-file.html#FILTER-POPUPS"><quote>+filter{popups}</quote></ulink>
515  actions), because your favorite shopping, banking, or leisure site may need
516  popups (explained below). 
517 </para>
518
519 <para>
520  <application>Privoxy</application> is HTTP/1.1 compliant,  but not all of
521  the optional 1.1 features are as yet supported. In the unlikely event that
522  you experience inexplicable problems with browsers that use HTTP/1.1 per default
523  (like <application>Mozilla</application> or recent versions of I.E.), you might
524  try to force HTTP/1.0 compatibility. For Mozilla, look under <literal>Edit -&gt;
525  Preferences -&gt; Debug -&gt; Networking</literal>.
526  Alternatively, set the <quote>+downgrade-http-version</quote> config option in
527  <filename>default.action</filename> which will downgrade your browser's HTTP
528  requests from HTTP/1.1 to HTTP/1.0 before processing them.
529 </para>
530
531 <para>
532  After running <application>Privoxy</application> for a while, you can 
533  start to fine tune the configuration to suit your personal, or site, 
534  preferences and requirements. There are many, many aspects that can 
535  be customized. <quote>Actions</quote> 
536  can be adjusted by pointing your browser to 
537  <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
538  (shortcut: <ulink url="http://p.p/">http://p.p/</ulink>), 
539  and then follow the link to <quote>View &#38; Change the Current Configuration</quote>. 
540  (This is an internal page and does not require Internet access.)
541 </para>
542
543 <para>
544  In fact, various aspects of <application>Privoxy</application>
545  configuration can be viewed from this page, including 
546  current configuration parameters, source code version numbers, 
547  the browser's request headers, and <quote>actions</quote> that apply 
548  to a given URL. In addition to the actions file 
549  editor mentioned above, <application>Privoxy</application> can also 
550  be turned <quote>on</quote> and <quote>off</quote> (toggled) from this page.
551 </para>
552
553 <para>
554  If you encounter problems, try loading the page without
555  <application>Privoxy</application>. If that helps, enter the URL where
556  you have the problems into <ulink url="http://p.p/show-url-info">the browser
557  based rule tracing utility</ulink>. See which rules apply and why, and
558  then try turning them off for that site one after the other, until the problem
559  is gone. When you have found the culprit, you might want to turn the rest on
560  again.
561 </para>
562
563 <para>
564  If the above paragraph sounds gibberish to you, you might want to <ulink
565  url="actions-file.html#ACTIONSFILE">read more about the actions concept</ulink>
566  or even dive deep into the <ulink url="appendix.html#ACTIONSANAT">Appendix
567  on actions</ulink>.
568 </para>
569
570 <para>
571  If you can't get rid of the problem at all, think you've found a bug in
572  Privoxy, want to propose a new feature or smarter rules, please see the 
573  section <ulink url="contact.html"><quote>Contacting the
574  Developers</quote></ulink> below. 
575 </para>
576
577 <!--   ~~~~~       New section      ~~~~~     -->
578 <sect2 id="cmdoptions">
579 <title>Command Line Options</title>
580 <para>
581  <application>Privoxy</application> may be invoked with the following
582  command-line options:
583 </para>
584
585 <para>
586  <itemizedlist>
587
588  <listitem>
589   <para>
590     <emphasis>--version</emphasis>
591   </para>
592   <para>
593      Print version info and exit. Unix only.
594   </para>
595  </listitem> 
596  <listitem>
597   <para>
598     <emphasis>--help</emphasis>
599   </para>
600   <para>
601    Print short usage info and exit. Unix only.
602   </para>
603  </listitem> 
604  <listitem>
605   <para>
606    <emphasis>--no-daemon</emphasis>
607   </para>
608   <para>
609    Don't become a daemon, i.e. don't fork and become process group
610    leader, and don't detach from controlling tty. Unix only.
611   </para>
612  </listitem> 
613  <listitem>
614   <para>
615    <emphasis>--pidfile FILE</emphasis>
616   
617   </para>
618   <para>
619    On startup, write the process ID to <emphasis>FILE</emphasis>. Delete the
620    <emphasis>FILE</emphasis> on exit. Failure to create or delete the
621    <emphasis>FILE</emphasis> is non-fatal. If no <emphasis>FILE</emphasis>
622    option is given, no PID file will be used. Unix only.
623   </para>
624  </listitem> 
625  <listitem>
626   <para>
627    <emphasis>--user USER[.GROUP]</emphasis>
628   
629   </para>
630   <para>
631    After (optionally) writing the PID file, assume the user  ID  of
632    <emphasis>USER</emphasis>, and if included the GID of GROUP.  Exit if the
633    privileges are not sufficient to do so. Unix only.
634   </para>
635  </listitem> 
636  <listitem>
637   <para>
638     <emphasis>configfile</emphasis>
639   </para>
640   <para>
641     If no <emphasis>configfile</emphasis> is included on the command line, 
642     <application>Privoxy</application> will look for a file named 
643     <quote>config</quote> in the current directory (except on Win32 
644     where it will look for <quote>config.txt</quote> instead). Specify 
645     full path to avoid confusion. If no config file is found, 
646     <application>Privoxy</application> will fail to start.
647   </para>
648  </listitem> 
649
650  </itemizedlist>
651 </para>
652
653 </sect2>
654
655 </sect1>
656
657 <!--  ~  End section  ~  -->
658
659
660 <!--   ~~~~~       New section      ~~~~~     -->
661 <sect1 id="configuration"><title><application>Privoxy</application> Configuration</title>
662  <para>
663   All <application>Privoxy</application> configuration is stored  
664   in text files. These files can be edited with a text editor.
665   Many important aspects of <application>Privoxy</application> can 
666   also be controlled easily with a web browser.
667  </para>
668
669
670 <!--   ~~~~~       New section      ~~~~~     -->
671
672 <sect2>
673 <title>Controlling <application>Privoxy</application> with Your Web Browser</title>
674 <para>
675  <application>Privoxy</application>'s user interface can be reached through the special 
676  URL <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
677  (shortcut: <ulink url="http://p.p/">http://p.p/</ulink>), 
678  which is a built-in page and works without Internet access.
679  You will see the following section:
680
681 </para>
682
683 <!-- Needs to be put in a table and colorized  -->
684 <screen>
685  <msgtext>
686  <bridgehead renderas="sect2">Privoxy Menu</bridgehead>
687
688  <simplelist>
689  <member>
690   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&squf;&nbsp;&nbsp;<ulink url="http://config.privoxy.org/show-status">View & change the current configuration</ulink>
691  </member>
692  <member>
693   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&squf;&nbsp;&nbsp;<ulink url="http://config.privoxy.org/show-version">View the source code version numbers</ulink>
694  </member>
695  <member>
696   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&squf;&nbsp;&nbsp;<ulink url="http://config.privoxy.org/show-request">View the request headers.</ulink>
697  </member>
698  <member>
699   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&squf;&nbsp;&nbsp;<ulink url="http://config.privoxy.org/show-url-info">Look up which actions apply to a URL and why</ulink>
700  </member>
701  <member>
702   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&squf;&nbsp;&nbsp;<ulink url="http://config.privoxy.org/toggle">Toggle Privoxy on or off</ulink>
703  </member>
704  </simplelist>
705  </msgtext>
706 </screen>
707
708
709 <para>
710  This should be self-explanatory. Note the first item leads to an editor for the
711  <quote>actions list</quote>, which is where the ad, banner, cookie,
712  and URL blocking magic is configured as well as other advanced features of
713  <application>Privoxy</application>. This is an easy way to adjust various
714  aspects of <application>Privoxy</application> configuration. The actions
715  file, and other configuration files, are explained in detail below. 
716 </para>
717
718 <para>
719  <quote>Toggle Privoxy On or Off</quote> is handy for sites that might 
720  have problems with your current actions and filters. You can in fact use
721  it as a test to see whether it is <application>Privoxy</application> 
722  causing the problem or not. <application>Privoxy</application> continues 
723  to run as a proxy in this case, but all filtering is disabled. There
724  is even a toggle <link linkend="bookmarklets">Bookmarklet</link> offered, so
725  that you can toggle <application>Privoxy</application> with one click from
726  your browser.
727 </para>
728
729 </sect2>
730
731 <!--  ~  End section  ~  -->
732
733
734
735
736 <!--   ~~~~~       New section      ~~~~~     -->
737
738 <sect2 id="confoverview">
739 <title>Configuration Files Overview</title>
740 <para>
741  For Unix, *BSD and Linux, all configuration files are located in
742  <filename>/etc/privoxy/</filename> by default. For MS Windows, OS/2, and
743  AmigaOS these are all in the same directory as the 
744  <application>Privoxy</application> executable. <![%p-not-stable;[ The name
745  and number of configuration files has changed from previous versions, and is
746  subject to change as development progresses.]]>
747 </para>
748
749 <para>
750  The installed defaults provide a reasonable starting point, though 
751  some settings may be aggressive by some standards. For the time being, the
752  principle configuration files are:
753 </para>
754
755 <para>
756  <itemizedlist>
757
758   <listitem>
759    <para>
760      The main configuration file is named <link linkend="config">config</link>
761      on Linux, Unix, BSD, OS/2, and AmigaOS and <filename>config.txt</filename>
762      on Windows. This is a required file.
763    </para>
764   </listitem> 
765
766   <listitem>
767    <para>
768     <filename>default.action</filename> (the main <link linkend="actions-file">actions file</link>) is used to define
769     the default settings for various <quote>actions</quote> relating to images, banners, 
770     pop-ups, access restrictions, banners and cookies.
771    </para>
772    <para>
773     Multiple actions files may be defined in <filename>config</filename>. These 
774     are processed in the order they are defined. Local customizations and locally 
775     preferred exceptions to the default policies as defined in
776     <filename>default.action</filename> are probably best applied in
777     <filename>user.action</filename>, which should be preserved across
778     upgrades. <filename>standard.action</filename> is also included. This is mostly 
779     for <application>Privoxy's</application> internal use.
780    </para>
781    <para>    
782     There is also a web based editor that can be accessed from
783     <ulink
784     url="http://config.privoxy.org/show-status/">http://config.privoxy.org/show-status/</ulink>
785     (Shortcut: <ulink
786     url="http://p.p/show-status/">http://p.p/show-status/</ulink>) for the
787     various actions files. 
788    </para>
789   </listitem> 
790
791   <listitem>
792    <para>
793     <filename>default.filter</filename> (the <link linkend="filter-file">filter
794     file</link>) can be used to re-write the raw page content, including
795     viewable text as well as embedded HTML and JavaScript, and whatever else
796     lurks on any given web page. The filtering jobs are only pre-defined here;
797     whether to apply them or not is up to the actions files.
798    </para>
799   </listitem> 
800
801  </itemizedlist>
802 </para>
803
804 <para>
805  All files use the <quote><literal>#</literal></quote> character to denote a
806  comment (the rest of the line will be ignored) angd understand line continuation
807  through placing a backslash ("<literal>\</literal>") as the very last character
808  in a line. If the <literal>#</literal> is preceded by a backslash, it looses
809  its special function. Placing a <literal>#</literal> in front of an otherwise
810  valid configuration line to prevent it from being interpreted is called "commenting
811  out" that line.
812 </para>
813
814 <para>
815  The actions files and <filename>default.filter</filename> 
816  can use Perl style <link linkend="regex">regular expressions</link> for
817  maximum flexibility. 
818 </para>
819
820 <para>
821  After making any changes, there is no need to restart
822  <application>Privoxy</application> in order for the changes to take
823  effect. <application>Privoxy</application> detects such changes 
824  automatically. Note, however, that it may take one or two additional
825  requests for the change to take effect. When changing the listening address
826  of <application>Privoxy</application>, these <quote>wake up</quote> requests
827  must obviously be sent to the <emphasis>old</emphasis> listening address.
828 </para>
829
830 <![%p-not-stable;[
831 <para>
832  While under development, the configuration content is subject to change. 
833  The below documentation may not be accurate by the time you read this. 
834  Also, what constitutes a <quote>default</quote> setting, may change, so 
835  please check all your configuration files on important issues.
836 </para>
837 ]]>
838
839 </sect2>
840 </sect1>
841 <!--  ~  End section  ~  -->
842
843
844 <!--   ~~~~~~~~       New section Header    ~~~~~~~~~     -->
845
846 <sect1 id="config">
847 <title>The Main Configuration File</title>
848
849 <para>
850  Again, the main configuration file is named <filename>config</filename> on
851  Linux/Unix/BSD and OS/2, and <filename>config.txt</filename> on Windows.
852  Configuration lines consist of an initial keyword followed by a list of
853  values, all separated by whitespace (any number of spaces or tabs). For
854  example:
855 </para>
856
857 <para>
858  <literal>
859   <msgtext> 
860    <literallayout>
861   <emphasis>confdir /etc/privoxy</emphasis>
862    </literallayout>
863   </msgtext>
864  </literal> 
865 </para>
866
867 <para>
868  Assigns the value <literal>/etc/privoxy</literal> to the option
869  <literal>confdir</literal> and thus indicates that the configuration
870  directory is named <quote>/etc/privoxy/</quote>.
871 </para>
872
873 <para>
874  All options in the config file except for <literal>confdir</literal> and
875  <literal>logdir</literal> are optional. Watch out in the below description
876  for what happens if you leave them unset.
877 </para>
878
879 <para>
880  The main config file controls all aspects of <application>Privoxy</application>'s
881  operation that are not location dependent (i.e. they apply universally, no matter
882  where you may be surfing).
883 </para>
884
885
886 <!--   ~~~~~       New section      ~~~~~     -->
887
888 <sect2 id="conf-log-loc">
889 <title>Configuration and Log File Locations</title>
890
891 <para>
892  <application>Privoxy</application> can (and normally does) use a number of
893  other files for additional configuration, help and logging.
894  This section of the configuration file tells <application>Privoxy</application>
895  where to find those other files. 
896 </para>
897
898
899 <sect3 renderas="sect4" id="confdir"><title>confdir</title>
900
901 <variablelist>
902  <varlistentry>
903   <term>Specifies:</term>
904   <listitem>
905    <para>The directory where the other configuration files are located</para>
906   </listitem>
907  </varlistentry>
908  <varlistentry>
909   <term>Type of value:</term>
910   <listitem>
911    <para>Path name</para>
912   </listitem>
913  </varlistentry>
914  <varlistentry>
915   <term>Default value:</term>
916   <listitem>
917    <para>/etc/privoxy (Unix) <emphasis>or</emphasis> <application>Privoxy</application> installation dir (Windows) </para>
918   </listitem>
919  </varlistentry>
920  <varlistentry>
921   <term>Effect if unset:</term>
922   <listitem>
923    <para><emphasis>Mandatory</emphasis></para>
924   </listitem>
925  </varlistentry>
926  <varlistentry>
927   <term>Notes:</term>
928   <listitem>
929    <para>
930     No trailing <quote><literal>/</literal></quote>, please
931    </para>
932    <para>
933     When development goes modular and multi-user, the blocker, filter, and
934     per-user config will be stored in subdirectories of <quote>confdir</quote>.
935     For now, the configuration directory structure is flat, except for 
936     <filename>confdir/templates</filename>, where the HTML templates for CGI 
937     output reside (e.g. <application>Privoxy's</application> 404 error page). 
938    </para>
939   </listitem>
940  </varlistentry>
941 </variablelist>
942 </sect3>
943
944
945 <sect3 renderas="sect4" id="logdir"><title>logdir</title>
946
947 <variablelist>
948  <varlistentry>
949   <term>Specifies:</term>
950   <listitem>
951    <para>
952     The directory where all logging takes place (i.e. where <filename>logfile</filename> and 
953     <filename>jarfile</filename> are located) 
954    </para>
955   </listitem>
956  </varlistentry>
957  <varlistentry>
958   <term>Type of value:</term>
959   <listitem>
960    <para>Path name</para>
961   </listitem>
962  </varlistentry>
963  <varlistentry>
964   <term>Default value:</term>
965   <listitem>
966    <para>/var/log/privoxy (Unix) <emphasis>or</emphasis> <application>Privoxy</application> installation dir (Windows) </para>
967   </listitem>
968  </varlistentry>
969  <varlistentry>
970   <term>Effect if unset:</term>
971   <listitem>
972    <para><emphasis>Mandatory</emphasis></para>
973   </listitem>
974  </varlistentry>
975  <varlistentry>
976   <term>Notes:</term>
977   <listitem>
978    <para>
979     No trailing <quote><literal>/</literal></quote>, please
980    </para>
981   </listitem>
982  </varlistentry>
983 </variablelist>
984 </sect3>
985
986 <sect3 renderas="sect4" id="actionsfile"><title>
987 actionsfile
988 </title>
989 <anchor id="default.action">
990 <anchor id="standard.action">
991 <anchor id="user.action">
992 <!-- Note: slightly modified this section 04/28/02, hal. See NOTE. -->
993 <variablelist>
994  <varlistentry>
995   <term>Specifies:</term>
996   <listitem>
997    <para>
998     The <link linkend="actions">actions</link> file(s) to use
999    </para>
1000   </listitem>
1001  </varlistentry>
1002  <varlistentry>
1003   <term>Type of value:</term>
1004   <listitem>
1005    <para>File name, relative to <literal>confdir</literal></para>
1006   </listitem>
1007  </varlistentry>
1008  <varlistentry>
1009   <term>Default value:</term>
1010   <listitem>
1011    <simplelist>
1012     <member>
1013      <msgtext><literallayout>  standard     # Internal purposes, recommended not editing</literallayout></msgtext>
1014     </member>
1015     <member>
1016      <msgtext><literallayout>  default      # Main actions file</literallayout></msgtext>
1017     </member>
1018     <member>
1019      <msgtext><literallayout>  user         # User customizations</literallayout></msgtext>
1020     </member>
1021    </simplelist>
1022   </listitem>
1023  </varlistentry>
1024  <varlistentry>
1025   <term>Effect if unset:</term>
1026   <listitem>
1027    <para>
1028     No actions are taken at all. Simple neutral proxying. 
1029    </para>
1030   </listitem>
1031  </varlistentry>
1032  <varlistentry>
1033   <term>Notes:</term>
1034   <listitem>
1035    <para>
1036     Multiple <literal>actionsfile</literal> lines are permitted, and are in fact recommended!
1037    </para>
1038    <para> 
1039     The default values include standard.action, which is used for internal
1040     purposes and should be loaded, default.action, which is the
1041     <quote>main</quote> actions file maintained by the developers, and
1042     <filename>user.action</filename>, where you can make your personal additions.
1043    </para>
1044    <para> 
1045     Actions files are where all the per site and per URL configuration is done for 
1046     ad blocking, cookie management, privacy considerations, etc.
1047     There is no point in using <application>Privoxy</application> without at 
1048     least one actions file.
1049    </para>
1050   </listitem>
1051  </varlistentry>
1052 </variablelist>
1053 </sect3>
1054
1055 <sect3 renderas="sect4" id="filterfile"><title>filterfile</title>
1056 <anchor id="default.filter">
1057 <variablelist>
1058  <varlistentry>
1059   <term>Specifies:</term>
1060   <listitem>
1061    <para>
1062     The <link linkend="filter">filter</link> file to use
1063    </para>
1064   </listitem>
1065  </varlistentry>
1066  <varlistentry>
1067   <term>Type of value:</term>
1068   <listitem>
1069    <para>File name, relative to <literal>confdir</literal></para>
1070   </listitem>
1071  </varlistentry>
1072  <varlistentry>
1073   <term>Default value:</term>
1074   <listitem>
1075    <para>default.filter (Unix) <emphasis>or</emphasis> default.filter.txt (Windows)</para>
1076   </listitem>
1077  </varlistentry>
1078  <varlistentry>
1079   <term>Effect if unset:</term>
1080   <listitem>
1081    <para>
1082     No textual content filtering takes place, i.e. all
1083     <literal>+filter{<replaceable class="parameter">name</replaceable>}</literal>
1084     actions in the actions files are turned off
1085    </para>
1086   </listitem>
1087  </varlistentry>
1088  <varlistentry>
1089   <term>Notes:</term>
1090   <listitem>
1091    <para>
1092     The <quote>default.filter</quote> file contains content modification rules 
1093     that use <quote>regular expressions</quote>. These rules permit powerful
1094     changes on the content of Web pages, e.g., you could disable your favorite
1095     JavaScript annoyances, re-write the actual displayed text, or just have some
1096     fun replacing <quote>Microsoft</quote> with <quote>MicroSuck</quote> wherever
1097     it appears on a Web page.
1098    </para>
1099   </listitem>
1100  </varlistentry>
1101 </variablelist>
1102 </sect3>
1103
1104 <sect3 renderas="sect4" id="logfile"><title>logfile</title>
1105
1106 <variablelist>
1107  <varlistentry>
1108   <term>Specifies:</term>
1109   <listitem>
1110    <para>
1111     The log file to use
1112    </para>
1113   </listitem>
1114  </varlistentry>
1115  <varlistentry>
1116   <term>Type of value:</term>
1117   <listitem>
1118    <para>File name, relative to <literal>logdir</literal></para>
1119   </listitem>
1120  </varlistentry>
1121  <varlistentry>
1122   <term>Default value:</term>
1123   <listitem>
1124    <para>logfile (Unix) <emphasis>or</emphasis> privoxy.log (Windows)</para>
1125   </listitem>
1126  </varlistentry>
1127  <varlistentry>
1128   <term>Effect if unset:</term>
1129   <listitem>
1130    <para>
1131     No log file is used, all log messages go to the console (<literal>stderr</literal>).
1132    </para>
1133   </listitem>
1134  </varlistentry>
1135  <varlistentry>
1136   <term>Notes:</term>
1137   <listitem>
1138    <para>
1139     The windows version will additionally log to the console.
1140    </para>
1141    <para>
1142     The logfile is where all logging and error messages are written. The level
1143     of detail and number of messages are set with the <literal>debug</literal>
1144     option (see below). The logfile can be useful for tracking down a problem with
1145     <application>Privoxy</application> (e.g., it's not blocking an ad you
1146     think it should block) but in most cases you probably will never look at it.
1147    </para>
1148    <para>
1149     Your logfile will grow indefinitely, and you will probably want to
1150     periodically remove it.  On Unix systems, you can do this with a cron job
1151     (see <quote>man cron</quote>). For Red Hat, a <command>logrotate</command> 
1152     script has been included.
1153    </para> 
1154    <para>
1155     On SuSE Linux systems, you can place a line like <quote>/var/log/privoxy.*
1156     +1024k 644 nobody.nogroup</quote> in <filename>/etc/logfiles</filename>, with
1157     the effect that cron.daily will automatically archive, gzip, and empty the
1158     log, when it exceeds 1M size.
1159    </para>
1160   </listitem>
1161  </varlistentry>
1162 </variablelist>
1163 </sect3>
1164
1165 <sect3 renderas="sect4" id="jarfile"><title>jarfile</title>
1166
1167 <variablelist>
1168  <varlistentry>
1169   <term>Specifies:</term>
1170   <listitem>
1171    <para>
1172     The file to store intercepted cookies in
1173    </para>
1174   </listitem>
1175  </varlistentry>
1176  <varlistentry>
1177   <term>Type of value:</term>
1178   <listitem>
1179    <para>File name, relative to <literal>logdir</literal></para>
1180   </listitem>
1181  </varlistentry>
1182  <varlistentry>
1183   <term>Default value:</term>
1184   <listitem>
1185    <para>jarfile (Unix) <emphasis>or</emphasis> privoxy.jar (Windows)</para>
1186   </listitem>
1187  </varlistentry>
1188  <varlistentry>
1189   <term>Effect if unset:</term>
1190   <listitem>
1191    <para>
1192     Intercepted cookies are not stored at all.
1193    </para>
1194   </listitem>
1195  </varlistentry>
1196  <varlistentry>
1197   <term>Notes:</term>
1198   <listitem>
1199    <para>
1200     The jarfile may grow to ridiculous sizes over time.
1201    </para>
1202   </listitem>
1203  </varlistentry>
1204 </variablelist>
1205 </sect3>
1206
1207 <sect3 renderas="sect4" id="trustfile"><title>trustfile</title>
1208 <variablelist>
1209  <varlistentry>
1210   <term>Specifies:</term>
1211   <listitem>
1212    <para>
1213     The trust file to use
1214    </para>
1215   </listitem>
1216  </varlistentry>
1217  <varlistentry>
1218   <term>Type of value:</term>
1219   <listitem>
1220    <para>File name, relative to <literal>confdir</literal></para>
1221   </listitem>
1222  </varlistentry>
1223  <varlistentry>
1224   <term>Default value:</term>
1225   <listitem>
1226    <para><emphasis>Unset (commented out)</emphasis>. When activated: trust (Unix) <emphasis>or</emphasis> trust.txt (Windows)</para>
1227   </listitem>
1228  </varlistentry>
1229  <varlistentry>
1230   <term>Effect if unset:</term>
1231   <listitem>
1232    <para>
1233     The whole trust mechanism is turned off.
1234    </para>
1235   </listitem>
1236  </varlistentry>
1237  <varlistentry>
1238   <term>Notes:</term>
1239   <listitem>
1240    <para>
1241     The trust mechanism is an experimental feature for building white-lists and should
1242     be used with care. It is <emphasis>NOT</emphasis> recommended for the casual user.
1243    </para>
1244    <para>
1245     If you specify a trust file, <application>Privoxy</application> will only allow
1246     access to sites that are named in the trustfile. 
1247     You can also mark sites as trusted referrers (with <literal>+</literal>), with
1248     the effect that access to untrusted sites will be granted, if a link from a
1249     trusted referrer was used.
1250     The link target will then be added to the <quote>trustfile</quote>.
1251     Possible applications include limiting Internet access for children.
1252    </para>
1253    <para>
1254     If you use <literal>+</literal> operator in the trust file, it may grow considerably over time.
1255    </para>
1256   </listitem>
1257  </varlistentry>
1258 </variablelist>
1259 </sect3>
1260
1261 <sect3 renderas="sect4" id="user-manual"><title>user-manual</title>
1262 <variablelist>
1263  <varlistentry>
1264   <term>Specifies:</term>
1265   <listitem>
1266    <para>
1267     Location of the <application>Privoxy</application> User Manual.
1268    </para>
1269   </listitem>
1270  </varlistentry>
1271  <varlistentry>
1272   <term>Type of value:</term>
1273   <listitem>
1274    <para>A fully qualified URI</para>
1275   </listitem>
1276  </varlistentry>
1277  <varlistentry>
1278   <term>Default value:</term>
1279   <listitem>
1280    <para><ulink url="http://www.privoxy.org/user-manual/">http://www.privoxy.org/user-manual/</ulink></para>
1281   </listitem>
1282  </varlistentry>
1283  <varlistentry>
1284   <term>Effect if unset:</term>
1285   <listitem>
1286    <para>
1287     The default will be used.
1288    </para>
1289   </listitem>
1290  </varlistentry>
1291  <varlistentry>
1292   <term>Notes:</term>
1293   <listitem>
1294    <para>
1295     The User Manual is used for help hints from some of the internal CGI pages. 
1296     It is normally packaged with the binary distributions, and would make more 
1297     sense to have this pointed at a locally installed copy.
1298    </para>
1299    <para>
1300     A more useful example (Unix):
1301    </para>
1302   <para> 
1303    &nbsp;&nbsp;<emphasis>user-manual&nbsp;&nbsp;file:///usr/share/doc/privoxy-&p-version;/user-manual/</emphasis>
1304   </para>
1305   </listitem>
1306  </varlistentry>
1307 </variablelist>
1308 </sect3>
1309
1310 </sect2>
1311
1312 <!--  ~  End section  ~  -->
1313
1314
1315
1316 <!--   ~~~~~       New section      ~~~~~     -->
1317
1318 <sect2 id="local-set-up">
1319 <title>Local Set-up Documentation</title>
1320
1321   <para>
1322     If you intend to operate <application>Privoxy</application> for more users
1323     that just yourself, it might be a good idea to let them know how to reach
1324     you, what you block and why you do that, your policies etc.
1325    </para>
1326
1327 <sect3 renderas="sect4" id="trust-info-url"><title>trust-info-url</title>
1328
1329 <variablelist>
1330  <varlistentry>
1331   <term>Specifies:</term>
1332   <listitem>
1333    <para>
1334     A URL to be displayed in the error page that users will see if access to an untrusted page is denied.    
1335    </para>
1336   </listitem>
1337  </varlistentry>
1338  <varlistentry>
1339   <term>Type of value:</term>
1340   <listitem>
1341    <para>URL</para>
1342   </listitem>
1343  </varlistentry>
1344  <varlistentry>
1345   <term>Default value:</term>
1346   <listitem>
1347    <para>Two example URL are provided</para>
1348   </listitem>
1349  </varlistentry>
1350  <varlistentry>
1351   <term>Effect if unset:</term>
1352   <listitem>
1353    <para>
1354     No links are displayed on the "untrusted" error page.
1355    </para>
1356   </listitem>
1357  </varlistentry>
1358  <varlistentry>
1359   <term>Notes:</term>
1360   <listitem>
1361    <para>
1362     The value of this option only matters if the experimental trust mechanism has been
1363     activated. (See <literal>trustfile</literal> above.)
1364    </para>
1365    <para>
1366     If you use the trust mechanism, it is a good idea to write up some on-line
1367     documentation about your trust policy and to specify the URL(s) here.
1368     Use multiple times for multiple URLs.
1369    </para>
1370    <para>
1371     The URL(s) should be added to the trustfile as well, so users don't end up
1372     locked out from the information on why they were locked out in the first place!
1373    </para>
1374   </listitem>
1375  </varlistentry>
1376 </variablelist>
1377 </sect3>
1378
1379 <sect3 renderas="sect4" id="admin-address"><title>admin-address</title>
1380
1381 <variablelist>
1382  <varlistentry>
1383   <term>Specifies:</term>
1384   <listitem>
1385    <para>
1386     An email address to reach the proxy administrator.
1387    </para>
1388   </listitem>
1389  </varlistentry>
1390  <varlistentry>
1391   <term>Type of value:</term>
1392   <listitem>
1393    <para>Email address</para>
1394   </listitem>
1395  </varlistentry>
1396  <varlistentry>
1397   <term>Default value:</term>
1398   <listitem>
1399    <para><emphasis>Unset</emphasis></para>
1400   </listitem>
1401  </varlistentry>
1402  <varlistentry>
1403   <term>Effect if unset:</term>
1404   <listitem>
1405    <para>
1406     No email address is displayed on error pages and the CGI user interface.
1407    </para>
1408   </listitem>
1409  </varlistentry>
1410  <varlistentry>
1411   <term>Notes:</term>
1412   <listitem>
1413     <para>
1414     If both <literal>admin-address</literal> and <literal>proxy-info-url</literal>
1415     are unset, the whole "Local Privoxy Support" box on all generated pages will
1416     not be shown.
1417    </para>  
1418   </listitem>
1419  </varlistentry>
1420 </variablelist>
1421 </sect3>
1422
1423 <sect3 renderas="sect4" id="proxy-info-url"><title>proxy-info-url</title>
1424
1425 <variablelist>
1426  <varlistentry>
1427   <term>Specifies:</term>
1428   <listitem>
1429    <para>
1430     A URL to documentation about the local <application>Privoxy</application> setup,
1431     configuration or policies.
1432    </para>
1433   </listitem>
1434  </varlistentry>
1435  <varlistentry>
1436   <term>Type of value:</term>
1437   <listitem>
1438    <para>URL</para>
1439   </listitem>
1440  </varlistentry>
1441  <varlistentry>
1442   <term>Default value:</term>
1443   <listitem>
1444    <para><emphasis>Unset</emphasis></para>
1445   </listitem>
1446  </varlistentry>
1447  <varlistentry>
1448   <term>Effect if unset:</term>
1449   <listitem>
1450    <para>
1451     No link to local documentation is displayed on error pages and the CGI user interface.
1452    </para>
1453   </listitem>
1454  </varlistentry>
1455  <varlistentry>
1456   <term>Notes:</term>
1457   <listitem>
1458    <para>
1459     If both <literal>admin-address</literal> and <literal>proxy-info-url</literal>
1460     are unset, the whole "Local Privoxy Support" box on all generated pages will
1461     not be shown.
1462    </para>  
1463    <para>
1464     This URL shouldn't be blocked ;-)
1465    </para> 
1466   </listitem>
1467  </varlistentry>
1468 </variablelist>
1469 </sect3>
1470
1471 </sect2>
1472 <!--  ~  End section  ~  -->
1473
1474 <!--   ~~~~~       New section      ~~~~~     -->
1475
1476 <sect2 id="debugging">
1477 <title>Debugging</title>
1478
1479  <para>
1480   These options are mainly useful when tracing a problem.
1481   Note that you might also want to invoke
1482   <application>Privoxy</application> with the <literal>--no-daemon</literal>
1483   command line option when debugging.
1484  </para>
1485
1486 <sect3 renderas="sect4" id="debug"><title>debug</title>
1487
1488 <variablelist>
1489  <varlistentry>
1490   <term>Specifies:</term>
1491   <listitem>
1492    <para>
1493     Key values that determine what information gets logged.
1494    </para>
1495   </listitem>
1496  </varlistentry>
1497  <varlistentry>
1498   <term>Type of value:</term>
1499   <listitem>
1500    <para>Integer values</para>
1501   </listitem>
1502  </varlistentry>
1503  <varlistentry>
1504   <term>Default value:</term>
1505   <listitem>
1506    <para>12289 (i.e.: URLs plus informational and warning messages)</para>
1507   </listitem>
1508  </varlistentry>
1509  <varlistentry>
1510   <term>Effect if unset:</term>
1511   <listitem>
1512    <para>
1513     Nothing gets logged.
1514    </para>
1515   </listitem>
1516  </varlistentry>
1517  <varlistentry>
1518   <term>Notes:</term>
1519   <listitem>
1520    <para>
1521     The available debug levels are:
1522    </para>
1523    <para>
1524     <programlisting>
1525   debug         1 # show each GET/POST/CONNECT request
1526   debug         2 # show each connection status
1527   debug         4 # show I/O status
1528   debug         8 # show header parsing
1529   debug        16 # log all data into the logfile
1530   debug        32 # debug force feature
1531   debug        64 # debug regular expression filter 
1532   debug       128 # debug fast redirects
1533   debug       256 # debug GIF de-animation
1534   debug       512 # Common Log Format
1535   debug      1024 # debug kill pop-ups
1536   debug      4096 # Startup banner and warnings.
1537   debug      8192 # Non-fatal errors
1538 </programlisting>
1539    </para>
1540    <para>
1541     To select multiple debug levels, you can either add them or use
1542     multiple <literal>debug</literal> lines.
1543    </para>
1544    <para>
1545     A debug level of 1 is informative because it will show you each request
1546     as it happens. <emphasis>1, 4096 and 8192 are highly recommended</emphasis>
1547     so that you will notice when things go wrong. The other levels are probably
1548     only of interest if you are hunting down a specific problem. They can produce
1549     a hell of an output (especially 16).
1550     <!-- LOL -->
1551    </para>
1552    <para>
1553     The reporting of <emphasis>fatal</emphasis> errors (i.e. ones which crash 
1554     <application>Privoxy</application>) is always on and cannot be disabled.
1555    </para>
1556    <para>
1557     If you want to use CLF (Common Log Format), you should set <quote>debug
1558     512</quote> <emphasis>ONLY</emphasis> and not enable anything else.
1559    </para>
1560   </listitem>
1561  </varlistentry>
1562 </variablelist>
1563 </sect3>
1564
1565 <sect3 renderas="sect4" id="single-threaded"><title>single-threaded</title>
1566
1567 <variablelist>
1568  <varlistentry>
1569   <term>Specifies:</term>
1570   <listitem>
1571    <para>
1572     Whether to run only one server thread
1573    </para>
1574   </listitem>
1575  </varlistentry>
1576  <varlistentry>
1577   <term>Type of value:</term>
1578   <listitem>
1579    <para><emphasis>None</emphasis></para>
1580   </listitem>
1581  </varlistentry>
1582  <varlistentry>
1583   <term>Default value:</term>
1584   <listitem>
1585    <para><emphasis>Unset</emphasis></para>
1586   </listitem>
1587  </varlistentry>
1588  <varlistentry>
1589   <term>Effect if unset:</term>
1590   <listitem>
1591    <para>
1592     Multi-threaded (or, where unavailable: forked) operation, i.e. the ability to
1593     serve multiple requests simultaneously.
1594    </para>
1595   </listitem>
1596  </varlistentry>
1597  <varlistentry>
1598   <term>Notes:</term>
1599   <listitem>
1600    <para>
1601     This option is only there for debug purposes and you should never
1602     need to use it. <emphasis>It will drastically reduce performance.</emphasis>
1603    </para>
1604   </listitem>
1605  </varlistentry>
1606 </variablelist>
1607 </sect3>
1608
1609 </sect2>
1610
1611 <!--   ~~~~~       New section      ~~~~~     -->
1612
1613 <sect2 id="access-control">
1614 <title>Access Control and Security</title>
1615
1616  <para>
1617   This section of the config file controls the security-relevant aspects
1618   of <application>Privoxy</application>'s configuration.
1619  </para>
1620
1621 <sect3 renderas="sect4" id="listen-address"><title>listen-address</title>
1622
1623 <variablelist>
1624  <varlistentry>
1625   <term>Specifies:</term>
1626   <listitem>
1627    <para>
1628     The IP address and TCP port on which <application>Privoxy</application> will
1629     listen for client requests.
1630    </para>
1631   </listitem>
1632  </varlistentry>
1633  <varlistentry>
1634   <term>Type of value:</term>
1635   <listitem>
1636    <para>[<replaceable class="parameter">IP-Address</replaceable>]:<replaceable class="parameter">Port</replaceable></para>
1637   </listitem>
1638  </varlistentry>
1639
1640  <varlistentry>
1641   <term>Default value:</term>
1642   <listitem>
1643    <para>localhost:8118</para>
1644   </listitem>
1645  </varlistentry>
1646  <varlistentry>
1647   <term>Effect if unset:</term>
1648   <listitem>
1649    <para>
1650     Bind to localhost (127.0.0.1), port 8118. This is suitable and recommended for
1651     home users who run <application>Privoxy</application> on the same machine as
1652     their browser.
1653    </para>
1654   </listitem>
1655  </varlistentry>
1656  <varlistentry>
1657   <term>Notes:</term>
1658   <listitem>
1659    <para>
1660     You will need to configure your browser(s) to this proxy address and port.
1661    </para>
1662    <para>
1663     If you already have another service running on port 8118, or if you want to
1664     serve requests from other machines (e.g. on your local network) as well, you
1665     will need to override the default.
1666    </para>
1667    <para>
1668     If you leave out the IP address, <application>Privoxy</application> will
1669     bind to all interfaces (addresses) on your machine and may become reachable
1670     from the Internet. In that case, consider using access control lists (ACL's)
1671     (see <quote>ACLs</quote> below), or a firewall.
1672    </para>
1673   </listitem>
1674  </varlistentry>
1675  <varlistentry>
1676   <term>Example:</term>
1677   <listitem>
1678    <para>
1679      Suppose you are running <application>Privoxy</application> on
1680      a machine which has the address 192.168.0.1 on your local private network
1681      (192.168.0.0) and has another outside connection with a different address.
1682      You want it to serve requests from inside only:
1683    </para>
1684    <para>
1685     <programlisting>
1686   listen-address  192.168.0.1:8118
1687 </programlisting>
1688    </para>
1689   </listitem>
1690  </varlistentry>
1691 </variablelist>
1692 </sect3>
1693
1694 <sect3 renderas="sect4" id="toggle"><title>toggle</title>
1695
1696 <variablelist>
1697  <varlistentry>
1698   <term>Specifies:</term>
1699   <listitem>
1700    <para>
1701     Initial state of "toggle" status
1702    </para>
1703   </listitem>
1704  </varlistentry>
1705  <varlistentry>
1706   <term>Type of value:</term>
1707   <listitem>
1708    <para>1 or 0</para>
1709   </listitem>
1710  </varlistentry>
1711  <varlistentry>
1712   <term>Default value:</term>
1713   <listitem>
1714    <para>1</para>
1715   </listitem>
1716  </varlistentry>
1717  <varlistentry>
1718   <term>Effect if unset:</term>
1719   <listitem>
1720    <para>
1721     Act as if toggled on
1722    </para>
1723   </listitem>
1724  </varlistentry>
1725  <varlistentry>
1726   <term>Notes:</term>
1727   <listitem>
1728    <para>
1729     If set to 0, <application>Privoxy</application> will start in
1730     <quote>toggled off</quote> mode, i.e. behave like a normal, content-neutral
1731     proxy. See <literal>enable-remote-toggle</literal>
1732     below. This is not really useful anymore, since toggling is much easier
1733     via <ulink url="http://config.privoxy.org/toggle">the web
1734     interface</ulink> than via editing the <filename>conf</filename> file.
1735    </para>
1736    <para>
1737     The windows version will only display the toggle icon in the system tray
1738     if this option is present.
1739    </para>
1740   </listitem>
1741  </varlistentry>
1742 </variablelist>
1743 </sect3>
1744
1745
1746 <sect3 renderas="sect4" id="enable-remote-toggle"><title>enable-remote-toggle</title>
1747 <variablelist>
1748  <varlistentry>
1749   <term>Specifies:</term>
1750   <listitem>
1751    <para>
1752     Whether or not the <ulink url="http://config.privoxy.org/toggle">web-based toggle
1753     feature</ulink> may be used
1754    </para>
1755   </listitem>
1756  </varlistentry>
1757  <varlistentry>
1758   <term>Type of value:</term>
1759   <listitem>
1760    <para>0 or 1</para>
1761   </listitem>
1762  </varlistentry>
1763  <varlistentry>
1764   <term>Default value:</term>
1765   <listitem>
1766    <para>1</para>
1767   </listitem>
1768  </varlistentry>
1769  <varlistentry>
1770   <term>Effect if unset:</term>
1771   <listitem>
1772    <para>
1773     The web-based toggle feature is disabled.
1774    </para>
1775   </listitem>
1776  </varlistentry>
1777  <varlistentry>
1778   <term>Notes:</term>
1779   <listitem>
1780    <para>
1781     When toggled off, <application>Privoxy</application> acts like a normal,
1782     content-neutral proxy, i.e. it acts as if none of the actions applied to
1783     any URL.
1784    </para>
1785    <para>
1786     For the time being, access to the toggle feature can <emphasis>not</emphasis> be
1787     controlled separately by <quote>ACLs</quote> or HTTP authentication,
1788     so that everybody who can access <application>Privoxy</application> (see
1789     <quote>ACLs</quote> and <literal>listen-address</literal> above) can
1790     toggle it for all users. So this option is <emphasis>not recommended</emphasis>
1791     for multi-user environments with untrusted users.
1792    </para>
1793    <para>
1794     Note that you must have compiled <application>Privoxy</application> with
1795     support for this feature, otherwise this option has no effect. 
1796    </para>
1797   </listitem>
1798  </varlistentry>
1799 </variablelist>
1800 </sect3>
1801
1802
1803 <sect3 renderas="sect4" id="enable-edit-actions"><title>enable-edit-actions</title>
1804 <variablelist>
1805  <varlistentry>
1806   <term>Specifies:</term>
1807   <listitem>
1808    <para>
1809     Whether or not the <ulink url="http://config.privoxy.org/show-status">web-based actions
1810     file editor</ulink> may be used
1811    </para>
1812   </listitem>
1813  </varlistentry>
1814  <varlistentry>
1815   <term>Type of value:</term>
1816   <listitem>
1817    <para>0 or 1</para>
1818   </listitem>
1819  </varlistentry>
1820  <varlistentry>
1821   <term>Default value:</term>
1822   <listitem>
1823    <para>1</para>
1824   </listitem>
1825  </varlistentry>
1826  <varlistentry>
1827   <term>Effect if unset:</term>
1828   <listitem>
1829    <para>
1830     The web-based actions file editor is disabled.
1831    </para>
1832   </listitem>
1833  </varlistentry>
1834  <varlistentry>
1835   <term>Notes:</term>
1836   <listitem>
1837    <para>
1838     For the time being, access to the editor can <emphasis>not</emphasis> be
1839     controlled separately by <quote>ACLs</quote> or HTTP authentication,
1840     so that everybody who can access <application>Privoxy</application> (see
1841     <quote>ACLs</quote> and <literal>listen-address</literal> above) can
1842     modify its configuration for all users. So this option is <emphasis>not
1843     recommended</emphasis> for multi-user environments with untrusted users.
1844    </para>
1845    <para>
1846     Note that you must have compiled <application>Privoxy</application> with
1847     support for this feature, otherwise this option has no effect. 
1848    </para>
1849   </listitem>
1850  </varlistentry>
1851 </variablelist>
1852 </sect3>
1853
1854 <sect3 renderas="sect4" id="acls"><title>
1855 ACLs: permit-access and deny-access</title>
1856 <anchor id="permit-acces">
1857 <anchor id="deny-acces">
1858
1859 <variablelist>
1860  <varlistentry>
1861   <term>Specifies:</term>
1862   <listitem>
1863    <para>
1864     Who can access what.
1865    </para>
1866   </listitem>
1867  </varlistentry>
1868  <varlistentry>
1869   <term>Type of value:</term>
1870   <listitem>
1871    <para>
1872     <replaceable class="parameter">src_addr</replaceable>[/<replaceable class="parameter">src_masklen</replaceable>]
1873     [<replaceable class="parameter">dst_addr</replaceable>[/<replaceable class="parameter">dst_masklen</replaceable>]]
1874    </para>
1875    <para>
1876     Where <replaceable class="parameter">src_addr</replaceable> and 
1877    <replaceable class="parameter">dst_addr</replaceable> are IP addresses in dotted decimal notation or valid
1878     DNS names, and <replaceable class="parameter">src_masklen</replaceable> and
1879     <replaceable class="parameter">dst_masklen</replaceable> are subnet masks in CIDR notation, i.e. integer
1880     values from 2 to 30 representing the length (in bits) of the network address. The masks and the whole
1881     destination part are optional.
1882    </para>
1883   </listitem>
1884  </varlistentry>
1885  <varlistentry>
1886   <term>Default value:</term>
1887   <listitem>
1888    <para><emphasis>Unset</emphasis></para>
1889   </listitem>
1890  </varlistentry>
1891  <varlistentry>
1892   <term>Effect if unset:</term>
1893   <listitem>
1894    <para>
1895     Don't restrict access further than implied by <literal>listen-address</literal>
1896    </para>
1897   </listitem>
1898  </varlistentry>
1899  <varlistentry>
1900   <term>Notes:</term>
1901   <listitem>
1902    <para>
1903     Access controls are included at the request of ISPs and systems
1904     administrators, and <emphasis>are not usually needed by individual users</emphasis>.
1905     For a typical home user, it will normally suffice to ensure that 
1906     <application>Privoxy</application> only listens on the localhost or internal (home)
1907     network address by means of the <literal>listen-address</literal> option.
1908    </para>
1909    <para>
1910     Please see the warnings in the FAQ that this proxy is not intended to be a substitute
1911     for a firewall or to encourage anyone to defer addressing basic security
1912     weaknesses.
1913    </para>
1914    <para>
1915     Multiple ACL lines are OK.
1916     If any ACLs are specified, then the <application>Privoxy</application>
1917     talks only to IP addresses that match at least one <literal>permit-access</literal> line
1918     and don't match any subsequent <literal>deny-access</literal> line. In other words, the
1919     last match wins, with the default being <literal>deny-access</literal>.
1920    </para>
1921    <para>
1922     If <application>Privoxy</application> is using a forwarder (see <literal>forward</literal> below)
1923     for a particular destination URL, the <replaceable class="parameter">dst_addr</replaceable>
1924     that is examined is the address of the forwarder and <emphasis>NOT</emphasis> the address
1925     of the ultimate target. This is necessary because it may be impossible for the local
1926     <application>Privoxy</application> to determine the IP address of the
1927     ultimate target (that's often what gateways are used for).
1928    </para>
1929    <para>
1930     You should prefer using IP addresses over DNS names, because the address lookups take
1931     time. All DNS names must resolve! You can <emphasis>not</emphasis> use domain patterns
1932     like <quote>*.org</quote> or partial domain names. If a DNS name resolves to multiple
1933     IP addresses, only the first one is used.
1934    </para>
1935    <para>
1936     Denying access to particular sites by ACL may have undesired side effects
1937     if the site in question is hosted on a machine which also hosts other sites.
1938    </para>
1939   </listitem>
1940  </varlistentry>
1941  <varlistentry>
1942   <term>Examples:</term>
1943   <listitem>
1944    <para>
1945     Explicitly define the default behavior if no ACL and
1946     <literal>listen-address</literal> are set: <quote>localhost</quote>
1947     is OK. The absence of a <replaceable class="parameter">dst_addr</replaceable> implies that
1948     <emphasis>all</emphasis> destination addresses are OK:
1949    </para>
1950    <para>
1951     <screen>
1952   permit-access  localhost
1953 </screen>
1954    </para>
1955    <para>
1956     Allow any host on the same class C subnet as www.privoxy.org access to
1957     nothing but www.example.com:
1958    </para>
1959    <para>
1960     <screen>
1961   permit-access  www.privoxy.org/24 www.example.com/32
1962 </screen>
1963    </para>
1964    <para>
1965     Allow access from any host on the 26-bit subnet 192.168.45.64 to anywhere,
1966     with the exception that 192.168.45.73 may not access www.dirty-stuff.example.com:
1967    </para>
1968    <para>
1969     <screen>
1970   permit-access  192.168.45.64/26
1971   deny-access    192.168.45.73    www.dirty-stuff.example.com
1972 </screen>
1973    </para>
1974   </listitem>
1975  </varlistentry>
1976 </variablelist>
1977 </sect3>
1978
1979 <sect3 renderas="sect4" id="buffer-limit"><title>buffer-limit</title>
1980
1981 <variablelist>
1982  <varlistentry>
1983   <term>Specifies:</term>
1984   <listitem>
1985    <para>
1986     Maximum size of the buffer for content filtering.
1987    </para>
1988   </listitem>
1989  </varlistentry>
1990  <varlistentry>
1991   <term>Type of value:</term>
1992   <listitem>
1993    <para>Size in Kbytes</para>
1994   </listitem>
1995  </varlistentry>
1996  <varlistentry>
1997   <term>Default value:</term>
1998   <listitem>
1999    <para>4096</para>
2000   </listitem>
2001  </varlistentry>
2002  <varlistentry>
2003   <term>Effect if unset:</term>
2004   <listitem>
2005    <para>
2006     Use a 4MB (4096 KB) limit.
2007    </para>
2008   </listitem>
2009  </varlistentry>
2010  <varlistentry>
2011   <term>Notes:</term>
2012   <listitem>
2013    <para>
2014     For content filtering, i.e. the <literal>+filter</literal> and
2015     <literal>+deanimate-gif</literal> actions, it is necessary that 
2016     <application>Privoxy</application> buffers the entire document body.
2017     This can be potentially dangerous, since a server could just keep sending
2018     data indefinitely and wait for your RAM to exhaust -- with nasty consequences.
2019     Hence this option.
2020    </para>
2021    <para>
2022     When a document buffer size reaches the <literal>buffer-limit</literal>, it is
2023     flushed to the client unfiltered and no further attempt to
2024     filter the rest of the document is made. Remember that there may be multiple threads
2025     running, which might require up to <literal>buffer-limit</literal> Kbytes
2026     <emphasis>each</emphasis>, unless you have enabled <quote>single-threaded</quote>
2027     above.
2028    </para>
2029   </listitem>
2030  </varlistentry>
2031 </variablelist>
2032 </sect3>
2033
2034 </sect2>
2035
2036 <!--  ~  End section  ~  -->
2037
2038
2039 <!--   ~~~~~       New section      ~~~~~     -->
2040
2041 <sect2 id="forwarding">
2042 <title>Forwarding</title>
2043
2044 <para>
2045  This feature allows routing of HTTP requests through a chain of
2046  multiple proxies.
2047  It can be used to better protect privacy and confidentiality when
2048  accessing specific domains by routing requests to those domains
2049  through an anonymous public proxy (see e.g. <ulink
2050  url="http://www.multiproxy.org/anon_list.htm">http://www.multiproxy.org/anon_list.htm</ulink>)
2051  Or to use a caching proxy to speed up browsing. Or chaining to a parent
2052  proxy may be necessary because the machine that <application>Privoxy</application>
2053  runs on has no direct Internet access.
2054 </para>
2055
2056 <para>
2057  Also specified here are SOCKS proxies. <application>Privoxy</application>
2058  supports the SOCKS 4 and SOCKS 4A protocols.
2059 </para>
2060
2061 <sect3 renderas="sect4" id="forward"><title>forward</title>
2062 <variablelist>
2063  <varlistentry>
2064   <term>Specifies:</term>
2065   <listitem>
2066    <para>
2067     To which parent HTTP proxy specific requests should be routed.
2068    </para>
2069   </listitem>
2070  </varlistentry>
2071  <varlistentry>
2072   <term>Type of value:</term>
2073   <listitem>
2074    <para>
2075     <replaceable class="parameter">target_domain</replaceable>[:<replaceable class="parameter">port</replaceable>]
2076     <replaceable class="parameter">http_parent</replaceable>[/<replaceable class="parameter">port</replaceable>]
2077    </para>
2078    <para>
2079     Where <replaceable class="parameter">target_domain</replaceable> is a domain name pattern (see the
2080     chapter on domain matching in the <filename>default.action</filename> file),
2081     <replaceable class="parameter">http_parent</replaceable> is the address of the parent HTTP proxy
2082     as an IP addresses in dotted decimal notation or as a valid DNS name (or <quote>.</quote> to denote
2083     <quote>no forwarding</quote>, and the optional 
2084     <replaceable class="parameter">port</replaceable> parameters are TCP ports, i.e. integer
2085     values from 1 to 64535
2086    </para>
2087   </listitem>
2088  </varlistentry>
2089  <varlistentry>
2090   <term>Default value:</term>
2091   <listitem>
2092    <para><emphasis>Unset</emphasis></para>
2093   </listitem>
2094  </varlistentry>
2095  <varlistentry>
2096   <term>Effect if unset:</term>
2097   <listitem>
2098    <para>
2099     Don't use parent HTTP proxies.
2100    </para>
2101   </listitem>
2102  </varlistentry>
2103  <varlistentry>
2104   <term>Notes:</term>
2105   <listitem>
2106    <para>
2107     If <replaceable class="parameter">http_parent</replaceable> is <quote>.</quote>, then requests are not
2108     forwarded to another HTTP proxy but are made directly to the web servers.
2109    </para>
2110    <para>
2111     Multiple lines are OK, they are checked in sequence, and the last match wins.
2112    </para>
2113   </listitem>
2114  </varlistentry>
2115  <varlistentry>
2116   <term>Examples:</term>
2117   <listitem>
2118    <para>
2119     Everything goes to an example anonymizing proxy, except SSL on port 443 (which it doesn't handle):
2120    </para>
2121    <para>
2122     <screen>
2123   forward   .*     anon-proxy.example.org:8080
2124   forward   :443   .
2125 </screen>
2126    </para>
2127    <para>
2128     Everything goes to our example ISP's caching proxy, except for requests
2129     to that ISP's sites:
2130    </para>
2131    <para>
2132     <screen>
2133   forward   .*.                caching-proxy.example-isp.net:8000
2134   forward   .example-isp.net   .
2135 </screen>
2136    </para>
2137   </listitem>
2138  </varlistentry>
2139 </variablelist>
2140 </sect3>
2141
2142 <sect3 renderas="sect4" id="socks"><title>
2143 forward-socks4 and forward-socks4a</title>
2144 <anchor id="forward-socks4">
2145 <anchor id="forward-socks4a">
2146
2147 <variablelist>
2148  <varlistentry>
2149   <term>Specifies:</term>
2150   <listitem>
2151    <para>
2152     Through which SOCKS proxy (and to which parent HTTP proxy) specific requests should be routed.
2153    </para>
2154   </listitem>
2155  </varlistentry>
2156  <varlistentry>
2157   <term>Type of value:</term>
2158   <listitem>
2159    <para>
2160     <replaceable class="parameter">target_domain</replaceable>[:<replaceable class="parameter">port</replaceable>]
2161     <replaceable class="parameter">socks_proxy</replaceable>[/<replaceable class="parameter">port</replaceable>]
2162     <replaceable class="parameter">http_parent</replaceable>[/<replaceable class="parameter">port</replaceable>]
2163    </para>
2164    <para>
2165     Where <replaceable class="parameter">target_domain</replaceable> is a domain name pattern (see the
2166     chapter on domain matching in the <filename>default.action</filename> file),
2167     <replaceable class="parameter">http_parent</replaceable> and <replaceable class="parameter">socks_proxy</replaceable>
2168     are IP addresses in dotted decimal notation or valid DNS names (<replaceable class="parameter">http_parent</replaceable>
2169     may be <quote>.</quote> to denote <quote>no HTTP forwarding</quote>), and the optional 
2170     <replaceable class="parameter">port</replaceable> parameters are TCP ports, i.e. integer values from 1 to 64535
2171    </para>
2172   </listitem>
2173  </varlistentry>
2174  <varlistentry>
2175   <term>Default value:</term>
2176   <listitem>
2177    <para><emphasis>Unset</emphasis></para>
2178   </listitem>
2179  </varlistentry>
2180  <varlistentry>
2181   <term>Effect if unset:</term>
2182   <listitem>
2183    <para>
2184     Don't use SOCKS proxies.
2185    </para>
2186   </listitem>
2187  </varlistentry>
2188  <varlistentry>
2189   <term>Notes:</term>
2190   <listitem>
2191    <para>
2192     Multiple lines are OK, they are checked in sequence, and the last match wins.
2193    </para>
2194    <para>
2195     The difference between <literal>forward-socks4</literal> and <literal>forward-socks4a</literal>
2196     is that in the SOCKS 4A protocol, the DNS resolution of the target hostname happens on the SOCKS
2197     server, while in SOCKS 4 it happens locally.
2198    </para>
2199    <para>
2200     If <replaceable class="parameter">http_parent</replaceable> is <quote>.</quote>, then requests are not
2201     forwarded to another HTTP proxy but are made (HTTP-wise) directly to the web servers, albeit through
2202     a SOCKS proxy.
2203    </para>
2204   </listitem>
2205  </varlistentry>
2206  <varlistentry>
2207   <term>Examples:</term>
2208   <listitem>
2209    <para>
2210      From the company example.com, direct connections are made to all
2211      <quote>internal</quote> domains, but everything outbound goes through
2212      their ISP's proxy by way of example.com's corporate SOCKS 4A gateway to
2213      the Internet.
2214    </para>
2215    <para>
2216     <screen>
2217   forward-socks4a   .*.            socks-gw.example.com:1080  www-cache.example-isp.net:8080
2218   forward           .example.com   .
2219 </screen>
2220    </para>
2221    <para>
2222     A rule that uses a SOCKS 4 gateway for all destinations but no HTTP parent looks like this:
2223    </para>
2224    <para>
2225     <screen>
2226   forward-socks4   .*.            socks-gw.example.com:1080  .
2227 </screen>
2228    </para>
2229   </listitem>
2230  </varlistentry>
2231 </variablelist>
2232 </sect3>
2233
2234 <sect3 renderas="sect4" id="advanced-forwarding-examples"><title>Advanced Forwarding Examples</title>
2235
2236 <para>
2237  If you have links to multiple ISPs that provide various special content 
2238  only to their subscribers, you can configure multiple <application>Privoxies</application>
2239  which have connections to the respective ISPs to act as forwarders to each other, so that
2240  <emphasis>your</emphasis> users can see the internal content of all ISPs.
2241 </para>
2242
2243 <para>
2244  Assume that host-a has a PPP connection to isp-a.net. And host-b has a PPP connection to
2245  isp-b.net. Both run <application>Privoxy</application>. Their forwarding
2246  configuration can look like this:
2247 </para>
2248
2249 <para>
2250  host-a:
2251 </para>
2252
2253 <para>
2254  <screen>
2255   forward    .*.         .
2256   forward    .isp-b.net  host-b:8118
2257 </screen>
2258 </para>
2259
2260 <para>
2261  host-b:
2262 </para>
2263
2264 <para>
2265  <screen>
2266   forward    .*.         .
2267   forward    .isp-a.net  host-a:8118
2268 </screen>
2269 </para>
2270
2271 <para>
2272  Now, your users can set their browser's proxy to use either
2273  host-a or host-b and be able to browse the internal content
2274  of both isp-a and isp-b.
2275 </para>
2276
2277 <para>
2278  If you intend to chain <application>Privoxy</application> and 
2279  <application>squid</application> locally, then chain as 
2280  <literal>browser -> squid -> privoxy</literal> is the recommended way. 
2281 </para>
2282
2283 <para>
2284  Assuming that <application>Privoxy</application> and <application>squid</application>
2285  run on the same box, your squid configuration could then look like this:
2286 </para>
2287
2288 <para>
2289  <screen>
2290   # Define Privoxy as parent proxy (without ICP) 
2291   cache_peer 127.0.0.1 parent 8118 7 no-query 
2292
2293   # Define ACL for protocol FTP 
2294   acl ftp proto FTP 
2295
2296   # Do not forward FTP requests to Privoxy
2297   always_direct allow ftp 
2298
2299   # Forward all the rest to Privoxy
2300   never_direct allow all</screen>
2301 </para>
2302
2303 <para>
2304  You would then need to change your browser's proxy settings to <application>squid</application>'s address and port.
2305  Squid normally uses port 3128. If unsure consult <literal>http_port</literal> in <filename>squid.conf</filename>.
2306 </para>
2307
2308 </sect3>
2309
2310 </sect2>
2311
2312 <!--  ~  End section  ~  -->
2313
2314
2315 <!--   ~~~~~       New section      ~~~~~     -->
2316
2317 <sect2 id="windows-gui">
2318 <title>Windows GUI Options</title>
2319 <para>
2320  <application>Privoxy</application> has a number of options specific to the
2321  Windows GUI interface:
2322 </para>
2323
2324 <anchor id="activity-animation">
2325 <para>
2326  If <quote>activity-animation</quote> is set to 1, the
2327  <application>Privoxy</application> icon will animate when
2328  <quote>Privoxy</quote> is active. To turn off, set to 0.
2329 </para>
2330
2331 <para>
2332  <literal>
2333   <msgtext> 
2334    <literallayout>
2335   <emphasis>activity-animation   1</emphasis>
2336    </literallayout>
2337   </msgtext> 
2338  </literal>
2339 </para>
2340
2341 <anchor id="log-messages">
2342 <para>
2343  If <quote>log-messages</quote> is set to 1,
2344  <application>Privoxy</application> will log messages to the console
2345  window:
2346 </para>
2347
2348 <para>
2349  <literal>
2350   <msgtext> 
2351    <literallayout>
2352   <emphasis>log-messages       1</emphasis>
2353    </literallayout>
2354   </msgtext> 
2355  </literal>
2356 </para>
2357
2358 <anchor id="log-buffer-size">
2359 <para> 
2360  If <quote>log-buffer-size</quote> is set to 1, the size of the log buffer,
2361  i.e. the amount of memory used for the log messages displayed in the
2362  console window, will be limited to <quote>log-max-lines</quote> (see below).
2363 </para>
2364
2365 <para>
2366  Warning: Setting this to 0 will result in the buffer to grow infinitely and
2367  eat up all your memory!
2368 </para>
2369
2370 <para>
2371  <literal>
2372   <msgtext> 
2373    <literallayout>
2374   <emphasis>log-buffer-size      1</emphasis>
2375    </literallayout>
2376   </msgtext> 
2377  </literal>
2378 </para>
2379
2380 <anchor id="log-max-lines">
2381 <para>
2382  <application>log-max-lines</application> is the maximum number of lines held
2383  in the log buffer. See above.
2384 </para>
2385
2386 <para>
2387  <literal>
2388   <msgtext> 
2389    <literallayout>
2390   <emphasis>log-max-lines      200</emphasis>
2391    </literallayout>
2392   </msgtext> 
2393  </literal>
2394 </para>
2395
2396 <anchor id="log-highlight-messages">
2397 <para>
2398  If <quote>log-highlight-messages</quote> is set to 1,
2399  <application>Privoxy</application> will highlight portions of the log
2400  messages with a bold-faced font:
2401 </para>
2402
2403 <para>
2404  <literal>
2405   <msgtext> 
2406    <literallayout>
2407   <emphasis>log-highlight-messages   1</emphasis>
2408    </literallayout>
2409   </msgtext> 
2410  </literal>
2411 </para>
2412
2413 <anchor id="log-font-name">
2414 <para>
2415  The font used in the console window:
2416 </para>
2417
2418 <para>
2419  <literal>
2420   <msgtext> 
2421    <literallayout>
2422   <emphasis>log-font-name        Comic Sans MS</emphasis>
2423    </literallayout>
2424   </msgtext> 
2425  </literal>
2426 </para>
2427
2428 <anchor id="log-font-size">
2429 <para>
2430  Font size used in the console window:
2431 </para>
2432
2433 <para>
2434  <literal>
2435   <msgtext> 
2436    <literallayout>
2437   <emphasis>log-font-size        8</emphasis>
2438    </literallayout>
2439   </msgtext> 
2440  </literal>
2441 </para>
2442
2443 <anchor id="show-on-task-bar">
2444 <para>  
2445  <quote>show-on-task-bar</quote> controls whether or not
2446  <application>Privoxy</application> will appear as a button on the Task bar
2447  when minimized:
2448 </para>
2449
2450 <para>
2451  <literal>
2452   <msgtext> 
2453    <literallayout>
2454   <emphasis>show-on-task-bar     0</emphasis>
2455    </literallayout>
2456   </msgtext> 
2457  </literal>
2458 </para>
2459
2460 <anchor id="close-button-minimizes">
2461 <para>
2462  If <quote>close-button-minimizes</quote> is set to 1, the Windows close
2463  button will minimize <application>Privoxy</application> instead of closing
2464  the program (close with the exit option on the File menu).
2465 </para>
2466
2467 <para>
2468  <literal>
2469   <msgtext> 
2470    <literallayout>
2471   <emphasis>close-button-minimizes  1</emphasis>
2472    </literallayout>
2473   </msgtext> 
2474  </literal>
2475 </para>
2476
2477 <anchor id="hide-console">
2478 <para>
2479  The <quote>hide-console</quote> option is specific to the MS-Win console
2480  version of <application>Privoxy</application>. If this option is used,
2481  <application>Privoxy</application> will disconnect from and hide  the
2482  command console.
2483 </para>
2484
2485 <para>
2486  <literal>
2487   <msgtext> 
2488    <literallayout>
2489   #<emphasis>hide-console</emphasis>
2490    </literallayout>
2491   </msgtext> 
2492  </literal>
2493 </para>
2494
2495 </sect2>
2496 </sect1>
2497
2498 <!--  ~  End section  ~  -->
2499
2500
2501
2502 <!--   ~~~~~~~~       New section Header    ~~~~~~~~~     -->
2503
2504 <sect1 id="actions-file"><title>Actions Files</title>
2505
2506 <para>
2507  The actions files are used to define what actions
2508  <application>Privoxy</application> takes for which URLs, and thus determines
2509  how ad images, cookies and various other aspects of HTTP content and
2510  transactions are handled, and on which sites (or even parts thereof). There 
2511  are three such files included with <application>Privoxy</application>, 
2512  with slightly different purposes. <filename>default.action</filename> sets
2513  the default policies. <filename>standard.action</filename> is used by 
2514  <application>Privoxy</application> and the web based editor to set 
2515  pre-defined values (and normally should not be edited). Local exceptions 
2516  are best done in <filename>user.action</filename>. The content of these 
2517  can all be viewed and edited from <ulink
2518  url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>.
2519  </para>
2520
2521 <para> 
2522  Anything you want can be blocked, including ads, banners, or just some obnoxious
2523  URL that you would rather not see is done here. Cookies can be accepted or rejected, or
2524  accepted only during the current browser session (i.e. not written to disk),
2525  content can be modified, JavaScripts tamed, user-tracking fooled, and much more.
2526  See below for a complete list of available actions.
2527 </para>
2528
2529 <para>
2530  An actions file typically has sections. Near the top, <quote>aliases</quote> are 
2531  optionally defined (discussed <ulink
2532  url="actions-file.html#ALIASES">below</ulink>), then the default set of rules
2533  which will apply universally to all sites and pages. And then below that,
2534  exceptions to the defined universal policies. 
2535 </para>
2536
2537 <!--   ~~~~~       New section      ~~~~~     -->
2538 <sect2>
2539 <title>Finding the Right Mix</title>
2540 <para>
2541  Note that some <link linkend="actions">actions</link>, like cookie suppression
2542  or script disabling, may render some sites unusable that rely on these
2543  techniques to work properly. Finding the right mix of actions is not always easy and
2544  certainly a matter of personal taste. In general, it can be said that the more
2545  <quote>aggressive</quote> your default settings (in the top section of the
2546  actions file) are, the more exceptions for <quote>trusted</quote> sites you
2547  will have to make later. If, for example, you want to kill popup windows per
2548  default, you'll have to make exceptions from that rule for sites that you
2549  regularly use and that require popups for actually useful content, like maybe
2550  your bank, favorite shop, or newspaper.
2551 </para>
2552
2553 <para>
2554  We have tried to provide you with reasonable rules to start from in the
2555  distribution actions files. But there is no general rule of thumb on these
2556  things. There just are too many variables, and sites are constantly changing.
2557  Sooner or later you will want to change the rules (and read this chapter again :).
2558 </para>
2559 </sect2>
2560
2561 <!--   ~~~~~       New section      ~~~~~     -->
2562 <sect2>
2563 <title>How to Edit</title>
2564 <para>
2565  The easiest way to edit the <quote>actions</quote> files is with a browser by
2566  using our browser-based editor, which can be reached from <ulink
2567  url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>.
2568 </para>
2569
2570 <para>
2571  If you prefer plain text editing to GUIs, you can of course also directly edit the
2572  the actions files.
2573 </para>
2574 </sect2>
2575
2576
2577 <sect2>
2578 <title>How Actions are Applied to URLs</title>
2579 <para>
2580  Actions files are divided into sections. There are special sections,
2581  like the <quote><link linkend="aliases">alias</link></quote> sections which will be discussed later. For now
2582  let's concentrate on regular sections: They have a heading line (often split
2583  up to multiple lines for readability) which consist of a list of actions,
2584  separated by whitespace and enclosed in curly braces. Below that, there
2585  is a list of URL patterns, each on a separate line.
2586 </para>
2587
2588 <para>
2589  To determine which actions apply to a request, the URL of the request is
2590  compared to all patterns in this file. Every time it matches, the list of
2591  applicable actions for the URL is incrementally updated, using the heading
2592  of the section in which the pattern is located. If multiple matches for
2593  the same URL set the same action differently, the last match wins. If not, 
2594  the effects are aggregated (e.g. a URL might match both the 
2595  <ulink url="actions-file.html#HANDLE-AS-IMAGE"><quote>+handle-as-image</quote></ulink>
2596  and <ulink url="actions-file.html#BLOCK"><quote>+block</quote></ulink> actions).
2597  
2598 </para>
2599
2600 <para>
2601  You can trace this process by visiting <ulink
2602  url="http://config.privoxy.org/show-url-info">http://config.privoxy.org/show-url-info</ulink>.
2603 </para>
2604
2605 <para>
2606  More detail on this is provided in the Appendix, <link linkend="ACTIONSANAT">
2607  Anatomy of an Action</link>.
2608 </para>
2609 </sect2>
2610
2611 <!--   ~~~~~       New section      ~~~~~     -->
2612 <sect2>
2613 <title>Patterns</title>
2614 <para>
2615  Generally, a pattern has the form <literal>&lt;domain&gt;/&lt;path&gt;</literal>,
2616  where both the <literal>&lt;domain&gt;</literal> and <literal>&lt;path&gt;</literal>
2617  are optional. (This is why the pattern <literal>/</literal> matches all URLs).
2618 </para>
2619
2620 <variablelist>
2621  <varlistentry>
2622   <term><literal>www.example.com/</literal></term>
2623   <listitem>
2624    <para>
2625     is a domain-only pattern and will match any request to <literal>www.example.com</literal>,
2626     regardless of which document on that server is requested.
2627    </para>
2628   </listitem>
2629  </varlistentry>
2630  <varlistentry>
2631   <term><literal>www.example.com</literal></term>
2632   <listitem>
2633    <para>
2634     means exactly the same. For domain-only patterns, the trailing <literal>/</literal> may
2635     be omitted.
2636    </para>
2637   </listitem>
2638  </varlistentry>
2639  <varlistentry>
2640   <term><literal>www.example.com/index.html</literal></term>
2641   <listitem>
2642    <para>
2643     matches only the single document <literal>/index.html</literal>
2644     on <literal>www.example.com</literal>.
2645    </para>
2646   </listitem>
2647  </varlistentry>
2648  <varlistentry>
2649   <term><literal>/index.html</literal></term>
2650   <listitem>
2651    <para>
2652     matches the document <literal>/index.html</literal>, regardless of the domain,
2653     i.e. on <emphasis>any</emphasis> web server.
2654    </para>
2655   </listitem>
2656  </varlistentry>
2657  <varlistentry>
2658   <term><literal>index.html</literal></term>
2659   <listitem>
2660    <para>
2661     matches nothing, since it would be  interpreted as a domain name and
2662     there is no top-level domain called <literal>.html</literal>.
2663    </para>
2664   </listitem>
2665  </varlistentry>
2666 </variablelist>
2667
2668
2669 <!--   ~~~~~       New section      ~~~~~     -->
2670 <sect3><title>The Domain Pattern</title>
2671
2672 <para>
2673  The matching of the domain part offers some flexible options: if the
2674  domain starts or ends with a dot, it becomes unanchored at that end. 
2675  For example:
2676 </para>
2677
2678 <variablelist>
2679  <varlistentry>
2680   <term><literal>.example.com</literal></term>
2681   <listitem>
2682    <para>
2683     matches any domain that <emphasis>ENDS</emphasis> in
2684     <literal>.example.com</literal>
2685    </para>
2686   </listitem>
2687  </varlistentry>
2688  <varlistentry>
2689   <term><literal>www.</literal></term>
2690   <listitem>
2691    <para>
2692     matches any domain that <emphasis>STARTS</emphasis> with
2693     <literal>www.</literal>
2694    </para>
2695   </listitem>
2696  </varlistentry>
2697  <varlistentry>
2698   <term><literal>.example.</literal></term>
2699   <listitem>
2700    <para>
2701     matches any domain that <emphasis>CONTAINS</emphasis> <literal>.example.</literal>
2702     (Correctly speaking: It matches any FQDN that contains <literal>example</literal> as a domain.)
2703    </para>
2704   </listitem>
2705  </varlistentry>
2706 </variablelist>
2707
2708 <para>
2709  Additionally, there are wild-cards that you can use in the domain names
2710  themselves. They work pretty similar to shell wild-cards: <quote>*</quote>
2711  stands for zero or more arbitrary characters, <quote>?</quote> stands for
2712  any single character, you can define character classes in square
2713  brackets and all of that can be freely mixed:
2714 </para>
2715
2716 <variablelist>
2717  <varlistentry>
2718   <term><literal>ad*.example.com</literal></term>
2719   <listitem>
2720    <para>
2721     matches <quote>adserver.example.com</quote>, 
2722     <quote>ads.example.com</quote>, etc but not <quote>sfads.example.com</quote>
2723    </para>
2724   </listitem>
2725  </varlistentry>
2726  <varlistentry>
2727   <term><literal>*ad*.example.com</literal></term>
2728   <listitem>
2729    <para>
2730     matches all of the above, and then some.
2731    </para>
2732   </listitem>
2733  </varlistentry>
2734  <varlistentry>
2735   <term><literal>.?pix.com</literal></term>
2736   <listitem>
2737    <para>
2738     matches <literal>www.ipix.com</literal>,
2739     <literal>pictures.epix.com</literal>, <literal>a.b.c.d.e.upix.com</literal> etc. 
2740    </para>
2741   </listitem>
2742  </varlistentry>
2743  <varlistentry>
2744   <term><literal>www[1-9a-ez].example.c*</literal></term>
2745   <listitem>
2746    <para>
2747      matches <literal>www1.example.com</literal>, 
2748      <literal>www4.example.cc</literal>, <literal>wwwd.example.cy</literal>, 
2749      <literal>wwwz.example.com</literal> etc., but <emphasis>not</emphasis> 
2750      <literal>wwww.example.com</literal>.
2751    </para>
2752   </listitem>
2753  </varlistentry>
2754 </variablelist>
2755
2756 </sect3>
2757
2758 <!--  ~  End section  ~  -->
2759
2760
2761 <!--   ~~~~~       New section      ~~~~~     -->
2762 <sect3><title>The Path Pattern</title>
2763
2764 <para>
2765  <application>Privoxy</application> uses Perl compatible regular expressions
2766  (through the <ulink url="http://www.pcre.org/">PCRE</ulink> library) for
2767  matching the path.
2768 </para>
2769
2770 <para>
2771  There is an <link linkend="regex">Appendix</link> with a brief quick-start into regular
2772  expressions, and full (very technical) documentation on PCRE regex syntax is available on-line
2773  at <ulink url="http://www.pcre.org/man.txt">http://www.pcre.org/man.txt</ulink>.
2774  You might also find the Perl man page on regular expressions (<literal>man perlre</literal>)
2775  useful, which is available on-line at <ulink
2776  url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>.
2777 </para>
2778
2779 <para>
2780  Note that the path pattern is automatically left-anchored at the <quote>/</quote>,
2781  i.e. it matches as if it would start with a <quote>^</quote> (regular expression speak 
2782  for the beginning of a line).
2783 </para>
2784
2785 <para>
2786  Please also note that matching in the path is case
2787  <emphasis>INSENSITIVE</emphasis> by default, but you can switch to case
2788  sensitive at any point in the pattern by using the 
2789  <quote>(?-i)</quote> switch:
2790  <literal>www.example.com/(?-i)PaTtErN.*</literal> will match only
2791  documents whose path starts with <literal>PaTtErN</literal> in
2792  <emphasis>exactly</emphasis> this capitalization.
2793 </para>
2794 </sect3>
2795
2796 </sect2>
2797
2798 <!--  ~  End section  ~  -->
2799
2800
2801 <!--   ~~~~~       New section      ~~~~~     -->
2802
2803 <sect2 id="actions">
2804 <title>Actions</title>
2805 <para>
2806  All actions are disabled by default, until they are explicitly enabled
2807  somewhere in an actions file. Actions are turned on if preceded with a
2808  <quote>+</quote>, and turned off if preceded with a <quote>-</quote>. So a
2809  <quote>+action</quote> means <quote>do that action</quote>, e.g.
2810  <quote>+block</quote> means please <quote>block the following URL
2811  patterns</quote>. 
2812 </para>
2813
2814 <para> 
2815  Actions are invoked by enclosing the action name in curly braces (e.g.
2816  {+some_action}), followed by a list of URLs (or patterns that match URLs) to
2817  which the action applies. There are three classes of actions: 
2818 </para>
2819
2820 <para>
2821  <itemizedlist>
2822
2823  <listitem>
2824   <para>  
2825    Boolean, i.e the action can only be <quote>on</quote> or
2826    <quote>off</quote>. Examples: 
2827  </para>
2828   <para>
2829    <literal>
2830     <msgtext> 
2831      <literallayout>
2832   <emphasis>{+name}</emphasis>        # enable this action
2833   <emphasis>{-name}</emphasis>        # disable this action
2834      </literallayout>
2835     </msgtext> 
2836    </literal>
2837   </para>
2838  </listitem>
2839
2840
2841  <listitem>
2842   <para>  
2843    Parameterized, e.g. <quote>+/-hide-user-agent{ Mozilla 1.0 }</quote>, 
2844    where some value is required in order to enable this type of action.
2845    Examples:
2846   </para>
2847   <para>
2848    <literal>
2849     <msgtext> 
2850      <literallayout>
2851   <emphasis>{+name{param}}</emphasis>  # enable action and set parameter to <quote>param</quote>
2852   <emphasis>{-name}</emphasis>         # disable action (<quote>parameter</quote>) can be omitted
2853      </literallayout>
2854     </msgtext> 
2855    </literal>
2856   </para>
2857  </listitem>
2858  
2859  <listitem>
2860   <para>  
2861   <!-- oes, or someone, check this. Re-worded 04/20/02 HB. -->
2862    Multi-value, e.g. <quote>{+/-add-header{Name: value}}</quote> or
2863    <quote>{+/-send-wafer{name=value}}</quote>), where some value needs to be defined
2864    in addition to simply enabling the action. Examples:
2865   </para>
2866   <para>
2867    <literal>
2868     <msgtext> 
2869      <literallayout>
2870   <emphasis>{+name{param=value}}</emphasis>   # enable action and set <quote>param</quote> to <quote>value</quote>
2871   <emphasis>{-name{param=value}}</emphasis>   # remove the parameter <quote>param</quote> completely
2872   <emphasis>{-name}</emphasis>                # disable this action totally and remove <application>param</application> too
2873      </literallayout>
2874     </msgtext> 
2875    </literal>
2876   </para>
2877  </listitem>
2878
2879  </itemizedlist>
2880 </para>
2881
2882 <para>
2883  If nothing is specified in any actions file, no <quote>actions</quote> are
2884  taken. So in this case <application>Privoxy</application> would just be a
2885  normal, non-blocking, non-anonymizing proxy. You must specifically enable the
2886  privacy and blocking features you need (although the provided default actions
2887  files will give a good starting point).
2888 </para>
2889
2890 <para>
2891  Later defined actions always over-ride earlier ones.  So exceptions 
2892  to any rules you make, should come in the latter part of the file (or 
2893  in a file that is processed later when using multiple actions files). For
2894  multi-valued actions, the actions are applied in the order they are specified.
2895  Actions files are processed in the order they are defined in
2896  <filename>config</filename> (the default installation has three actions
2897  files). It also quite possible for any given URL pattern to match more than
2898  one action!
2899 </para>
2900
2901 <!-- start actions listing -->
2902 <para>
2903  The list of valid <application>Privoxy</application> <quote>actions</quote> are:
2904 </para>
2905
2906
2907 <!-- ********************************************************** -->
2908 <!-- Please note the below defined actions use id's that are    -->
2909 <!-- probably linked from other places, so please don't change. -->
2910 <!--                                                            -->
2911 <!-- ********************************************************** -->
2912
2913
2914 <!--   ~~~~~       New section      ~~~~~     -->
2915
2916 <sect3 renderas="sect4" id="add-header">
2917 <title><emphasis>+add-header</emphasis></title>
2918
2919 <variablelist>
2920  <varlistentry>
2921   <term>Type:</term>
2922   <!-- boolean, parameterized, Multi-value -->
2923   <listitem>
2924    <para>Multi-value.</para>
2925   </listitem>
2926  </varlistentry>
2927  
2928  <varlistentry>
2929   <term>Typical uses:</term>
2930   <listitem>
2931    <para>
2932     Send a user defined HTTP header to the web server.
2933    </para>
2934   </listitem>
2935  </varlistentry>
2936
2937  <varlistentry>
2938   <term>Possible values:</term>
2939   <listitem>
2940    <para>
2941     Any value is possible. Validity of the defined HTTP headers is not checked.
2942    </para>
2943   </listitem>
2944  </varlistentry>
2945  
2946  <varlistentry>
2947   <term>Example usage:</term>
2948   <listitem>
2949     <literallayout>
2950      <emphasis>{+add-header{X-User-Tracking: sucks}}</emphasis>
2951      <emphasis>.example.com</emphasis>
2952     </literallayout>
2953   </listitem>
2954  </varlistentry>
2955
2956 <varlistentry>
2957   <term>Notes:</term>
2958   <listitem>
2959    <para>
2960     This action may be specified multiple times, in order to define multiple 
2961     headers. This is rarely needed for the typical user. If you don't know what 
2962     <quote>HTTP headers</quote> are, you definitely don't need to worry about this 
2963     one.
2964    </para>
2965   </listitem>
2966  </varlistentry>
2967 </variablelist>
2968 </sect3>
2969
2970
2971 <!--   ~~~~~       New section      ~~~~~     -->
2972 <sect3 renderas="sect4" id="block">
2973 <title><emphasis>+block</emphasis></title>
2974
2975 <variablelist>
2976  <varlistentry>
2977   <term>Type:</term>
2978   <!-- boolean, parameterized, Multi-value -->
2979   <listitem>
2980    <para>Boolean.</para>
2981   </listitem>
2982  </varlistentry>
2983
2984  <varlistentry>
2985   <term>Typical uses:</term>
2986   <listitem>
2987    <para>
2988     Used to block a URL from reaching your browser. The URL may be 
2989     anything, but is typically used to block ads or other obnoxious 
2990     content.    
2991    </para>
2992   </listitem>
2993  </varlistentry>
2994
2995  <varlistentry>
2996   <term>Possible values:</term>
2997   <listitem>
2998    <para>N/A</para>
2999   </listitem>
3000  </varlistentry>
3001  
3002  <varlistentry>
3003   <term>Example usage:</term>
3004   <listitem>
3005     <literallayout>
3006      <emphasis>{+block}</emphasis>
3007      <emphasis>.banners.example.com</emphasis>
3008      <emphasis>.ads.r.us</emphasis>
3009     </literallayout>
3010   </listitem>
3011  </varlistentry>
3012
3013 <varlistentry>
3014   <term>Notes:</term>
3015   <listitem>
3016    <para>
3017     If a URL matches one of the blocked patterns, <application>Privoxy</application>
3018     will intercept the URL and display its special <quote>BLOCKED</quote> page
3019     instead. If there is sufficient space, a large red banner will appear with
3020     a friendly message about why the page was blocked, and a way to go there
3021     anyway. If there is insufficient space a smaller <quote>BLOCKED</quote>
3022     page will appear without the red banner. 
3023     <ulink url="http://ads.bannerserver.example.com/nasty-ads/sponsor.html">Click here</ulink>
3024     to view the default blocked HTML page (<application>Privoxy</application> must be running 
3025     for this to work as intended!).
3026    </para>
3027
3028    <para> 
3029     A very important exception is if the URL <emphasis>matches both</emphasis>
3030     <quote>+block</quote> and <ulink
3031     url="actions-file.html#HANDLE-AS-IMAGE"><quote>+handle-as-image</quote></ulink>,
3032     then it will be handled by 
3033     <ulink url="actions-file.html#SET-IMAGE-BLOCKER"><quote>+set-image-blocker</quote></ulink>
3034     (see below). It is important to understand this process, in order 
3035     to understand how <application>Privoxy</application> is able to deal with 
3036     ads and other objectionable content.
3037    </para>
3038    <para>
3039     The <ulink url="actions-file.html#FILTER"><quote>+filter</quote></ulink>
3040     action can also perform some of the 
3041     same functionality as <quote>+block</quote>, but by virtue of very 
3042     different programming techniques, and is most often used for different 
3043     reasons.
3044    </para>
3045   </listitem>
3046  </varlistentry>
3047
3048 </variablelist>
3049 </sect3>
3050
3051
3052 <!--   ~~~~~       New section      ~~~~~     -->
3053 <sect3 renderas="sect4" id="deanimate-gifs">
3054 <title><emphasis>+deanimate-gifs</emphasis></title>
3055
3056 <variablelist>
3057  <varlistentry>
3058   <term>Type:</term>
3059   <!-- boolean, parameterized, Multi-value -->
3060   <listitem>
3061    <para>Parameterized.</para>
3062   </listitem>
3063  </varlistentry>
3064
3065  <varlistentry>
3066   <term>Typical uses:</term>
3067   <listitem>
3068    <para>
3069     To stop those annoying, distracting animated GIF images.
3070    </para>
3071   </listitem>
3072  </varlistentry>
3073
3074  <varlistentry>
3075   <term>Possible values:</term>
3076   <listitem>
3077    <para>
3078     <quote>last</quote> or <quote>first</quote>
3079    </para>
3080   </listitem>
3081  </varlistentry>
3082  
3083  <varlistentry>
3084   <term>Example usage:</term>
3085   <listitem>
3086     <literallayout>
3087       <emphasis>{+deanimate-gifs{last}}</emphasis>
3088       <emphasis>.example.com</emphasis>
3089     </literallayout>
3090   </listitem>
3091  </varlistentry>
3092
3093  <varlistentry>
3094   <term>Notes:</term>
3095   <listitem>
3096    <para>
3097     De-animate all animated GIF images, i.e. reduce them to their last frame.
3098     This will also shrink the images considerably (in bytes, not pixels!). If
3099     the option <quote>first</quote> is given, the first frame of the animation
3100     is used as the replacement. If <quote>last</quote> is given, the last
3101     frame of the animation is used instead, which probably makes more sense for
3102     most banner animations, but also has the risk of not showing the entire
3103     last frame (if it is only a delta to an earlier frame).
3104    </para>
3105   </listitem>
3106  </varlistentry>
3107
3108 </variablelist>
3109 </sect3>
3110
3111 <!--   ~~~~~       New section      ~~~~~     -->
3112 <sect3 renderas="sect4" id="downgrade-http-version">
3113 <title><emphasis>+downgrade-http-version</emphasis></title>
3114
3115 <variablelist>
3116  <varlistentry>
3117   <term>Type:</term>
3118   <!-- boolean, parameterized, Multi-value -->
3119   <listitem>
3120    <para>Boolean.</para>
3121   </listitem>
3122  </varlistentry>
3123
3124  <varlistentry>
3125   <term>Typical uses:</term>
3126   <listitem>
3127    <para>
3128     <quote>+downgrade-http-version</quote> will downgrade HTTP/1.1 client requests to
3129     HTTP/1.0 and downgrade the responses as well.
3130    </para>
3131   </listitem>
3132  </varlistentry>
3133
3134  <varlistentry>
3135   <term>Possible values:</term>
3136   <listitem>
3137    <para>
3138     N/A
3139    </para>
3140   </listitem>
3141  </varlistentry>
3142  
3143  <varlistentry>
3144   <term>Example usage:</term>
3145   <listitem>
3146     <literallayout>
3147      <emphasis>{+downgrade-http-version}</emphasis>
3148      <emphasis>.example.com</emphasis>
3149     </literallayout>
3150   </listitem>
3151  </varlistentry>
3152
3153  <varlistentry>
3154   <term>Notes:</term>
3155   <listitem>
3156    <para>
3157     Use this action for servers that use HTTP/1.1 protocol features that
3158     <application>Privoxy</application> doesn't handle well yet. HTTP/1.1 is
3159     only partially implemented. Default is not to downgrade requests. This is
3160     an infrequently needed action, and is used to help with rare problem sites only.
3161    </para>
3162   </listitem>
3163  </varlistentry>
3164
3165 </variablelist>
3166 </sect3>
3167
3168 <!--   ~~~~~       New section      ~~~~~     -->
3169 <sect3 renderas="sect4" id="fast-redirects">
3170 <title><emphasis>+fast-redirects</emphasis></title>
3171
3172 <variablelist>
3173  <varlistentry>
3174   <term>Type:</term>
3175   <!-- boolean, parameterized, Multi-value -->
3176   <listitem>
3177    <para>Boolean.</para>
3178   </listitem>
3179  </varlistentry>
3180
3181  <varlistentry>
3182   <term>Typical uses:</term>
3183   <listitem>
3184    <para>
3185     The <quote>+fast-redirects</quote> action enables interception of 
3186     <quote>redirect</quote> requests from one server to another, which 
3187     are used to track users.<application>Privoxy</application> can cut off
3188     all but the last valid URL in a redirect request and send a local redirect
3189     back to your browser without contacting the intermediate site(s).
3190    </para>
3191   </listitem>
3192  </varlistentry>
3193
3194  <varlistentry>
3195   <term>Possible values:</term>
3196   <listitem>
3197    <para>
3198     N/A
3199    </para>
3200   </listitem>
3201  </varlistentry>
3202  
3203  <varlistentry>
3204   <term>Example usage:</term>
3205   <listitem>
3206     <literallayout>
3207      <emphasis>{+fast-redirects}</emphasis>
3208      <emphasis>.example.com</emphasis>
3209     </literallayout>
3210   </listitem>
3211  </varlistentry>
3212
3213  <varlistentry>
3214   <term>Notes:</term>
3215   <listitem>
3216    <para>  
3217     Many sites, like yahoo.com, don't just link to other sites. Instead, they
3218     will link to some script on their own server, giving the destination as a
3219     parameter, which will then redirect you to the final target. URLs
3220     resulting from this scheme typically look like:
3221     <emphasis>http://some.place/some_script?http://some.where-else</emphasis>.
3222   </para>
3223    <para>
3224     Sometimes, there are even multiple consecutive redirects encoded in the
3225     URL. These redirections via scripts make your web browsing more traceable,
3226     since the server from which you follow such a link can see where you go
3227     to. Apart from that, valuable bandwidth and time is wasted, while your
3228     browser ask the server for one redirect after the other. Plus, it feeds
3229     the advertisers.
3230    </para>
3231    <para>
3232     This is a normally <quote>on</quote> feature, and often requires exceptions
3233     for sites that are sensitive to defeating this mechanism.
3234    </para>
3235   </listitem>
3236  </varlistentry>
3237
3238 </variablelist>
3239 </sect3>
3240
3241
3242 <!--   ~~~~~       New section      ~~~~~     -->
3243 <sect3 renderas="sect4" id="filter">
3244 <title><emphasis>+filter</emphasis></title>
3245
3246 <variablelist>
3247  <varlistentry>
3248   <term>Type:</term>
3249   <!-- boolean, parameterized, Multi-value -->
3250   <listitem>
3251    <para>Parameterized.</para>
3252   </listitem>
3253  </varlistentry>
3254
3255  <varlistentry>
3256   <term>Typical uses:</term>
3257   <listitem>
3258    <para>
3259     Apply page filtering as defined by named sections of the
3260     <filename>default.filter</filename> file to the specified site(s). 
3261     <quote>Filtering</quote> can be any modification of the raw 
3262     page content, including re-writing or deletion of content.
3263    </para>
3264   </listitem>
3265  </varlistentry>
3266
3267  <varlistentry>
3268   <term>Possible values:</term>
3269   <listitem>
3270    <para>
3271     <quote>+filter</quote> must include the name of one of the section identifiers
3272     from <filename>default.filter</filename> (or whatever
3273     <emphasis>filterfile</emphasis> is specified in <filename>config</filename>).
3274    </para>
3275   </listitem>
3276  </varlistentry>
3277  
3278  <varlistentry>
3279   <term>Example usage (from the current <filename>default.filter</filename>):</term>
3280   <listitem>
3281    <simplelist>
3282    <member>
3283     <anchor id="filter-html-annoyances">
3284     <emphasis>+filter{html-annoyances}</emphasis>:  Get rid of particularly annoying HTML abuse.
3285    </member>
3286   </simplelist>
3287   <simplelist>
3288    <member>
3289     <anchor id="filter-js-annoyances">
3290     <emphasis>+filter{js-annoyances}</emphasis>:    Get rid of particularly annoying JavaScript abuse
3291    </member>
3292   </simplelist>
3293   <simplelist>
3294    <member>
3295     <anchor id="filter-content-cookies">
3296     <emphasis>+filter{content-cookies}</emphasis>:   Kill cookies that come in the HTML or JS content 
3297    </member>
3298   </simplelist>
3299   <simplelist>
3300    <member>
3301     <anchor id="filter-popups">
3302     <emphasis>+filter{popups}</emphasis>:         Kill all popups in JS and HTML
3303    </member>
3304   </simplelist>
3305   <simplelist>
3306    <member>
3307     <anchor id="filter-frameset-borders">
3308     <emphasis>+filter{frameset-borders}</emphasis>: Give frames a border and make them resizable 
3309    </member>
3310   </simplelist>
3311   <simplelist>
3312    <member>
3313     <anchor id="filter-webbugs">
3314     <emphasis>+filter{webbugs}</emphasis>:          Squish WebBugs (1x1 invisible GIFs used for user tracking)
3315    </member>
3316   </simplelist>
3317   <simplelist>
3318    <member>
3319     <anchor id="filter-refresh-tags">
3320     <emphasis>+filter{refresh-tags}</emphasis>:     Kill automatic refresh tags (for dial-on-demand setups) 
3321    </member>
3322   </simplelist>
3323   <simplelist>
3324    <member>
3325     <anchor id="filter-fun">
3326     <emphasis>+filter{fun}</emphasis>:              Text replacements  for subversive browsing fun!
3327    </member>
3328   </simplelist>
3329   <simplelist>
3330    <member>
3331     <anchor id="filter-nimda">
3332     <emphasis>+filter{nimda}</emphasis>:            Remove Nimda (virus) code.
3333    </member>
3334   </simplelist>
3335   <simplelist>
3336    <member>
3337     <anchor id="filter-banners-by-size">
3338     <emphasis>+filter{banners-by-size}</emphasis>:  Kill banners by size (<emphasis>very</emphasis> efficient!)
3339    </member>
3340   </simplelist>
3341   <simplelist>
3342    <member>
3343     <anchor id="filter-shockwave-flash">
3344     <emphasis>+filter{shockwave-flash}</emphasis>:   Kill embedded Shockwave Flash objects
3345    </member>
3346   </simplelist>
3347   <simplelist>
3348    <member>
3349     <anchor id="filter-crude-parental">
3350     <emphasis>+filter{crude-parental}</emphasis>:   Kill all web pages that contain the words "sex" or "warez"
3351    </member>
3352   </simplelist>
3353   </listitem>
3354  </varlistentry>
3355
3356  <varlistentry>
3357   <term>Notes:</term>
3358   <listitem>
3359    <para>
3360     This is potentially a very powerful feature! And requires a knowledge 
3361     of regular expressions if you want to <quote>roll your own</quote>.
3362     Filtering operates on a line by line basis throughout the entire page.
3363    </para>
3364    <para>
3365     Filtering requires buffering the page content, which may appear to
3366     slow down page rendering since nothing is displayed until all content has
3367     passed the filters. (It does not really take longer, but seems that way
3368     since the page is not incrementally displayed.) This effect will be more
3369     noticeable on slower connections.
3370    </para>
3371    <para>
3372     Filtering can achieve some of the effects as the 
3373     <ulink url="actions-file#BLOCK"><quote>+block</quote></ulink>
3374     action, i.e. it can be used to block ads and banners. In the overall 
3375     scheme of things, filtering is one of the first things <quote>Privoxy</quote> 
3376     does with a web page. So other most other actions are applied to the 
3377     already <quote>filtered</quote> page.
3378    </para>
3379   </listitem>
3380  </varlistentry>
3381
3382 </variablelist>
3383 </sect3>
3384
3385
3386 <!--   ~~~~~       New section      ~~~~~     -->
3387 <sect3 renderas="sect4" id="hide-forwarded-for-headers">
3388 <title><emphasis>+hide-forwarded-for-headers</emphasis></title>
3389
3390 <variablelist>
3391  <varlistentry>
3392   <term>Type:</term>
3393   <!-- Boolean, Parameterized, Multi-value -->
3394   <listitem>
3395    <para>Boolean.</para>
3396   </listitem>
3397  </varlistentry>
3398
3399  <varlistentry>
3400   <term>Typical uses:</term>
3401   <listitem>
3402    <para>
3403     Block any existing X-Forwarded-for HTTP header, and do not add a new one.
3404    </para>
3405   </listitem>
3406  </varlistentry>
3407
3408  <varlistentry>
3409   <term>Possible values:</term>
3410   <listitem>
3411    <para>
3412     N/A
3413    </para>
3414   </listitem>
3415  </varlistentry>
3416  
3417  <varlistentry>
3418   <term>Example usage:</term>
3419   <listitem>
3420     <literallayout>
3421      <emphasis>{+hide-forwarded-for-headers}</emphasis>
3422      <emphasis>.example.com</emphasis>
3423     </literallayout>
3424   </listitem>
3425  </varlistentry>
3426
3427  <varlistentry>
3428   <term>Notes:</term>
3429   <listitem>
3430    <para>
3431     It is fairly safe to leave this on. It does not seem to break many sites.
3432    </para>
3433   </listitem>
3434  </varlistentry>
3435
3436 </variablelist>
3437 </sect3>
3438
3439
3440 <!--   ~~~~~       New section      ~~~~~     -->
3441 <sect3 renderas="sect4" id="hide-from-header">
3442 <title><emphasis>+hide-from-header</emphasis></title>
3443
3444 <variablelist>
3445  <varlistentry>
3446   <term>Type:</term>
3447   <!-- Boolean, Parameterized, Multi-value -->
3448   <listitem>
3449    <para>Parameterized.</para>
3450   </listitem>
3451  </varlistentry>
3452
3453  <varlistentry>
3454   <term>Typical uses:</term>
3455   <listitem>
3456    <para>
3457     To block the browser from sending your email address in a <quote>From:</quote>
3458     header.
3459    </para>
3460   </listitem>
3461  </varlistentry>
3462
3463  <varlistentry>
3464   <term>Possible values:</term>
3465   <listitem>
3466    <para>
3467     Keyword: <quote>block</quote>, or any user defined value.
3468    </para>
3469   </listitem>
3470  </varlistentry>
3471  
3472  <varlistentry>
3473   <term>Example usage:</term>
3474   <listitem>
3475     <literallayout>
3476      <emphasis>{+hide-from-header{block}}</emphasis>
3477      <emphasis>.example.com</emphasis>
3478     </literallayout>
3479   </listitem>
3480  </varlistentry>
3481
3482  <varlistentry>
3483   <term>Notes:</term>
3484   <listitem>
3485    <para>
3486     The keyword <quote>block</quote> will completely remove the header 
3487     (not to be confused with the <ulink
3488     url="actions-file.html#BLOCK"><quote>+block</quote></ulink> action).
3489     Alternately, you can specify any value you prefer to send to the web
3490     server.
3491    </para>
3492   </listitem>
3493  </varlistentry>
3494
3495 </variablelist>
3496 </sect3>
3497
3498
3499 <!--   ~~~~~       New section      ~~~~~     -->
3500 <sect3 renderas="sect4" id="hide-referer">
3501 <title><emphasis>+hide-referer</emphasis></title>
3502 <anchor id="hide-referrer">
3503 <variablelist>
3504  <varlistentry>
3505   <term>Type:</term>
3506   <!-- Boolean, Parameterized, Multi-value -->
3507   <listitem>
3508    <para>Parameterized.</para>
3509   </listitem>
3510  </varlistentry>
3511
3512  <varlistentry>
3513   <term>Typical uses:</term>
3514   <listitem>
3515    <para>
3516      Don't send the <quote>Referer:</quote> (sic) HTTP header to the web site.
3517      Or, alternately send a forged header instead.
3518    </para>
3519   </listitem>
3520  </varlistentry>
3521
3522  <varlistentry>
3523   <term>Possible values:</term>
3524   <listitem>
3525    <para>
3526      Prevent the header from being sent with the keyword, <quote>block</quote>.
3527      Or, <quote>forge</quote> a URL to one from the same server as the request.
3528      Or, set to user defined value of your choice.
3529    </para>
3530   </listitem>
3531  </varlistentry>
3532  
3533  <varlistentry>
3534   <term>Example usage:</term>
3535   <listitem>
3536     <literallayout>
3537      <emphasis>{+hide-referer{forge}}</emphasis>
3538      <emphasis>.example.com</emphasis>
3539     </literallayout>
3540   </listitem>
3541  </varlistentry>
3542
3543  <varlistentry>
3544   <term>Notes:</term>
3545   <listitem>
3546    <para>
3547     <quote>forge</quote> is the preferred option here, since some servers will
3548     not send images back otherwise.
3549    </para>
3550   <para>  
3551    <quote>+hide-referrer</quote> is an alternate spelling of
3552    <quote>+hide-referer</quote>. It has the exact same parameters, and can be freely
3553    mixed with, <quote>+hide-referer</quote>. (<quote>referrer</quote> is the
3554    correct English spelling, however the HTTP specification has a bug - it
3555    requires it to be spelled as <quote>referer</quote>.) 
3556   </para>
3557   </listitem>
3558  </varlistentry>
3559
3560 </variablelist>
3561 </sect3>
3562
3563
3564 <!--   ~~~~~       New section      ~~~~~     -->
3565 <sect3 renderas="sect4" id="hide-user-agent">
3566 <title><emphasis>+hide-user-agent</emphasis></title>
3567
3568 <variablelist>
3569  <varlistentry>
3570   <term>Type:</term>
3571   <!-- Boolean, Parameterized, Multi-value -->
3572   <listitem>
3573    <para>Parameterized.</para>
3574   </listitem>
3575  </varlistentry>
3576
3577  <varlistentry>
3578   <term>Typical uses:</term>
3579   <listitem>
3580    <para>
3581     To change the <quote>User-Agent:</quote> header so web servers can't tell
3582     your browser type. Who's business is it anyway?
3583    </para>
3584   </listitem>
3585  </varlistentry>
3586
3587  <varlistentry>
3588   <term>Possible values:</term>
3589   <listitem>
3590    <para>
3591     Any user defined string.
3592    </para>
3593   </listitem>
3594  </varlistentry>
3595  
3596  <varlistentry>
3597   <term>Example usage:</term>
3598   <listitem>
3599     <literallayout>
3600      <emphasis>{+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}}</emphasis>
3601      <emphasis>.msn.com</emphasis>
3602     </literallayout>
3603   </listitem>
3604  </varlistentry>
3605
3606  <varlistentry>
3607   <term>Notes:</term>
3608   <listitem>
3609    <para>
3610      Warning! This breaks many web sites that depend on this in order 
3611      to determine how the target browser will respond to various 
3612      requests. Use with caution.
3613    </para>
3614   </listitem>
3615  </varlistentry>
3616
3617 </variablelist>
3618 </sect3>
3619
3620 <!--   ~~~~~       New section      ~~~~~     -->
3621 <sect3 renderas="sect4" id="handle-as-image">
3622 <title><emphasis>+handle-as-image</emphasis></title>
3623
3624 <variablelist>
3625  <varlistentry>
3626   <term>Type:</term>
3627   <!-- Boolean, Parameterized, Multi-value -->
3628   <listitem>
3629    <para>Boolean.</para>
3630   </listitem>
3631  </varlistentry>
3632
3633  <varlistentry>
3634   <term>Typical uses:</term>
3635   <listitem>
3636    <para>
3637     To define what <application>Privoxy</application> should treat 
3638     automatically as an image, and is an important ingredient of how 
3639     ads are handled.
3640    </para>
3641   </listitem>
3642  </varlistentry>
3643
3644  <varlistentry>
3645   <term>Possible values:</term>
3646   <listitem>
3647    <para>
3648     N/A
3649    </para>
3650   </listitem>
3651  </varlistentry>
3652  
3653  <varlistentry>
3654   <term>Example usage:</term>
3655   <listitem>
3656     <literallayout>
3657      <emphasis>{+handle-as-image}</emphasis>
3658      <emphasis>/.*\.(gif|jpg|jpeg|png|bmp|ico)</emphasis>
3659     </literallayout>
3660   </listitem>
3661  </varlistentry>
3662
3663  <varlistentry>
3664   <term>Notes:</term>
3665   <listitem>
3666    <para>
3667     This only has meaning if the URL (or pattern) also is
3668     <quote>+block</quote>ed, in which case a user definable image can
3669     be sent rather than a HTML page. This is integral to the whole concept of
3670     ad blocking: the URL must match <emphasis>both</emphasis> a <ulink
3671     url="actions-file.html#BLOCK"><quote>+block</quote></ulink> rule,
3672     <emphasis>and</emphasis> <quote>+handle-as-image</quote>.
3673     (See <ulink
3674     url="actions-file.html#SET-IMAGE-BLOCKER"><quote>+set-image-blocker</quote></ulink>
3675     below for control over what will actually be displayed by the browser.)
3676    </para>
3677    <para>
3678     There is little reason to change the default definition for this action.
3679    </para>
3680   </listitem>
3681  </varlistentry>
3682
3683 </variablelist>
3684 </sect3>
3685
3686
3687 <!--   ~~~~~       New section      ~~~~~     -->
3688 <sect3 renderas="sect4" id="set-image-blocker">
3689 <title><emphasis>+set-image-blocker</emphasis></title>
3690
3691 <variablelist>
3692  <varlistentry>
3693   <term>Type:</term>
3694   <!-- Boolean, Parameterized, Multi-value -->
3695   <listitem>
3696    <para>Parameterized.</para>
3697   </listitem>
3698  </varlistentry>
3699
3700  <varlistentry>
3701   <term>Typical uses:</term>
3702   <listitem>
3703    <para>
3704     Decide what to do with URLs that end up tagged with <emphasis>both</emphasis> 
3705     <ulink url="actions-file.html#BLOCK"><quote>+block</quote></ulink>
3706     and <ulink
3707     url="actions-file.html#HANDLE-AS-IMAGE"><quote>+handle-as-image</quote></ulink>,
3708     e.g an advertisement.
3709    </para>
3710   </listitem>
3711  </varlistentry>
3712
3713  <varlistentry>
3714   <term>Possible values:</term>
3715   <listitem>
3716    <para>
3717     There are four available options: <quote>-set-image-blocker</quote> will send a HTML
3718     <quote>blocked</quote> page, usually resulting in a <quote>broken
3719     image</quote> icon.
3720     <quote>+set-image-blocker{<emphasis>blank</emphasis>}</quote> will send a
3721     1x1 transparent GIF image.
3722     <quote>+set-image-blocker{<emphasis>pattern</emphasis>}</quote> will send a
3723     checkerboard type pattern (the default). And finally,
3724     <quote>+set-image-blocker{<emphasis>http://xyz.com</emphasis>}</quote> will
3725     send a HTTP temporary redirect to the specified image. This has the
3726     advantage of the icon being being cached by the browser, which will speed
3727     up the display.
3728    </para>
3729   </listitem>
3730  </varlistentry>
3731  
3732  <varlistentry>
3733   <term>Example usage:</term>
3734   <listitem>
3735     <literallayout>
3736      <emphasis>{+set-image-blocker{blank}}</emphasis>
3737      <emphasis>.example.com</emphasis>
3738     </literallayout>
3739   </listitem>
3740  </varlistentry>
3741
3742  <varlistentry>
3743   <term>Notes:</term>
3744   <listitem>
3745    <para>
3746     If you want <emphasis>invisible</emphasis> ads, they need to meet 
3747     criteria as matching both <emphasis>images</emphasis> and <emphasis>blocked</emphasis>
3748     actions. And then, <quote>image-blocker</quote> should be set to
3749     <quote>blank</quote> for invisibility. Note you cannot treat HTML pages as
3750     images in most cases. For instance, frames require an HTML page to
3751     display. So a frame that is an ad, typically cannot be treated as an image.
3752     Forcing an <quote>image</quote> in this situation just will not work
3753     reliably. 
3754    </para>
3755   </listitem>
3756  </varlistentry>
3757
3758 </variablelist>
3759 </sect3>
3760
3761 <!--   ~~~~~       New section      ~~~~~     -->
3762 <sect3 renderas="sect4" id="limit-connect">
3763 <title><emphasis>+limit-connect</emphasis></title>
3764
3765 <variablelist>
3766  <varlistentry>
3767   <term>Type:</term>
3768   <!-- Boolean, Parameterized, Multi-value -->
3769   <listitem>
3770    <para>Parameterized.</para>
3771   </listitem>
3772  </varlistentry>
3773
3774  <varlistentry>
3775   <term>Typical uses:</term>
3776   <listitem>
3777    <para>
3778     By default, <application>Privoxy</application> only allows HTTP CONNECT
3779     requests to port 443 (the standard, secure HTTPS port). Use 
3780     <quote>+limit-connect</quote> to disable this altogether, or to allow 
3781     more ports.
3782    </para>
3783   </listitem>
3784  </varlistentry>
3785
3786  <varlistentry>
3787   <term>Possible values:</term>
3788   <listitem>
3789    <para>
3790     Any valid port number, or port number range.
3791    </para>
3792   </listitem>
3793  </varlistentry>
3794  
3795  <varlistentry>
3796   <term>Example usages:</term>
3797   <listitem>
3798    <!-- I had trouble getting the spacing to look right in my browser -->
3799    <!-- I probably have the wrong font setup, bollocks. -->
3800    <!-- Apparently the emphasis tag uses a proportional font no matter what -->
3801     <literallayout>
3802      <emphasis>+limit-connect{443}</emphasis>                       # This is the default and need not be specified.
3803      <emphasis>+limit-connect{80,443}</emphasis>                  # Ports 80 and 443 are OK.
3804      <emphasis>+limit-connect{-3, 7, 20-100, 500-}</emphasis>   # Port less than 3, 7, 20 to 100 and above 500 are OK.
3805     </literallayout>
3806   </listitem>
3807  </varlistentry>
3808
3809  <varlistentry>
3810   <term>Notes:</term>
3811   <listitem>
3812    <para>
3813     The CONNECT methods exists in HTTP to allow access to secure websites
3814     (https:// URLs) through proxies. It works very simply: the proxy connects
3815     to the server on the specified port, and then short-circuits its
3816     connections to the client <emphasis>and</emphasis> to the remote proxy.
3817     This can be a big security hole, since CONNECT-enabled proxies can be
3818     abused as TCP relays very easily.
3819   </para>
3820   <para> 
3821    If you want to allow CONNECT for more ports than this, or want to forbid
3822    CONNECT altogether, you can specify a comma separated list of ports and
3823    port ranges (the latter using dashes, with the minimum defaulting to 0 and
3824    max to 65K).
3825   </para>
3826   <para>
3827    If you don't know what any of this means, there probably is no reason to 
3828    change this one.
3829   </para>
3830   </listitem>
3831  </varlistentry>
3832
3833 </variablelist>
3834 </sect3>
3835
3836 <!--   ~~~~~       New section      ~~~~~     -->
3837 <sect3 renderas="sect4" id="prevent-compression">
3838 <title><emphasis>+prevent-compression</emphasis></title>
3839
3840 <variablelist>
3841  <varlistentry>
3842   <term>Type:</term>
3843   <!-- Boolean, Parameterized, Multi-value -->
3844   <listitem>
3845    <para>Boolean.</para>
3846   </listitem>
3847  </varlistentry>
3848
3849  <varlistentry>
3850   <term>Typical uses:</term>
3851   <listitem>
3852    <para>
3853     Prevent the specified websites from compressing HTTP data.
3854    </para>
3855   </listitem>
3856  </varlistentry>
3857
3858  <varlistentry>
3859   <term>Possible values:</term>
3860   <listitem>
3861    <para>
3862     N/A
3863    </para>
3864   </listitem>
3865  </varlistentry>
3866  
3867  <varlistentry>
3868   <term>Example usage:</term>
3869   <listitem>
3870     <literallayout>
3871      <emphasis>{+prevent-compression}</emphasis>
3872      <emphasis>.example.com</emphasis>
3873     </literallayout>
3874   </listitem>
3875  </varlistentry>
3876
3877  <varlistentry>
3878   <term>Notes:</term>
3879   <listitem>
3880    <para>
3881     Some websites do this, which can be a problem for
3882     <application>Privoxy</application>, since 
3883     <ulink url="actions-file.html#FILTER"><quote>+filter</quote></ulink>,
3884     <ulink url="actions-file.html#KILL-POPUPS"><quote>+kill-popups</quote></ulink>
3885     and <ulink
3886     url="actions-file.html#GIF-DEANIMATE"><quote>+gif-deanimate</quote></ulink>
3887     will not work on compressed data. This will slow down connections to those
3888     websites, though. Default typically is to turn
3889     <quote>prevent-compression</quote> on.
3890    </para>
3891   </listitem>
3892  </varlistentry>
3893
3894 </variablelist>
3895 </sect3>
3896
3897 <!--   ~~~~~       New section      ~~~~~     -->
3898 <sect3 renderas="sect4" id="session-cookies-only">
3899 <title><emphasis>+session-cookies-only</emphasis></title>
3900
3901 <variablelist>
3902  <varlistentry>
3903   <term>Type:</term>
3904   <!-- Boolean, Parameterized, Multi-value -->
3905   <listitem>
3906    <para>Boolean.</para>
3907   </listitem>
3908  </varlistentry>
3909
3910  <varlistentry>
3911   <term>Typical uses:</term>
3912   <listitem>
3913    <para>
3914     Allow cookies for the current browser session <emphasis>only</emphasis>.
3915    </para>
3916   </listitem>
3917  </varlistentry>
3918
3919  <varlistentry>
3920   <term>Possible values:</term>
3921   <listitem>
3922    <para>
3923     N/A
3924    </para>
3925   </listitem>
3926  </varlistentry>
3927  
3928  <varlistentry>
3929   <term>Example usage (disabling):</term>
3930   <listitem>
3931     <literallayout>
3932      <emphasis>{-session-cookies-only}</emphasis>
3933      <emphasis>.example.com</emphasis>
3934     </literallayout>
3935   </listitem>
3936  </varlistentry>
3937
3938  <varlistentry>
3939   <term>Notes:</term>
3940   <listitem>
3941    <para>
3942     If websites set cookies, <quote>+session-cookies-only</quote> will make sure
3943     they are erased when you exit and restart your web browser. This makes
3944     profiling cookies useless, but won't break sites which require cookies so
3945     that you can log in for transactions. This is generally turned on for all 
3946     sites, and is the recommended setting.
3947    </para>
3948    <para>
3949     <quote>+prevent-*-cookies</quote> actions should be turned off as well (see
3950     below), for <quote>+session-cookies-only</quote> to work. Or, else no cookies 
3951     will get through at all. For, <quote>persistent</quote> cookies that survive 
3952     across browser sessions, see below as well.
3953    </para>
3954   </listitem>
3955  </varlistentry>
3956
3957 </variablelist>
3958 </sect3>
3959
3960
3961 <!--   ~~~~~       New section      ~~~~~     -->
3962 <sect3 renderas="sect4" id="prevent-reading-cookies">
3963 <title><emphasis>+prevent-reading-cookies</emphasis></title>
3964
3965 <variablelist>
3966  <varlistentry>
3967   <term>Type:</term>
3968   <!-- Boolean, Parameterized, Multi-value -->
3969   <listitem>
3970    <para>Boolean.</para>
3971   </listitem>
3972  </varlistentry>
3973
3974  <varlistentry>
3975   <term>Typical uses:</term>
3976   <listitem>
3977    <para>
3978     Explicitly prevent the web server from reading any cookies on your 
3979     system.
3980    </para>
3981   </listitem>
3982  </varlistentry>
3983
3984  <varlistentry>
3985   <term>Possible values:</term>
3986   <listitem>
3987    <para>
3988     N/A
3989    </para>
3990   </listitem>
3991  </varlistentry>
3992  
3993  <varlistentry>
3994   <term>Example usage:</term>
3995   <listitem>
3996     <literallayout>
3997      <emphasis>{+prevent-reading-cookies}</emphasis>
3998      <emphasis>.example.com</emphasis>
3999     </literallayout>
4000   </listitem>
4001  </varlistentry>
4002
4003  <varlistentry>
4004   <term>Notes:</term>
4005   <listitem>
4006    <para>
4007     Often used in conjunction with <quote>+prevent-setting-cookies</quote> to 
4008     disable cookies completely. Note that 
4009     <ulink url="actions-file.html#SESSION-COOKIES-ONLY"><quote>+session-cookies-only</quote></ulink>
4010     requires these to both be disabled (or else it never gets any cookies to cache).
4011    </para>
4012    <para>
4013     For <quote>persistent</quote> cookies to work (i.e. they survive across browser 
4014     sessions and reboots), all three cookie settings should be <quote>off</quote> 
4015     for the specified sites.
4016    </para>
4017   </listitem>
4018  </varlistentry>
4019
4020 </variablelist>
4021 </sect3>
4022
4023
4024 <!--   ~~~~~       New section      ~~~~~     -->
4025 <sect3 renderas="sect4" id="prevent-setting-cookies">
4026 <title><emphasis>+prevent-setting-cookies</emphasis></title>
4027
4028 <variablelist>
4029  <varlistentry>
4030   <term>Type:</term>
4031   <!-- Boolean, Parameterized, Multi-value -->
4032   <listitem>
4033    <para>Boolean.</para>
4034   </listitem>
4035  </varlistentry>
4036
4037  <varlistentry>
4038   <term>Typical uses:</term>
4039   <listitem>
4040    <para>
4041     Explicitly block the web server from storing cookies on your 
4042     system.
4043    </para>
4044   </listitem>
4045  </varlistentry>
4046
4047  <varlistentry>
4048   <term>Possible values:</term>
4049   <listitem>
4050    <para>
4051     N/A
4052    </para>
4053   </listitem>
4054  </varlistentry>
4055  
4056  <varlistentry>
4057   <term>Example usage:</term>
4058   <listitem>
4059     <literallayout>
4060      <emphasis>{+prevent-setting-cookies}</emphasis>
4061      <emphasis>.example.com</emphasis>
4062     </literallayout>
4063   </listitem>
4064  </varlistentry>
4065
4066  <varlistentry>
4067   <term>Notes:</term>
4068   <listitem>
4069    <para>
4070     Often used in conjunction with <quote>+prevent-reading-cookies</quote> to 
4071     disable cookies completely (see above).
4072    </para>
4073   </listitem>
4074  </varlistentry>
4075
4076 </variablelist>
4077 </sect3>
4078
4079
4080 <!--   ~~~~~       New section      ~~~~~     -->
4081 <sect3 renderas="sect4" id="kill-popup">
4082 <title><emphasis>+kill-popups<anchor id="kill-popups"></emphasis></title>
4083 <variablelist>
4084  <varlistentry>
4085   <term>Type:</term>
4086   <!-- Boolean, Parameterized, Multi-value -->
4087   <listitem>
4088    <para>Boolean.</para>
4089   </listitem>
4090  </varlistentry>
4091
4092  <varlistentry>
4093   <term>Typical uses:</term>
4094   <listitem>
4095    <para>
4096     Stop those annoying JavaScript pop-up windows! 
4097    </para>
4098   </listitem>
4099  </varlistentry>
4100
4101  <varlistentry>
4102   <term>Possible values:</term>
4103   <listitem>
4104    <para>
4105     N/A
4106    </para>
4107   </listitem>
4108  </varlistentry>
4109  
4110  <varlistentry>
4111   <term>Example usage:</term>
4112   <listitem>
4113     <literallayout>
4114      <emphasis>{+kill-popups}</emphasis>
4115      <emphasis>.example.com</emphasis>
4116     </literallayout>
4117   </listitem>
4118  </varlistentry>
4119
4120  <varlistentry>
4121   <term>Notes:</term>
4122   <listitem>
4123    <para>
4124     <quote>+kill-popups</quote> uses a built in filter to disable pop-ups
4125     that use the <literal>window.open()</literal> function, etc. This is 
4126     one of the first actions processed by <application>Privoxy</application>
4127     as it contacts the remote web server. This action is not always 100% reliable, 
4128     and is supplemented by <quote>+filter{<emphasis>popups</emphasis>}</quote>.
4129     </para>
4130   <!-- 
4131    <para>
4132     An alternate spelling is <quote>+kill-popup</quote>, which is 
4133     interchangeable.
4134    </para>
4135  --> 
4136   </listitem>
4137  </varlistentry>
4138
4139 </variablelist>
4140 </sect3>
4141
4142
4143 <!--   ~~~~~       New section      ~~~~~     -->
4144 <sect3 renderas="sect4" id="send-vanilla-wafer">
4145 <title><emphasis>+send-vanilla-wafer</emphasis></title>
4146
4147 <variablelist>
4148  <varlistentry>
4149   <term>Type:</term>
4150   <!-- Boolean, Parameterized, Multi-value -->
4151   <listitem>
4152    <para>Boolean.</para>
4153   </listitem>
4154  </varlistentry>
4155
4156  <varlistentry>
4157   <term>Typical uses:</term>
4158   <listitem>
4159    <para>
4160     Sends a cookie for every site stating that you do not accept any copyright
4161     on cookies sent to you, and asking them not to track you.
4162    </para>
4163   </listitem>
4164  </varlistentry>
4165
4166  <varlistentry>
4167   <term>Possible values:</term>
4168   <listitem>
4169    <para>
4170     N/A
4171    </para>
4172   </listitem>
4173  </varlistentry>
4174  
4175  <varlistentry>
4176   <term>Example usage:</term>
4177   <listitem>
4178     <literallayout>
4179      <emphasis>{+send-vanilla-wafer}</emphasis>
4180      <emphasis>.example.com</emphasis>
4181     </literallayout>
4182   </listitem>
4183  </varlistentry>
4184
4185  <varlistentry>
4186   <term>Notes:</term>
4187   <listitem>
4188    <para>
4189     This action only applies if you are using a <filename>jarfile</filename>
4190     for saving cookies. Of course, this is a (relatively) unique header and 
4191     could conceivably be used to track you.
4192    </para>
4193   </listitem>
4194  </varlistentry>
4195
4196 </variablelist>
4197 </sect3>
4198
4199
4200 <!--   ~~~~~       New section      ~~~~~     -->
4201 <sect3 renderas="sect4" id="send-wafer">
4202 <title><emphasis>+send-wafer</emphasis></title>
4203
4204 <variablelist>
4205  <varlistentry>
4206   <term>Type:</term>
4207   <!-- Boolean, Parameterized, Multi-value -->
4208   <listitem>
4209    <para>Multi-value.</para>
4210   </listitem>
4211  </varlistentry>
4212
4213  <varlistentry>
4214   <term>Typical uses:</term>
4215   <listitem>
4216    <para>
4217     This allows you to send an arbitrary, user definable cookie.
4218    </para>
4219   </listitem>
4220  </varlistentry>
4221
4222  <varlistentry>
4223   <term>Possible values:</term>
4224   <listitem>
4225    <para>
4226     User specified cookie name and corresponding value.
4227    </para>
4228   </listitem>
4229  </varlistentry>
4230  
4231  <varlistentry>
4232   <term>Example usage:</term>
4233   <listitem>
4234     <literallayout>
4235      <emphasis>{+send-wafer{name=value}}</emphasis>
4236      <emphasis>.example.com</emphasis>
4237     </literallayout>
4238   </listitem>
4239  </varlistentry>
4240
4241  <varlistentry>
4242   <term>Notes:</term>
4243   <listitem>
4244    <para>
4245     This can be specified multiple times in order to add as many cookies as you
4246     like.
4247    </para>
4248   </listitem>
4249  </varlistentry>
4250
4251 </variablelist>
4252 </sect3>
4253
4254
4255 <!--   ~~~~~       New section      ~~~~~     -->
4256 <sect3>
4257 <title>Summary</title>
4258 <para>
4259  Note that many of these actions have the potential to cause a page to
4260  misbehave, possibly even not to display at all. There are many ways 
4261  a site designer may choose to design his site, and what HTTP header 
4262  content, and other criteria, he may depend on. There is no way to have hard
4263  and fast rules for all sites. See the <link
4264  linkend="ACTIONSANAT">Appendix</link> for a brief example on troubleshooting
4265  actions.
4266 </para>
4267 </sect3>
4268
4269
4270 <!--   ~~~~~       New section      ~~~~~     -->
4271 <sect3 renderas="sect2" id="act-examples">
4272 <title>Sample Actions Files</title>
4273 <para>
4274  Remember that the meaning of any of the above references is reversed by preceding
4275  the action with a <quote>-</quote>, in place of the <quote>+</quote>. Also, 
4276  that some actions are turned on in the default section of the actions file, 
4277  and require little to no additional configuration. These are just <quote>on</quote>.
4278 </para>
4279
4280 <para>
4281  But, other actions that are turned on in the default section <emphasis>do
4282  typically require</emphasis> exceptions to be listed in the latter sections of 
4283  one of our actions file. For instance, by default no URLs are
4284  <quote>blocked</quote> (i.e. in the default definitions of
4285  <filename>default.action</filename>). We need exceptions to this in order to
4286  <emphasis>enable</emphasis> ad blocking in the lower sections. But we need to
4287  be very selective about what we do block. Thus, the default is <quote>off</quote>
4288  for blocking.
4289 </para>
4290
4291 <para>
4292  Below is a liberally commented sample <filename>default.action</filename> file
4293  to demonstrate how all the pieces come together. And to show how exceptions
4294  to the default policies can be handled. This is followed by a brief 
4295  <filename>user.action</filename> with similar examples.
4296 </para>
4297
4298 <para>
4299  <literal>
4300   <msgtext> 
4301    <literallayout>
4302 # Sample default.action file &lt;developers@privoxy.org&gt;
4303
4304 # Settings -- Don't change! For internal Privoxy use ONLY.
4305 {{settings}}
4306 for-privoxy-version=3.0
4307
4308
4309 ##########################################################################
4310 # <ulink url="actions-file.html#ALIASES">Aliases</ulink> must be defined *before* they are used. These are
4311 # easier to remember, and can combine several actions into one. Once 
4312 # defined they can be used just like any built-in action -- but within 
4313 # this file only! Aliases do not require a + or - sign.
4314 ##########################################################################
4315
4316 # Some useful aliases.
4317 # Alias to turn off cookie handling, ie allow all cookies unmolested.
4318  -prevent-cookies = -prevent-setting-cookies -prevent-reading-cookies \
4319                     -session-cookies-only
4320
4321 # Alias to both block and treat as if an image for ad blocking
4322 # purposes.
4323  +imageblock      = +block +handle-as-image
4324
4325 # Fragile sites should have the minimum changes:
4326  fragile     = -block -deanimate-gifs -fast-redirects -filter -hide-referer \
4327                -prevent-cookies -kill-popups
4328
4329 # Shops should be allowed to set persistent cookies
4330  shop        = -filter -prevent-cookies -session-cookies-only
4331
4332
4333 ##########################################################################
4334 # Begin default action settings. Anything in this section will match 
4335 # all URLs -- UNLESS we have exceptions that also match, defined below this 
4336 # section. We will show all potential actions here whether they are on 
4337 # or off. We could omit any disabled action if we wanted, since all 
4338 # actions are 'off' by default anyway. Shown for completeness only.
4339 # Actions are enabled if preceded by a '+', otherwise they are disabled 
4340 # (unless an alias has been defined without this).
4341 ##########################################################################
4342  { \
4343  <ulink url="actions-file.html#ADD-HEADER">-add-header</ulink> \
4344  <ulink url="actions-file.html#BLOCK">-block</ulink> \
4345  <ulink url="actions-file.html#DEANIMATE-GIFS">-deanimate-gifs</ulink> \
4346  <ulink url="actions-file.html#DOWNGRADE-HTTP-VERSION">-downgrade-http-version</ulink> \
4347  <ulink url="actions-file.html#FAST-REDIRECTS">+fast-redirects</ulink> \
4348  <ulink url="actions-file.html#FILTER-HTML-ANNOYANCES">+filter{html-annoyances}</ulink> \
4349  <ulink url="actions-file.html#FILTER-JS-ANNOYANCES">+filter{js-annoyances}</ulink> \
4350  <ulink url="actions-file.html#FILTER-CONTENT-COOKIES">-filter{content-cookies}</ulink> \
4351  <ulink url="actions-file.html#FILTER-POPUPS">-filter{popups}</ulink> \
4352  <ulink url="actions-file.html#FILTER-WEBBUGS">+filter{webbugs}</ulink> \
4353  <ulink url="actions-file.html#FILTER-REFRESH-TAGS">-filter{refresh-tags}</ulink> \
4354  <ulink url="actions-file.html#FILTER-FUN">-filter{fun}</ulink> \
4355  <ulink url="actions-file.html#FILTER-NIMDA">+filter{nimda}</ulink> \
4356  <ulink url="actions-file.html#FILTER-BANNERS-BY-SIZE">+filter{banners-by-size}</ulink> \
4357  <ulink url="actions-file.html#FILTER-SHOCKWAVE-FLASH">-filter{shockwave-flash}</ulink> \
4358  <ulink url="actions-file.html#FILTER-CRUDE-PARENTAL">-filter{crude-prental}</ulink> \
4359  <ulink url="actions-file.html#HIDE-FORWARDED-FOR-HEADERS">+hide-forwarded-for-headers</ulink> \
4360  <ulink url="actions-file.html#HIDE-FROM-HEADER">+hide-from-header{block}</ulink> \
4361  <ulink url="actions-file.html#HIDE-REFERER">-hide-referrer</ulink> \
4362  <ulink url="actions-file.html#HIDE-USER-AGENT">-hide-user-agent</ulink> \
4363  <ulink url="actions-file.html#HANDLE-AS-IMAGE">-handle-as-image</ulink> \
4364  <ulink url="actions-file.html#SET-IMAGE-BLOCKER">+set-image-blocker{pattern}</ulink> \
4365  <ulink url="actions-file.html#LIMIT-CONNECT">-limit-connect</ulink> \
4366  <ulink url="actions-file.html#PREVENT-COMPRESSION">+prevent-compression</ulink> \
4367  <ulink url="actions-file.html#SESSION-COOKIES-ONLY">-session-cookies-only</ulink> \
4368  <ulink url="actions-file.html#PREVENT-READING-COOKIES">-prevent-reading-cookies</ulink> \
4369  <ulink url="actions-file.html#PREVENT-SETTING-COOKIES">-prevent-setting-cookies</ulink> \
4370  <ulink url="actions-file.html#KILL-POPUPS">-kill-popups</ulink> \
4371  <ulink url="actions-file.html#SEND-VANILLA-WAFER">-send-vanilla-wafer</ulink> \
4372  <ulink url="actions-file.html#SEND-WAFER">-send-wafer</ulink> \
4373  }
4374  / # forward slash will match *all* potential URL patterns. 
4375
4376 ##########################################################################
4377 # Default behavior is now set. Now we will define some exceptions to our 
4378 # default action policies.
4379 ##########################################################################
4380
4381 # These sites are very complex and require very minimal interference.
4382 # We'll disable most actions with our 'fragile' alias:
4383  { fragile }
4384  .office.microsoft.com           # surprise, surprise!
4385  .windowsupdate.microsoft.com
4386
4387
4388 # Shopping sites - not as fragile but require some special 
4389 # handling. We still want to block ads, and we will allow 
4390 # persistant cookies via the 'shop' alias:
4391  { shop }
4392  .quietpc.com 
4393  .worldpay.com   # for quietpc.com
4394  .jungle.com
4395  .scan.co.uk
4396
4397
4398 # These sites require pop-ups too :(  We'll combine our 'shop' 
4399 # alias with two other actions into one rule to allow all popups.
4400  { shop <ulink url="actions-file.html#KILL-POPUPS">-kill-popups</ulink> <ulink url="actions-file.html#FILTER-POPUPS">-filter{popups}</ulink> }
4401  .dabs.com
4402  .overclockers.co.uk
4403
4404
4405 # The 'Fast-redirects' action breaks some sites. Disable this action
4406 # for these known sensitive sites:
4407  { <ulink url="actions-file.html#FAST-REDIRECTS">-fast-redirects</ulink> }
4408  login.yahoo.com
4409  edit.europe.yahoo.com
4410  .google.com
4411  .altavista.com/.*(like|url|link):http
4412  .altavista.com/trans.*urltext=http
4413  .nytimes.com
4414
4415
4416 # Define which file types will be treated as images. Important
4417 # for ad blocking.
4418  { <ulink url="actions-file.html#HANDLE-AS-IMAGE">+handle-as-image</ulink> }
4419  /.*\.(gif|jpe?g|png|bmp|ico)
4420
4421
4422 # Now lets list some domains that are known ad generators. And
4423 # our alias that we use here will block these as well as force 
4424 # them to be treated as images. This combination of actions is 
4425 # important for ad blocking. What the browser will show instead is 
4426 # determined by the setting of <ulink url="actions-file.html#SET-IMAGE-BLOCKER"><quote>+set-image-blocker</quote></ulink>
4427  { +imageblock }
4428  ar.atwola.com 
4429  .ad.doubleclick.net
4430  .a.yimg.com/(?:(?!/i/).)*$
4431  .a[0-9].yimg.com/(?:(?!/i/).)*$
4432  bs*.gsanet.com
4433  bs*.einets.com
4434  .qkimg.net
4435  ad.*.doubleclick.net
4436
4437
4438 # These will just simply be blocked. They will generate the BLOCKED
4439 # banner page, if matched. Heavy use of wildcards and regular 
4440 # expressions in this example. Enable block action:
4441  { <ulink url="actions-file.html#BLOCK">+block</ulink> }
4442  ad*.
4443  .*ads.
4444  banner?.
4445  count*.
4446  /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
4447  /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
4448  .hitbox.com 
4449
4450
4451 # The above block section will probably inadvertantly catch some 
4452 # sites we DO NOT want blocked via the wildcards and regular expressions. 
4453 # Now let's set exceptions to the exceptions so the good guys get better 
4454 # treatment. Disable block action:
4455  { <ulink url="actions-file.html#BLOCK">-block</ulink> }
4456  advogato.org
4457  adsl.
4458  ad[ud]*.
4459  advice.
4460 # Let's just trust all .edu top level domains.
4461  .edu
4462  www.ugu.com/sui/ugu/adv
4463 # We'll need to access to path names containing 'download' 
4464  .*downloads.
4465  /downloads/
4466 # 'adv' is for globalintersec and means advanced, not advertisement
4467  www.globalintersec.com/adv
4468
4469
4470 # Don't filter *anything* from our friends at sourceforge.
4471 # Notice we don't have to name the individual filter 
4472 # identifiers -- we just turn them all off in one fell swoop.
4473 # Disable all filters for this one site:
4474  { <ulink url="actions-file.html#FILTER">-filter</ulink> }
4475  .sourceforge.net
4476    </literallayout>
4477   </msgtext> 
4478  </literal>
4479 </para>
4480
4481 <para>
4482  So far we are painting with a broad brush by setting general policies. 
4483  The above would be a reasonable starting point for many situations. Now, 
4484  we want to be more specific and have customized rules that are more suitable
4485  to our personal habits and preferences. These would be for narrowly defined 
4486  situations like your ISP or your bank, and should be placed in 
4487  <filename>user.action</filename>, which is parsed after all other 
4488  actions files and should not be clobbered by upgrades. So any settings here,
4489  will have the last word and over-ride any previously defined actions.
4490 </para>
4491
4492 <para>
4493  Now a few examples of some things that one might do with a
4494  <filename>user.action</filename> file. 
4495 </para>
4496
4497 <!-- brief sample user.action here -->
4498
4499 <para>
4500  <literal>
4501   <msgtext> 
4502    <literallayout>
4503 # Sample user.action file.
4504
4505 # Any aliases you want to use need to be re-defined here.
4506 # Alias to turn off cookie handling, ie allow all cookies unmolested.
4507  -prevent-cookies = -prevent-setting-cookies -prevent-reading-cookies \
4508                     -session-cookies-only
4509
4510 # Fragile sites should have the minimum changes:
4511  fragile     = -block -deanimate-gifs -fast-redirects -filter -hide-referer \
4512                -prevent-cookies -kill-popups
4513
4514 # Allow persistent cookies for a few regular sites that we 
4515 # trust via our above alias. These will be saved from one browser session 
4516 # to the next. We are explicity turning off any and all cookie handling, 
4517 # even though the prevent-*-cookie settings were disabled in our above 
4518 # default.action anyway. So cookies from these domains will come through 
4519 # unmolested.
4520  { -prevent-cookies }
4521  .sun.com
4522  .yahoo.com
4523  .msdn.microsoft.com
4524  .redhat.com
4525
4526
4527 # My ISP uses obnoxious self promoting images on many pages.
4528 # Nuke them :) Note that <ulink url="actions-file.html#HANDLE-AS-IMAGE"><quote>+handle-as-image</quote></ulink> need not be specified,
4529 # since all URLs ending in .gif will be tagged as images by the
4530 # general rules in default.action anyway.
4531  { <ulink url="actions-file.html#BLOCK">+block</ulink> }
4532  www.my-isp-example.com/logo[0-9].gif
4533
4534 # Say the site where you do your homebanking needs to open
4535 # popup windows, but you have chosen to kill popups by
4536 # default. This will allow it for your-example-bank.com:
4537 #
4538  { <ulink url="actions-file.html#FILTER-POPUPS">-filter{popups}</ulink> <ulink url="actions-file.html#KILL-POPUPS">-kill-popups</ulink> }
4539  .my-example-bank.com
4540
4541 # This site is delicate, and requires kid-glove 
4542 # treatment.
4543  { fragile }
4544  .forbes.com
4545    </literallayout>
4546   </msgtext> 
4547  </literal>
4548 </para>
4549
4550 </sect3>
4551 </sect2>
4552
4553 <!--  ~  End section  ~  -->
4554
4555
4556 <!--   ~~~~~       New section      ~~~~~     -->
4557 <sect2 id="aliases">
4558 <title>Aliases</title>
4559 <para>
4560  Custom <quote>actions</quote>, known to <application>Privoxy</application>
4561  as <quote>aliases</quote>, can be defined by combining other <quote>actions</quote>.
4562  These can in turn be invoked just like the built-in <quote>actions</quote>.
4563  Currently, an alias can contain any character except space, tab, <quote>=</quote>,
4564  <quote>{</quote> or <quote>}</quote>. But please use only <quote>a</quote>-
4565  <quote>z</quote>, <quote>0</quote>-<quote>9</quote>, <quote>+</quote>, and
4566  <quote>-</quote>. Alias names are not case sensitive, and 
4567  <emphasis>must be defined before other actions</emphasis> in the
4568  actions file! And there can only be one set of <quote>aliases</quote>
4569  defined per file. Each actions file may have its own aliases, but they are 
4570  only visible within that file. Aliases do not requir a <quote>+</quote> or 
4571  <quote>-</quote> sign in front, since they are merely expanded.
4572 </para>
4573
4574 <para>
4575  Now let's define a few aliases:
4576 </para>
4577
4578 <para>
4579  <literal>
4580   <msgtext> 
4581    <literallayout>
4582  # Useful custom aliases we can use later. These must come first!
4583  {{alias}}
4584  +prevent-cookies = +prevent-setting-cookies +prevent-reading-cookies
4585  -prevent-cookies = -prevent-setting-cookies -prevent-reading-cookies
4586  fragile     = -block -prevent-cookies -filter -fast-redirects -hide-referer -kill-popups
4587  shop        = -prevent-cookies -filter -fast-redirects
4588  +imageblock = +block +handle-as-image
4589
4590  # Aliases defined from other aliases, for people who don't like to type 
4591  # too much:  ;-)
4592  c0 = +prevent-cookies
4593  c1 = -prevent-cookies
4594  #... etc.  Customize to your heart's content.
4595    </literallayout>
4596   </msgtext> 
4597  </literal>
4598 </para>
4599
4600 <para>
4601  Some examples using our <quote>shop</quote> and <quote>fragile</quote>
4602  aliases from above. These would appear in the lower sections of an 
4603  actions file as exceptions to the default actions (as defined in the 
4604  upper section):
4605 </para>
4606
4607 <para>
4608  <literal>
4609   <msgtext> 
4610    <literallayout>
4611  # These sites are very complex and require
4612  # minimal interference.
4613  {fragile}
4614   .office.microsoft.com
4615   .windowsupdate.microsoft.com
4616   .nytimes.com
4617
4618  # Shopping sites - but we still want to block ads.
4619  {shop}
4620   .quietpc.com
4621   .worldpay.com   # for quietpc.com
4622   .scan.co.uk
4623
4624  # These shops require pop-ups also 
4625  {shop -kill-popups}
4626   .dabs.com
4627   .overclockers.co.uk
4628    </literallayout>
4629   </msgtext> 
4630  </literal>
4631 </para>
4632
4633 <para>
4634  The <quote>shop</quote> and <quote>fragile</quote> aliases are often used for 
4635  <quote>problem</quote> sites that require most actions to be disabled 
4636  in order to function properly.
4637
4638 </para>
4639
4640 </sect2>
4641 </sect1>
4642
4643 <!--  ~  End section  ~  -->
4644
4645
4646
4647 <!--   ~~~~~~~~       New section Header    ~~~~~~~~~     -->
4648
4649 <sect1 id="filter-file">
4650 <title>The Filter File</title>
4651 <para>
4652  Any web page can be dynamically modified with the filter file. This
4653  modification can be removal, or re-writing, of any web page content,
4654  including tags and non-visible content. The default filter file is
4655  oddly enough <filename>default.filter</filename>, located in the config
4656  directory. 
4657 </para>
4658
4659 <para>
4660  This is potentially a very powerful feature, and requires knowledge of both 
4661  <quote>regular expression</quote> and HTML in order create custom 
4662  filters. But, there are a number of useful filters included with 
4663  <application>Privoxy</application> for many common situations.
4664 </para>
4665
4666 <para>
4667  The included example file is divided into sections. Each section begins 
4668  with the <literal>FILTER</literal> keyword, followed by the identifier 
4669  for that section, e.g. <quote>FILTER: webbugs</quote>. Each section performs
4670  a similar type of filtering, such as <quote>html-annoyances</quote>.
4671 </para>
4672
4673 <para>
4674  This file uses regular expressions to alter or remove any string in the
4675  target page. The expressions can only operate on one line at a time. Some
4676  examples from the included default <filename>default.filter</filename>:
4677 </para>
4678
4679 <para>
4680  Stop web pages from displaying annoying messages in the status bar by
4681  deleting such references:
4682 </para>
4683
4684 <para>
4685  <literal>
4686   <msgtext> 
4687    <literallayout>
4688  FILTER: html-annoyances
4689
4690  # New browser windows should be resizeable and have a location and status
4691  # bar. Make it so.
4692  #
4693  s/resizable="?(no|0)"?/resizable=1/ig s/noresize/yesresize/ig
4694  s/location="?(no|0)"?/location=1/ig s/status="?(no|0)"?/status=1/ig
4695  s/scrolling="?(no|0|Auto)"?/scrolling=1/ig
4696  s/menubar="?(no|0)"?/menubar=1/ig 
4697
4698  # The &lt;BLINK&gt; tag was a crime!
4699  #
4700  s*&lt;blink&gt;|&lt;/blink&gt;**ig
4701
4702  # Is this evil? 
4703  #
4704  #s/framespacing="?(no|0)"?//ig
4705  #s/margin(height|width)=[0-9]*//gi
4706    </literallayout>
4707   </msgtext> 
4708  </literal>
4709 </para>
4710
4711 <para>
4712  Just for kicks, replace any occurrence of <quote>Microsoft</quote> with
4713  <quote>MicroSuck</quote>, and have a little fun with topical buzzwords: 
4714 </para>
4715
4716 <para>
4717  <literal>
4718   <msgtext> 
4719    <literallayout>
4720  FILTER: fun
4721
4722  s/microsoft(?!.com)/MicroSuck/ig
4723
4724  # Buzzword Bingo:
4725  #
4726  s/industry-leading|cutting-edge|award-winning/&lt;font color=red&gt;&lt;b&gt;BINGO!&lt;/b&gt;&lt;/font&gt;/ig
4727    </literallayout>
4728   </msgtext> 
4729  </literal>
4730 </para>
4731
4732 <para>
4733  Kill those pesky little web-bugs:
4734 </para>
4735
4736 <para>
4737  <literal>
4738   <msgtext> 
4739    <literallayout>
4740  # webbugs: Squish WebBugs (1x1 invisible GIFs used for user tracking)
4741  FILTER: webbugs
4742
4743  s/&lt;img\s+[^&gt;]*?(width|height)\s*=\s*['"]?1\D[^&gt;]*?(width|height)\s*=\s*['"]?1(\D[^&gt;]*?)?>/&lt;!-- Squished WebBug --&gt;/sig
4744    </literallayout>
4745   </msgtext> 
4746  </literal>
4747 </para>
4748
4749
4750 <!--   ~~~~~       New section      ~~~~~     -->
4751 <sect2>
4752 <title>The <emphasis>+filter</emphasis> Action</title>
4753 <para>
4754  Filters are enabled with the <ulink
4755  url="actions-file.html#FILTER"><quote>+filter</quote></ulink> action from within 
4756  one of the actions files. <quote>+filter</quote> requires one parameter, which 
4757  should match one of the section identifiers in the filter file itself. Example:
4758 </para>
4759
4760 <screen>
4761   +filter{html-annoyances}
4762 </screen>
4763
4764 <para>
4765  This would activate that particular filter. Similarly, <quote>+filter</quote>
4766  can be turned off for selected sites as:
4767  <quote>-filter{html-annoyances}</quote>. Remember too, all actions are off by
4768  default, unless they are explicity enabled in one of the actions files.
4769 </para>
4770
4771 </sect2>
4772
4773 </sect1>
4774
4775 <!--  ~  End section  ~  -->
4776
4777
4778
4779 <!--   ~~~~~       New section      ~~~~~     -->
4780
4781 <sect1 id="templates">
4782 <title>Templates</title>
4783 <para>
4784  When <application>Privoxy</application> displays one of its internal 
4785  pages, such as a <ulink url="http://bogus_404_page.com">404 Not Found error page</ulink>
4786  (<application>Privoxy</application> must be running for link to work as
4787  intended), it uses the appropriate template. On Linux, BSD, and Unix, these
4788  are located in <filename>/etc/privoxy/templates</filename> by default. These
4789  may be customized, if desired. <filename>cgi-style.css</filename> is used to
4790  control the HTML attributes (fonts, etc).
4791 </para>
4792 <para>
4793  The default 
4794 <ulink url="http://ads.bannerserver.example.com/nasty-ads/sponsor.html">Blocked 
4795 (<application>Privoxy</application> needs to be running for page to display)</ulink>
4796  banner page with the bright red top 
4797  banner, is called just <quote><filename>blocked</filename></quote>. This 
4798  may be customized or replaced with something else if desired.
4799
4800 </para>
4801 </sect1>
4802
4803 <!--  ~  End section  ~  -->
4804
4805
4806
4807 <!--   ~~~~~       New section      ~~~~~     -->
4808
4809 <sect1 id="contact"><title>Contacting the Developers, Bug Reporting and Feature
4810 Requests</title>
4811
4812 <!-- Include contacting.sgml boilerplate: -->
4813  &contacting;
4814 <!-- end boilerplate -->
4815
4816 </sect1>
4817
4818
4819 <!--   ~~~~~       New section      ~~~~~     -->
4820 <sect1 id="copyright"><title>Copyright and History</title>
4821
4822 <sect2><title>Copyright</title>
4823 <!-- Include copyright.sgml: -->
4824  &copyright;
4825 <!-- end copyright -->
4826 </sect2>
4827
4828 <!--  ~  End section  ~  -->
4829
4830
4831 <!--   ~~~~~       New section      ~~~~~     -->
4832
4833 <sect2 id="history"><title>History</title>
4834 <!-- Include history.sgml: -->
4835  &history;
4836 <!-- end history -->
4837 </sect2>
4838 </sect1>
4839
4840 <!--   ~~~~~       New section      ~~~~~     -->
4841 <sect1 id="seealso"><title>See Also</title>
4842 <!-- Include seealso.sgml: -->
4843  &seealso;
4844 <!-- end seealso -->
4845 </sect1>
4846
4847
4848
4849 <!--   ~~~~~       New section      ~~~~~     -->
4850 <sect1 id="appendix"><title>Appendix</title>
4851
4852
4853 <!--   ~~~~~       New section      ~~~~~     -->
4854 <sect2 id="regex">
4855 <title>Regular Expressions</title>
4856 <para>
4857  <application>Privoxy</application> can use <quote>regular expressions</quote> 
4858  in various config files. Assuming support for <quote>pcre</quote> (Perl
4859  Compatible Regular Expressions) is compiled in, which is the default. Such
4860  configuration directives do not require regular expressions, but they can be
4861  used to increase flexibility by matching a pattern with wild-cards against
4862  URLs.
4863 </para>
4864
4865 <para>
4866  If you are reading this, you probably don't understand what <quote>regular
4867  expressions</quote> are, or what they can do. So this will be a very brief
4868  introduction only. A full explanation would require a book ;-)
4869 </para>
4870
4871 <para>
4872  <quote>Regular expressions</quote> is a way of matching one character
4873  expression against another to see if it matches or not. One of the
4874  <quote>expressions</quote> is a literal string of readable characters
4875  (letter, numbers, etc), and the other is a complex string of literal
4876  characters combined with wild-cards, and other special characters, called
4877  meta-characters. The <quote>meta-characters</quote> have special meanings and
4878  are used to build the complex pattern to be matched against. Perl Compatible
4879  Regular Expressions is an enhanced form of the regular expression language
4880  with backward compatibility.
4881 </para>
4882
4883 <para>
4884  To make a simple analogy, we do something similar when we use wild-card
4885  characters when listing files with the <command>dir</command> command in DOS. 
4886  <literal>*.*</literal> matches all filenames. The <quote>special</quote>
4887  character here is the asterisk which matches any and all characters. We can be
4888  more specific and use <literal>?</literal> to match just individual
4889  characters. So <quote>dir file?.text</quote> would match
4890  <quote>file1.txt</quote>, <quote>file2.txt</quote>, etc. We are pattern
4891  matching, using a similar technique to <quote>regular expressions</quote>!
4892 </para>
4893
4894 <para>
4895  Regular expressions do essentially the same thing, but are much, much more
4896  powerful. There are many more <quote>special characters</quote> and ways of 
4897  building complex patterns however. Let's look at a few of the common ones,
4898  and then some examples:
4899 </para>
4900
4901 <para><simplelist>
4902  <member>
4903   <emphasis>.</emphasis> - Matches any single character, e.g. <quote>a</quote>,
4904   <quote>A</quote>, <quote>4</quote>, <quote>:</quote>, or <quote>@</quote>.
4905  </member>
4906 </simplelist></para>
4907
4908 <para><simplelist>
4909  <member>
4910   <emphasis>?</emphasis> - The preceding character or expression is matched ZERO or ONE
4911   times. Either/or.
4912  </member>
4913 </simplelist></para>
4914
4915 <para><simplelist>
4916  <member>
4917   <emphasis>+</emphasis> - The preceding character or expression is matched ONE or MORE
4918   times.
4919  </member>
4920 </simplelist></para>
4921
4922 <para><simplelist>
4923  <member>
4924   <emphasis>*</emphasis> - The preceding character or expression is matched ZERO or MORE
4925   times.
4926  </member>
4927 </simplelist></para>
4928
4929 <para><simplelist>
4930  <member>
4931   <emphasis>\</emphasis> - The <quote>escape</quote> character denotes that
4932   the following character should be taken literally. This is used where one of the 
4933   special characters (e.g. <quote>.</quote>) needs to be taken literally and
4934   not as a special meta-character. Example: <quote>example\.com</quote>, makes 
4935   sure the period is recognized only as a period (and not expanded to its 
4936   meta-character meaning of any single character).
4937  </member>
4938 </simplelist></para>
4939
4940 <para><simplelist>
4941  <member>
4942   <emphasis>[]</emphasis> - Characters enclosed in brackets will be matched if
4943   any of the enclosed characters are encountered. For instance, <quote>[0-9]</quote>
4944   matches any numeric digit (zero through nine). As an example, we can combine 
4945   this with <quote>+</quote> to match any digit one of more times: <quote>[0-9]+</quote>.
4946  </member>
4947 </simplelist></para>
4948
4949 <para><simplelist>
4950  <member>
4951   <emphasis>()</emphasis> - parentheses are used to group a sub-expression,
4952   or multiple sub-expressions.
4953  </member>
4954 </simplelist></para>
4955
4956 <para><simplelist>
4957  <member>
4958   <emphasis>|</emphasis> - The <quote>bar</quote> character works like an
4959   <quote>or</quote> conditional statement. A match is successful if the
4960   sub-expression on either side of <quote>|</quote> matches. As an example:
4961   <quote>/(this|that) example/</quote> uses grouping and the bar character 
4962   and would match either <quote>this example</quote> or <quote>that
4963   example</quote>, and nothing else.
4964  </member>
4965 </simplelist></para>
4966
4967 <para><simplelist>
4968  <member>
4969   <emphasis>s/string1/string2/g</emphasis> - This is used to rewrite strings of text. 
4970   <quote>string1</quote> is replaced by <quote>string2</quote> in this
4971   example. There must of course be a match on <quote>string1</quote> first.
4972  </member>
4973 </simplelist></para>
4974
4975 <para>
4976  These are just some of the ones you are likely to use when matching URLs with 
4977  <application>Privoxy</application>, and is a long way from a definitive
4978  list. This is enough to get us started with a few simple examples which may
4979  be more illuminating:
4980 </para>
4981
4982 <para>
4983  <emphasis><literal>/.*/banners/.*</literal></emphasis> - A  simple example
4984  that uses the common combination of <quote>.</quote> and <quote>*</quote> to 
4985  denote any character, zero or more times. In other words, any string at all.
4986  So we start with a literal forward slash, then our regular expression pattern 
4987  (<quote>.*</quote>) another literal forward slash, the string
4988  <quote>banners</quote>, another forward slash, and lastly another
4989  <quote>.*</quote>. We are building 
4990  a directory path here. This will match any file with the path that has a
4991  directory named <quote>banners</quote> in it. The <quote>.*</quote> matches
4992  any characters, and this could conceivably be more forward slashes, so it
4993  might expand into a much longer looking path. For example, this could match:
4994  <quote>/eye/hate/spammers/banners/annoy_me_please.gif</quote>, or just
4995  <quote>/banners/annoying.html</quote>, or almost an infinite number of other
4996  possible combinations, just so it has <quote>banners</quote> in the path
4997  somewhere.
4998 </para>
4999
5000 <para>
5001  A now something a little more complex:
5002 </para>
5003
5004 <para>
5005  <emphasis><literal>/.*/adv((er)?ts?|ertis(ing|ements?))?/</literal></emphasis> - 
5006  We have several literal forward slashes again (<quote>/</quote>), so we are
5007  building another expression that is a file path statement. We have another 
5008  <quote>.*</quote>, so we are matching against any conceivable sub-path, just so
5009  it matches our expression. The only true literal that <emphasis>must
5010  match</emphasis> our pattern is <application>adv</application>, together with
5011  the forward slashes. What comes after the <quote>adv</quote> string is the
5012  interesting part. 
5013 </para>
5014
5015 <para>
5016  Remember the <quote>?</quote> means the preceding expression (either a
5017  literal character or anything grouped with <quote>(...)</quote> in this case)
5018  can exist or not, since this means either zero or one match. So
5019  <quote>((er)?ts?|ertis(ing|ements?))</quote> is optional, as are the
5020  individual sub-expressions: <quote>(er)</quote>,
5021  <quote>(ing|ements?)</quote>, and the <quote>s</quote>. The <quote>|</quote>
5022  means <quote>or</quote>. We have two of those. For instance, 
5023  <quote>(ing|ements?)</quote>, can expand to match either <quote>ing</quote> 
5024  <emphasis>OR</emphasis> <quote>ements?</quote>. What is being done here, is an
5025  attempt at matching as many variations of <quote>advertisement</quote>, and 
5026  similar, as possible. So this would expand to match just <quote>adv</quote>,
5027  or <quote>advert</quote>, or <quote>adverts</quote>, or
5028  <quote>advertising</quote>, or <quote>advertisement</quote>, or
5029  <quote>advertisements</quote>. You get the idea. But it would not match 
5030  <quote>advertizements</quote> (with a <quote>z</quote>). We could fix that by
5031  changing our regular expression to: 
5032  <quote>/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/</quote>, which would then match
5033  either spelling.
5034 </para>
5035
5036 <para>
5037  <emphasis><literal>/.*/advert[0-9]+\.(gif|jpe?g)</literal></emphasis> - Again 
5038  another path statement with forward slashes. Anything in the square brackets 
5039  <quote>[]</quote> can be matched. This is using <quote>0-9</quote> as a
5040  shorthand expression to mean any digit one through nine. It is the same as
5041  saying <quote>0123456789</quote>. So any digit matches. The <quote>+</quote>
5042  means one or more of the preceding expression must be included. The preceding 
5043  expression here is what is in the square brackets -- in this case, any digit 
5044  one through nine. Then, at the end, we have a grouping: <quote>(gif|jpe?g)</quote>. 
5045  This includes a <quote>|</quote>, so this needs to match the expression on
5046  either side of that bar character also. A simple <quote>gif</quote> on one side, and the other
5047  side will in turn match either <quote>jpeg</quote> or <quote>jpg</quote>,
5048  since the <quote>?</quote> means the letter <quote>e</quote> is optional and
5049  can be matched once or not at all. So we are building an expression here to
5050  match image GIF or JPEG type image file. It must include the literal
5051  string <quote>advert</quote>, then one or more digits, and a <quote>.</quote>
5052  (which is now a literal, and not a special character, since it is escaped
5053  with <quote>\</quote>), and lastly either <quote>gif</quote>, or
5054  <quote>jpeg</quote>, or <quote>jpg</quote>. Some possible matches would
5055  include: <quote>//advert1.jpg</quote>,
5056  <quote>/nasty/ads/advert1234.gif</quote>,
5057  <quote>/banners/from/hell/advert99.jpg</quote>. It would not match
5058  <quote>advert1.gif</quote> (no leading slash), or
5059  <quote>/adverts232.jpg</quote> (the expression does not include an
5060  <quote>s</quote>), or <quote>/advert1.jsp</quote> (<quote>jsp</quote> is not
5061  in the expression anywhere).
5062 </para>
5063
5064 <para>
5065  <emphasis><literal>s/microsoft(?!.com)/MicroSuck/i</literal></emphasis> - This is 
5066  a substitution. <quote>MicroSuck</quote> will replace any occurrence of 
5067  <quote>microsoft</quote>.  The <quote>i</quote> at the end of the expression
5068  means ignore case. The <quote>(?!.com)</quote> means 
5069  the match should fail if <quote>microsoft</quote> is followed by
5070  <quote>.com</quote>. In other words, this acts like a <quote>NOT</quote>
5071  modifier. In case this is a hyperlink, we don't want to break it ;-).
5072 </para>
5073
5074 <para>
5075  We are barely scratching the surface of regular expressions here so that you
5076  can understand the default <application>Privoxy</application>
5077  configuration files, and maybe use this knowledge to customize your own
5078  installation. There is much, much more that can be done with regular
5079  expressions. Now that you know enough to get started, you can learn more on
5080  your own :/
5081 </para>
5082
5083 <para>
5084  More reading on Perl Compatible Regular expressions: 
5085  <ulink url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>
5086 </para>
5087
5088 </sect2>
5089
5090 <!--  ~  End section  ~  -->
5091
5092
5093 <!--   ~~~~~       New section      ~~~~~     -->
5094 <sect2>
5095 <title><application>Privoxy</application>'s Internal Pages</title>
5096
5097 <para>
5098  Since <application>Privoxy</application> proxies each requested 
5099  web page, it is easy for <application>Privoxy</application> to 
5100  trap certain special URLs. In this way, we can talk directly to
5101  <application>Privoxy</application>, and see how it is 
5102  configured, see how our rules are being applied, change these 
5103  rules and other configuration options, and even turn
5104  <application>Privoxy's</application> filtering off, all with 
5105  a web browser.
5106
5107 </para>
5108
5109 <para>
5110  The URLs listed below are the special ones that allow direct access 
5111  to <application>Privoxy</application>. Of course,
5112  <application>Privoxy</application> must be running to access these. If 
5113  not, you will get a friendly error message. Internet access is not 
5114  necessary either.
5115 </para>
5116
5117 <para>
5118  <itemizedlist>
5119
5120  <listitem>
5121   <para>  
5122    Privoxy main page: 
5123   </para>
5124   <blockquote>
5125    <para> 
5126      <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
5127    </para>
5128   </blockquote>
5129   <para>
5130    Alternately, this may be reached at <ulink
5131    url="http://p.p/">http://p.p/</ulink>, but this
5132    variation may not work as reliably as the above in some configurations.
5133   </para>
5134  </listitem>
5135
5136  <listitem>
5137   <para>  
5138     Show information about the current configuration, including viewing and 
5139     editing of actions files:
5140   </para>
5141    <blockquote>
5142    <para> 
5143     <ulink url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>
5144    </para>
5145   </blockquote>
5146  </listitem>
5147  
5148  <listitem>
5149   <para>  
5150     Show the source code version numbers:
5151   </para>
5152   <blockquote>
5153    <para> 
5154     <ulink url="http://config.privoxy.org/show-version">http://config.privoxy.org/show-version</ulink>
5155    </para>
5156   </blockquote>
5157  </listitem>
5158  
5159  <listitem>
5160   <para>  
5161    Show the browser's request headers:
5162   </para>
5163   <blockquote>
5164    <para> 
5165     <ulink url="http://config.privoxy.org/show-request">http://config.privoxy.org/show-request</ulink>
5166    </para>
5167   </blockquote>
5168  </listitem>
5169  
5170  <listitem>
5171   <para>  
5172    Show which actions apply to a URL and why:
5173   </para>
5174    <blockquote>
5175    <para> 
5176     <ulink url="http://config.privoxy.org/show-url-info">http://config.privoxy.org/show-url-info</ulink>
5177    </para>
5178   </blockquote>
5179  </listitem>
5180  
5181  <listitem>
5182   <para>  
5183    Toggle Privoxy on or off. In this case, <quote>Privoxy</quote> continues 
5184    to run, but only as a pass-through proxy, with no actions taking place:
5185   </para>
5186    <blockquote>
5187    <para> 
5188     <ulink url="http://config.privoxy.org/toggle">http://config.privoxy.org/toggle</ulink>
5189    </para>
5190   </blockquote>
5191   <para>
5192    Short cuts. Turn off, then on: 
5193   </para>
5194    <blockquote>
5195    <para> 
5196      <ulink url="http://config.privoxy.org/toggle?set=disable">http://config.privoxy.org/toggle?set=disable</ulink>
5197    </para>
5198   </blockquote>
5199    <blockquote>
5200    <para> 
5201      <ulink url="http://config.privoxy.org/toggle?set=enable">http://config.privoxy.org/toggle?set=enable</ulink>
5202    </para>
5203   </blockquote>
5204  </listitem>
5205  
5206  </itemizedlist>
5207 </para>
5208
5209 <para>
5210  These may be bookmarked for quick reference. See next.
5211
5212 </para>
5213
5214 <sect3 id="bookmarklets">
5215 <title>Bookmarklets</title>
5216 <para>
5217  Below are some <quote>bookmarklets</quote> to allow you to easily access a
5218  <quote>mini</quote> version of some of <application>Privoxy's</application>
5219  special pages. They are designed for MS Internet Explorer, but should work
5220  equally well in Netscape, Mozilla, and other browsers which support
5221  JavaScript. They are designed to run directly from your bookmarks - not by
5222  clicking the links below (although that should work for testing).
5223 </para>
5224 <para>
5225  To save them, right-click the link and choose <quote>Add to Favorites</quote>
5226  (IE) or <quote>Add Bookmark</quote> (Netscape). You will get a warning that
5227  the bookmark <quote>may not be safe</quote> - just click OK. Then you can run the
5228  Bookmarklet directly from your favorites/bookmarks. For even faster access,
5229  you can put them on the <quote>Links</quote> bar (IE) or the <quote>Personal
5230  Toolbar</quote> (Netscape), and run them with a single click. 
5231 </para>
5232
5233 <para>
5234  <itemizedlist>
5235
5236   <listitem>
5237    <para>
5238     <ulink
5239     url="javascript:void(window.open('http://config.privoxy.org/toggle?mini=y&#38;set=enabled','ijbstatus','width=250,height=100,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no').focus());">Privoxy - Enable</ulink>
5240    </para>
5241   </listitem> 
5242
5243   <listitem>
5244    <para>
5245     <ulink
5246     url="javascript:void(window.open('http://config.privoxy.org/toggle?mini=y&#38;set=disabled','ijbstatus','width=250,height=100,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no').focus());">Privoxy - Disable</ulink>
5247    </para>
5248   </listitem> 
5249
5250   <listitem>
5251    <para>
5252     <ulink
5253     url="javascript:void(window.open('http://config.privoxy.org/toggle?mini=y&#38;set=toggle','ijbstatus','width=250,height=100,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no').focus());">Privoxy - Toggle Privoxy</ulink> (Toggles between enabled and disabled)
5254    </para>
5255   </listitem> 
5256
5257   <listitem>
5258    <para>
5259     <ulink
5260     url="javascript:void(window.open('http://config.privoxy.org/toggle?mini=y','ijbstatus','width=250,height=2,resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no').focus());">Privoxy- View Status</ulink>
5261    </para>
5262   </listitem> 
5263
5264   <listitem>
5265    <para>
5266     <ulink url="javascript:w=Math.floor(screen.width/2);h=Math.floor(screen.height*0.9);void(window.open('http://www.privoxy.org/actions','Feedback','screenx='+w+',width='+w+',height='+h+',scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no').focus());">Privoxy - Submit Filter Feedback</ulink>
5267    </para>
5268   </listitem> 
5269
5270  </itemizedlist>
5271 </para>
5272
5273
5274
5275 <para>
5276  Credit: The site which gave me the general idea for these bookmarklets is
5277  <ulink url="http://www.bookmarklets.com">www.bookmarklets.com</ulink>. They
5278  have more information about bookmarklets. 
5279 </para>
5280
5281
5282 </sect3>
5283
5284 </sect2>
5285
5286
5287 <!--   ~~~~~       New section      ~~~~~     -->
5288 <sect2 id="chain">
5289 <title>Chain of Events</title>
5290 <para>
5291  Let's take a quick look at the basic sequence of events when a web page is 
5292  requested by your browser and <application>Privoxy</application> is on duty:
5293 </para>
5294
5295 <para>
5296  <itemizedlist>
5297  <listitem>
5298   <para>
5299    First, your web browser requests a web page. The browser knows to send 
5300    the request to <application>Privoxy</application>, which will in turn, 
5301    relay the request to the remote web server after passing the following 
5302    tests: 
5303   </para>
5304  </listitem> 
5305  <listitem>
5306   <para>
5307    <application>Privoxy</application> traps any request for its own internal CGI 
5308    pages (e.g http://p.p/) and sends the CGI page back to the browser.
5309   </para>
5310  </listitem> 
5311  <listitem>
5312   <para>
5313    Next, <application>Privoxy</application> checks to see if the URL 
5314    matches any <ulink
5315    url="actions-file.html#BLOCK"><quote>+block</quote></ulink> patterns. If
5316    so, the URL is then blocked, and the remote web server will not be contacted.
5317    <ulink url="actions-file.html#HANDLE-AS-IMAGE"><quote>+handle-as-image</quote></ulink> 
5318    is then checked and if it does not match, an 
5319    HTML <quote>BLOCKED</quote> page is sent back. Otherwise, if it does match,
5320    an image is returned. The type of image depends on the setting of <ulink
5321    url="actions-file.html#SET-IMAGE-BLOCKER"><quote>+set-image-blocker</quote></ulink>
5322    (blank, checkerboard pattern, or an HTTP redirect to an image elsewhere).
5323   </para>
5324  </listitem> 
5325  <listitem>
5326   <para>
5327    Untrusted URLs are blocked. If URLs are being added to the
5328    <filename>trust</filename> file, then that is done.
5329   </para>
5330  </listitem> 
5331  <listitem>
5332   <para>
5333    If the URL pattern matches the <ulink
5334    url="actions-file.html#FAST-REDIRECTS"><quote>+fast-redirects</quote></ulink> action,
5335    it is then processed. Unwanted parts of the requested URL are stripped.
5336   </para>
5337  </listitem> 
5338  <listitem>
5339   <para>
5340    Now the rest of the client browser's request headers are processed. If any
5341    of these match any of the relevant actions (e.g. <ulink
5342    url="actions-file.html#HIDE-USER-AGENT"><quote>+hide-user-agent</quote></ulink>,
5343    etc.), headers are suppressed or forged as determined by these actions and
5344    their parameters.
5345   </para>
5346  </listitem> 
5347  <listitem>
5348   <para>
5349    Now the web server starts sending its response back (i.e. typically a web page and related 
5350    data).
5351   </para>
5352  </listitem> 
5353  <listitem>
5354   <para>
5355    First, the server headers are read and processed to determine, among other
5356    things, the MIME type (document type) and encoding. The headers are then
5357    filtered as deterimed by the 
5358    <ulink url="actions-file.html#PREVENT-SETTING-COOKIES"><quote>+prevent-setting-cookies</quote></ulink>,
5359    <ulink url="actions-file.html#SESSION-COOKIES-ONLY"><quote>+session-cookies-only</quote></ulink>,
5360    and <ulink url="actions-file.html#DOWNGRADE-HTTP-VERSION"><quote>+downgrade-http-version</quote></ulink>
5361    actions.
5362   </para>
5363  </listitem> 
5364  <listitem>
5365   <para>
5366    If the <ulink url="actions-file.html#KILL-POPUPS"><quote>+kill-popups</quote></ulink>
5367    action applies, and it is an HTML or JavaScript document, the popup-code in the
5368    response is filtered on-the-fly as it is received.
5369   </para>
5370  </listitem> 
5371  <listitem>
5372   <para>
5373    If a <ulink url="actions-file.html#FILTER"><quote>+filter</quote></ulink>
5374    or <ulink
5375    url="actions-file.html#DEANIMATE-GIFS"><quote>+deanimate-gifs</quote></ulink>
5376    action applies (and the document type fits the action), the rest of the page is
5377    read into memory (up to a configurable limit). Then the filter rules (from
5378    <filename>default.filter</filename>) are processed against the buffered
5379    content. Filters are applied in the order they are specified in the
5380    <filename>default.filter</filename> file. Animated GIFs, if present, are
5381    reduced to either the first or last frame, depending on the action
5382    setting.The entire page, which is now filtered, is then sent by
5383    <application>Privoxy</application> back to your browser. 
5384   </para>
5385   <para>
5386    If neither <ulink url="actions-file.html#FILTER"><quote>+filter</quote></ulink>
5387    or <ulink
5388    url="actions-file.html#DEANIMATE-GIFS"><quote>+deanimate-gifs</quote></ulink>
5389    matches, then <application>Privoxy</application> passes the raw data through 
5390    to the client browser as it becomes available.
5391   </para>
5392  </listitem> 
5393  <listitem>
5394   <para>
5395    As the browser receives the now (probably filtered) page content, it 
5396    reads and then requests any URLs that may be embedded within the page
5397    source, e.g. ad images, stylesheets, JavaScript, other HTML documents (e.g.
5398    frames), sounds, etc. For each of these objects, the browser issues a new
5399    request. And each such request is in turn processed as above. Note that a
5400    complex web page may have many such embedded URLs.
5401   </para>
5402  </listitem> 
5403  
5404  </itemizedlist>
5405 </para>
5406
5407 </sect2>
5408
5409
5410 <!--   ~~~~~       New section      ~~~~~     -->
5411 <sect2 id="actionsanat">
5412 <title>Anatomy of an Action</title>
5413
5414 <para>
5415  The way <application>Privoxy</application> applies 
5416  <ulink url="actions-file.html#ACTIONS"><quote>actions</quote></ulink>
5417  and <ulink url="actions-file.html#FILTER"><quote>filters</quote></ulink>
5418  to any given URL can be complex, and not always so
5419  easy to understand what is happening. And sometimes we need to be able to
5420  <emphasis>see</emphasis> just what <application>Privoxy</application> is
5421  doing. Especially, if something <application>Privoxy</application> is doing
5422  is causing us a problem inadvertently. It can be a little daunting to look at
5423  the actions and filters files themselves, since they tend to be filled with
5424  <quote>regular expressions</quote> whose consequences are not always 
5425  so obvious. 
5426 </para>
5427
5428 <para>
5429  One quick test to see if <application>Privoxy</application> is causing a problem 
5430  or not, is to disable it temporarily. This should be the first troubleshooting 
5431  step. See <link linkend="bookmarklets">the Bookmarklets</link> section on a quick 
5432  and easy way to do this (be sure to flush caches afterward!).
5433 </para>
5434
5435 <para>
5436  <application>Privoxy</application> also provides the 
5437  <ulink url="http://config.privoxy.org/show-url-info">http://config.privoxy.org/show-url-info</ulink>
5438  page that can show us very specifically how <application>actions</application>
5439  are being applied to any given URL. This is a big help for troubleshooting.
5440 </para>
5441
5442 <para>
5443  First, enter one URL (or partial URL) at the prompt, and then
5444  <application>Privoxy</application> will tell us 
5445  how the current configuration will handle it. This will not
5446  help with filtering effects (i.e. the <ulink
5447  url="actions-file.html#FILTER"><quote>+filter</quote></ulink> action) from
5448  the <filename>default.filter</filename> file since this is handled very
5449  differently and not so easy to trap! It also will not tell you about any other
5450  URLs that may be embedded within the URL you are testing. For instance, images
5451  such as ads are expressed as URLs within the raw page source of HTML pages. So
5452  you will only get info for the actual URL that is pasted into the prompt area
5453  -- not any sub-URLs. If you want to know about embedded URLs like ads, you
5454  will have to dig those out of the HTML source. Use your browser's <quote>View
5455  Page Source</quote> option for this. Or right click on the ad, and grab the
5456  URL.
5457 </para>
5458
5459 <para>
5460  Let's try an example, <ulink url="http://google.com">google.com</ulink>, 
5461  and look at it one section at a time:
5462 </para>
5463
5464 <para>
5465  <screen>
5466  Matches for http://google.com:
5467
5468 --- File standard ---
5469 (no matches in this file)
5470
5471 --- File default ---
5472
5473 { -add-header -block +deanimate-gifs{last} -downgrade-http-version +fast-redirects 
5474  -filter{popups} -filter{fun} -filter{shockwave-flash} -filter{crude-parental} 
5475  +filter{html-annoyances} +filter{js-annoyances} +filter{content-cookies} 
5476  +filter{webbugs} +filter{refresh-tags} +filter{nimda} +filter{banners-by-size} 
5477  +hide-forwarded-for-headers +hide-from-header{block} +hide-referer{forge} 
5478  -hide-user-agent -handle-as-image +set-image-blocker{pattern} -limit-connect 
5479  +prevent-compression +session-cookies-only -prevent-reading-cookies 
5480  -prevent-setting-cookies -kill-popups -send-vanilla-wafer -send-wafer }
5481 /
5482
5483  { -session-cookies-only }
5484  .google.com
5485
5486  { -fast-redirects }
5487  .google.com
5488
5489 --- File user ---
5490 (no matches in this file)  
5491 </screen>
5492 </para>
5493
5494 <para>
5495  This tells us how we have defined our 
5496  <ulink url="actions-file.html#ACTIONS"><quote>actions</quote></ulink>, and
5497  which ones match for our example, <quote>google.com</quote>. The first listing
5498  is any matches for the <filename>standard.action</filename> file. No hits at
5499  all here on <quote>standard</quote>. Then next is <quote>default</quote>, or
5500  our <filename>default.action</filename> file. The large, multi-line listing,
5501  is how the actions are set to match for all URLs, i.e. our default settings.
5502  If you look at your <quote>actions</quote> file, this would be the section
5503  just below the <quote>aliases</quote> section near the top. This will apply to
5504  all URLs as signified by the single forward slash at the end of the listing
5505  -- <quote>/</quote>.
5506 </para>
5507
5508 <para>
5509  But we can define additional actions that would be exceptions to these general
5510  rules, and then list specific URLs (or patterns) that these exceptions would
5511  apply to. Last match wins. Just below this then are two explicit matches for
5512  <quote>.google.com</quote>. The first is negating our previous cookie setting, 
5513  which was for <ulink
5514  url="actions-file.html#SESSION-COOKIES-ONLY"><quote>+session-cookies-only</quote></ulink>
5515  (i.e. not persistent). So we will allow persistent cookies for google. The
5516  second turns <emphasis>off</emphasis> any 
5517  <ulink
5518  url="actions-file.html#FAST-REDIRECTS"><quote>+fast-redirects</quote></ulink>
5519  action, allowing this to take place unmolested. Note that there is a leading
5520  dot here -- <quote>.google.com</quote>. This will match any hosts and
5521  sub-domains, in the google.com domain also, such as
5522  <quote>www.google.com</quote>. So, apparently, we have these two actions
5523  defined somewhere in the lower part of our <filename>default.action</filename>
5524  file, and <quote>google.com</quote> is referenced somewhere in these latter
5525  sections.
5526 </para>
5527
5528 <para>
5529  Then, for our <filename>user.action</filename> file, we again have no hits.
5530 </para>
5531
5532 <para>
5533  And finally we pull it all together in the bottom section and summarize how
5534  <application>Privoxy</application> is applying all its <quote>actions</quote> 
5535  to <quote>google.com</quote>:
5536
5537 </para>
5538
5539 <para>
5540  <screen>
5541
5542  Final results:
5543  -add-header -block +deanimate-gifs{last} -downgrade-http-version -fast-redirects 
5544  -filter{popups} -filter{fun} -filter{shockwave-flash} -filter{crude-parental} 
5545  +filter{html-annoyances} +filter{js-annoyances} +filter{content-cookies} 
5546  +filter{webbugs} +filter{refresh-tags} +filter{nimda} +filter{banners-by-size} 
5547  +hide-forwarded-for-headers +hide-from-header{block} +hide-referer{forge} 
5548  -hide-user-agent -handle-as-image +set-image-blocker{pattern} -limit-connect 
5549  +prevent-compression -session-cookies-only -prevent-reading-cookies 
5550  -prevent-setting-cookies -kill-popups -send-vanilla-wafer -send-wafer
5551 </screen>
5552 </para>
5553
5554 <para>
5555  Notice the only difference here to the previous listing, is to 
5556  <quote>fast-redirects</quote> and <quote>session-cookies-only</quote>.
5557 </para>
5558
5559 <para>
5560  Now another example, <quote>ad.doubleclick.net</quote>:
5561 </para>
5562
5563 <para>
5564  <screen>
5565
5566  { +block +handle-as-image }
5567   .ad.doubleclick.net
5568
5569  { +block +handle-as-image }
5570   ad*.
5571
5572  { +block +handle-as-image }
5573   .doubleclick.net
5574 </screen>
5575 </para>
5576
5577 <para>
5578  We'll just show the interesting part here, the explicit matches. It is 
5579  matched three different times. Each as an <quote>+block +handle-as-image</quote>,
5580  which is the expanded form of one of our aliases that had been defined as: 
5581  <quote>+imageblock</quote>. (<ulink
5582  url="actions-file.html#ALIASES"><quote>Aliases</quote></ulink> are defined in
5583  the first section of the actions file and typically used to combine more 
5584  than one action.)
5585 </para>
5586
5587 <para>
5588  Any one of these would have done the trick and blocked this as an unwanted 
5589  image. This is unnecessarily redundant since the last case effectively 
5590  would also cover the first. No point in taking chances with these guys 
5591  though ;-) Note that if you want an ad or obnoxious 
5592  URL to be invisible, it should be defined as <quote>ad.doubleclick.net</quote>
5593  is done here -- as both a <ulink
5594  url="actions-file.html#BLOCK"><quote>+block</quote></ulink>
5595  <emphasis>and</emphasis> an 
5596  <ulink
5597  url="actions-file.html#HANDLE-AS-IMAGE"><quote>+handle-as-image</quote></ulink>.
5598  The custom alias <quote>+imageblock</quote> just simplifies the process and make 
5599  it more readable.
5600 </para>
5601
5602 <para>
5603  One last example. Let's try <quote>http://www.rhapsodyk.net/adsl/HOWTO/</quote>.
5604  This one is giving us problems. We are getting a blank page. Hmmm...
5605 </para>
5606
5607 <para>
5608  <screen>
5609
5610  Matches for http://www.rhapsodyk.net/adsl/HOWTO/:
5611
5612  { -add-header -block +deanimate-gifs -downgrade-http-version +fast-redirects 
5613    +filter{html-annoyances} +filter{js-annoyances} +filter{kill-popups} 
5614    +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal} 
5615    +filter{fun} +hide-forwarded-for-headers +hide-from-header{block} 
5616    +hide-referer{forge} -hide-user-agent -handle-as-image +set-image-blocker{blank} 
5617    +prevent-compression +session-cookies-only -prevent-setting-cookies 
5618    -prevent-reading-cookies +kill-popups -send-vanilla-wafer -send-wafer }
5619    /
5620
5621  { +block +handle-as-image }
5622   /ads
5623 </screen>
5624 </para>
5625
5626 <para>
5627  Ooops, the <quote>/adsl/</quote> is matching <quote>/ads</quote>! But 
5628  we did not want this at all! Now we see why we get the blank page. We could
5629  now add a new action below this that explicitly does <emphasis>not</emphasis>
5630  block (<quote>{-block}</quote>) paths with <quote>adsl</quote>. There are
5631  various ways to handle such exceptions. Example:
5632 </para>
5633
5634 <para>
5635  <screen>
5636
5637  { -block }
5638   /adsl
5639 </screen>
5640 </para>
5641
5642 <para>
5643  Now the page displays ;-) Be sure to flush your browser's caches when 
5644  making such changes. Or, try using <literal>Shift+Reload</literal>.
5645 </para>
5646
5647 <para>
5648  But now what about a situation where we get no explicit matches like 
5649  we did with:
5650 </para>
5651
5652 <para>
5653  <screen>
5654
5655  { +block +handle-as-image }
5656  /ads
5657 </screen>
5658 </para>
5659
5660 <para>
5661  That actually was very telling and pointed us quickly to where the problem
5662  was. If you don't get this kind of match, then it means one of the default 
5663  rules in the first section is causing the problem. This would require some 
5664  guesswork, and maybe a little trial and error to isolate the offending rule.
5665  One likely cause would be one of the <quote>{+filter}</quote> actions. Try 
5666  adding the URL for the site to one of aliases that turn off <quote>+filter</quote>:
5667 </para>
5668
5669 <para>
5670  <screen>
5671
5672  {shop}
5673  .quietpc.com
5674  .worldpay.com   # for quietpc.com
5675  .jungle.com
5676  .scan.co.uk
5677  .forbes.com
5678 </screen>
5679 </para>
5680
5681 <para>
5682  <quote>{shop}</quote> is an <quote>alias</quote> that expands to 
5683  <quote>{ -filter -session-cookies-only }</quote>.
5684  Or you could do your own exception to negate filtering:
5685
5686 </para>
5687
5688 <para>
5689  <screen>
5690
5691  {-filter}
5692  .forbes.com
5693 </screen>
5694 </para>
5695
5696 <para>
5697  This would probably be most appropriately put in <filename>user.action</filename>, 
5698  for local site exceptions.
5699 </para>
5700
5701 <para>
5702  <quote>{fragile}</quote> is an alias that disables most actions. This can be 
5703  used as a last resort for problem sites. Remember to flush caches! If this 
5704  still does not work, you will have to go through the remaining actions one by
5705  one to find which one(s) is causing the problem.
5706 </para>
5707
5708 </sect2>
5709
5710 </sect1>
5711
5712  <!--
5713
5714  This program is free software; you can redistribute it 
5715  and/or modify it under the terms of the GNU General
5716  Public License as published by the Free Software
5717  Foundation; either version 2 of the License, or (at
5718  your option) any later version.
5719
5720  This program is distributed in the hope that it will
5721  be useful, but WITHOUT ANY WARRANTY; without even the
5722  implied warranty of MERCHANTABILITY or FITNESS FOR A
5723  PARTICULAR PURPOSE.  See the GNU General Public
5724  License for more details.
5725
5726  The GNU General Public License should be included with
5727  this file.  If not, you can view it at
5728  http://www.gnu.org/copyleft/gpl.html
5729  or write to the Free Software Foundation, Inc., 59
5730  Temple Place - Suite 330, Boston, MA  02111-1307, USA.
5731
5732  $Log: user-manual.sgml,v $
5733  Revision 1.97  2002/04/27 21:04:42  hal9
5734  -Rewrite of Actions File example.
5735  -Add section for user-manual directive in config.
5736
5737  Revision 1.96  2002/04/27 05:32:00  hal9
5738  -Add short section to Filter Files to tie in with +filter action.
5739  -Start rewrite of examples in Actions Examples (not finished).
5740
5741  Revision 1.95  2002/04/26 17:23:29  swa
5742  bookmarks cleaned, changed structure of user manual, screen and programlisting cleanups, and numerous other changes that I forgot
5743
5744  Revision 1.94  2002/04/26 05:24:36  hal9
5745  -Add most of Andreas suggestions to Chain of Events section.
5746  -A few other minor corrections and touch up.
5747
5748  Revision 1.92  2002/04/25 18:55:13  hal9
5749  More catchups on new actions files, and new actions names.
5750  Other assorted cleanups, and minor modifications.
5751
5752  Revision 1.91  2002/04/24 02:39:31  hal9
5753  Add 'Chain of Events' section.
5754
5755  Revision 1.90  2002/04/23 21:41:25  hal9
5756  Linuxconf is deprecated on RH, substitute chkconfig.
5757
5758  Revision 1.89  2002/04/23 21:05:28  oes
5759  Added hint for startup on Red Hat
5760
5761  Revision 1.88  2002/04/23 05:37:54  hal9
5762  Add AmigaOS install stuff.
5763
5764  Revision 1.87  2002/04/23 02:53:15  david__schmidt
5765  Updated OSX installation section
5766  Added a few English tweaks here an there
5767
5768  Revision 1.86  2002/04/21 01:46:32  hal9
5769  Re-write actions section.
5770
5771  Revision 1.85  2002/04/18 21:23:23  hal9
5772  Fix ugly typo (mine).
5773
5774  Revision 1.84  2002/04/18 21:17:13  hal9
5775  Spell Redhat correctly (ie Red Hat). A few minor grammar corrections.
5776
5777  Revision 1.83  2002/04/18 18:21:12  oes
5778  Added RPM install detail
5779
5780  Revision 1.82  2002/04/18 12:04:50  oes
5781  Cosmetics
5782
5783  Revision 1.81  2002/04/18 11:50:24  oes
5784  Extended Install section - needs fixing by packagers
5785
5786  Revision 1.80  2002/04/18 10:45:19  oes
5787  Moved text to buildsource.sgml, renamed some filters, details
5788
5789  Revision 1.79  2002/04/18 03:18:06  hal9
5790  Spellcheck, and minor touchups.
5791
5792  Revision 1.78  2002/04/17 18:04:16  oes
5793  Proofreading part 2
5794
5795  Revision 1.77  2002/04/17 13:51:23  oes
5796  Proofreading, part one
5797
5798  Revision 1.76  2002/04/16 04:25:51  hal9
5799  -Added 'Note to Upgraders' and re-ordered the 'Quickstart' section.
5800  -Note about proxy may need requests to re-read config files.
5801
5802  Revision 1.75  2002/04/12 02:08:48  david__schmidt
5803  Remove OS/2 building info... it is already in the developer-manual
5804
5805  Revision 1.74  2002/04/11 00:54:38  hal9
5806  Add small section on submitting actions.
5807
5808  Revision 1.73  2002/04/10 18:45:15  swa
5809  generated
5810
5811  Revision 1.72  2002/04/10 04:06:19  hal9
5812  Added actions feedback  to Bookmarklets section
5813
5814  Revision 1.71  2002/04/08 22:59:26  hal9
5815  Version update. Spell chkconfig correctly :)
5816
5817  Revision 1.70  2002/04/08 20:53:56  swa
5818  ?
5819
5820  Revision 1.69  2002/04/06 05:07:29  hal9
5821  -Add privoxy-man-page.sgml, for man page.
5822  -Add authors.sgml for AUTHORS (and p-authors.sgml)
5823  -Reworked various aspects of various docs.
5824  -Added additional comments to sub-docs.
5825
5826  Revision 1.68  2002/04/04 18:46:47  swa
5827  consistent look. reuse of copyright, history et. al.
5828
5829  Revision 1.67  2002/04/04 17:27:57  swa
5830  more single file to be included at multiple points. make maintaining easier
5831
5832  Revision 1.66  2002/04/04 06:48:37  hal9
5833  Structural changes to allow for conditional inclusion/exclusion of content
5834  based on entity toggles, e.g. 'entity % p-not-stable  "INCLUDE"'. And
5835  definition of internal entities, e.g. 'entity p-version "2.9.13"' that will
5836  eventually be set by Makefile.
5837  More boilerplate text for use across multiple docs.
5838
5839  Revision 1.65  2002/04/03 19:52:07  swa
5840  enhance squid section due to user suggestion
5841
5842  Revision 1.64  2002/04/03 03:53:43  hal9
5843  A few minor bug fixes, and touch ups. Ready for review.
5844
5845  Revision 1.63  2002/04/01 16:24:49  hal9
5846  Define entities to include boilerplate text. See doc/source/*.
5847
5848  Revision 1.62  2002/03/30 04:15:53  hal9
5849  - Fix privoxy.org/config links.
5850  - Paste in Bookmarklets from Toggle page.
5851  - Move Quickstart nearer top, and minor rework.
5852
5853  Revision 1.61  2002/03/29 01:31:08  hal9
5854  Minor update.
5855
5856  Revision 1.60  2002/03/27 01:57:34  hal9
5857  Added more to Anatomy section.
5858
5859  Revision 1.59  2002/03/27 00:54:33  hal9
5860  Touch up intro for new name.
5861
5862  Revision 1.58  2002/03/26 22:29:55  swa
5863  we have a new homepage!
5864
5865  Revision 1.57  2002/03/24 20:33:30  hal9
5866  A few minor catch ups with name change.
5867
5868  Revision 1.56  2002/03/24 16:17:06  swa
5869  configure needs to be generated.
5870
5871  Revision 1.55  2002/03/24 16:08:08  swa
5872  we are too lazy to make a block-built
5873  privoxy logo. hence removed the option.
5874
5875  Revision 1.54  2002/03/24 15:46:20  swa
5876  name change related issue.
5877
5878  Revision 1.53  2002/03/24 11:51:00  swa
5879  name change. changed filenames.
5880
5881  Revision 1.52  2002/03/24 11:01:06  swa
5882  name change
5883
5884  Revision 1.51  2002/03/23 15:13:11  swa
5885  renamed every reference to the old name with foobar.
5886  fixed "application foobar application" tag, fixed
5887  "the foobar" with "foobar". left junkbustser in cvs
5888  comments and remarks to history untouched.
5889
5890  Revision 1.50  2002/03/23 05:06:21  hal9
5891  Touch up.
5892
5893  Revision 1.49  2002/03/21 17:01:05  hal9
5894  New section in Appendix.
5895
5896  Revision 1.48  2002/03/12 06:33:01  hal9
5897  Catching up to Andreas and re_filterfile changes.
5898
5899  Revision 1.47  2002/03/11 13:13:27  swa
5900  correct feedback channels
5901
5902  Revision 1.46  2002/03/10 00:51:08  hal9
5903  Added section on JB internal pages in Appendix.
5904
5905  Revision 1.45  2002/03/09 17:43:53  swa
5906  more distros
5907
5908  Revision 1.44  2002/03/09 17:08:48  hal9
5909  New section on Jon's actions file editor, and move some stuff around.
5910
5911  Revision 1.43  2002/03/08 00:47:32  hal9
5912  Added imageblock{pattern}.
5913
5914  Revision 1.42  2002/03/07 18:16:55  swa
5915  looks better
5916
5917  Revision 1.41  2002/03/07 16:46:43  hal9
5918  Fix a few markup problems for jade.
5919
5920  Revision 1.40  2002/03/07 16:28:39  swa
5921  provide correct feedback channels
5922
5923  Revision 1.39  2002/03/06 16:19:28  hal9
5924  Note on perceived filtering slowdown per FR.
5925
5926  Revision 1.38  2002/03/05 23:55:14  hal9
5927  Stupid I did it again. Double hyphen in comment breaks jade.
5928
5929  Revision 1.37  2002/03/05 23:53:49  hal9
5930  jade barfs on '- -' embedded in comments. - -user option broke it.
5931
5932  Revision 1.36  2002/03/05 22:53:28  hal9
5933  Add new - - user option.
5934
5935  Revision 1.35  2002/03/05 00:17:27  hal9
5936  Added section on command line options.
5937
5938  Revision 1.34  2002/03/04 19:32:07  oes
5939  Changed default port to 8118
5940
5941  Revision 1.33  2002/03/03 19:46:13  hal9
5942  Emphasis on where/how to report bugs, etc
5943
5944  Revision 1.32  2002/03/03 09:26:06  joergs
5945  AmigaOS changes, config is now loaded from PROGDIR: instead of
5946  AmiTCP:db/junkbuster/ if no configuration file is specified on the
5947  command line.
5948
5949  Revision 1.31  2002/03/02 22:45:52  david__schmidt
5950  Just tweaking
5951
5952  Revision 1.30  2002/03/02 22:00:14  hal9
5953  Updated 'New Features' list. Ran through spell-checker.
5954
5955  Revision 1.29  2002/03/02 20:34:07  david__schmidt
5956  Update OS/2 build section
5957
5958  Revision 1.28  2002/02/24 14:34:24  jongfoster
5959  Formatting changes.  Now changing the doctype to DocBook XML 4.1
5960  will work - no other changes are needed.
5961
5962  Revision 1.27  2002/01/11 14:14:32  hal9
5963  Added a very short section on Templates
5964
5965  Revision 1.26  2002/01/09 20:02:50  hal9
5966  Fix bug re: auto-detect config file changes.
5967
5968  Revision 1.25  2002/01/09 18:20:30  hal9
5969  Touch ups for *.action files.
5970
5971  Revision 1.24  2001/12/02 01:13:42  hal9
5972  Fix typo.
5973
5974  Revision 1.23  2001/12/02 00:20:41  hal9
5975  Updates for recent changes.
5976
5977  Revision 1.22  2001/11/05 23:57:51  hal9
5978  Minor update for startup now daemon mode.
5979
5980  Revision 1.21  2001/10/31 21:11:03  hal9
5981  Correct 2 minor errors
5982
5983  Revision 1.18  2001/10/24 18:45:26  hal9
5984  *** empty log message ***
5985
5986  Revision 1.17  2001/10/24 17:10:55  hal9
5987  Catching up with Jon's recent work, and a few other things.
5988
5989  Revision 1.16  2001/10/21 17:19:21  swa
5990  wrong url in documentation
5991
5992  Revision 1.15  2001/10/14 23:46:24  hal9
5993  Various minor changes. Fleshed out SEE ALSO section.
5994
5995  Revision 1.13  2001/10/10 17:28:33  hal9
5996  Very minor changes.
5997
5998  Revision 1.12  2001/09/28 02:57:04  hal9
5999  Ditto :/
6000
6001  Revision 1.11  2001/09/28 02:25:20  hal9
6002  Ditto.
6003
6004  Revision 1.9  2001/09/27 23:50:29  hal9
6005  A few changes. A short section on regular expression in appendix.
6006
6007  Revision 1.8  2001/09/25 00:34:59  hal9
6008  Some additions, and re-arranging.
6009
6010  Revision 1.7  2001/09/24 14:31:36  hal9
6011  Diddling.
6012
6013  Revision 1.6  2001/09/24 14:10:32  hal9
6014  Including David's OS/2 installation instructions.
6015
6016  Revision 1.2  2001/09/13 15:27:40  swa
6017  cosmetics
6018
6019  Revision 1.1  2001/09/12 15:36:41  swa
6020  source files for junkbuster documentation
6021
6022  Revision 1.3  2001/09/10 17:43:59  swa
6023  first proposal of a structure.
6024
6025  Revision 1.2  2001/06/13 14:28:31  swa
6026  docs should have an author.
6027
6028  Revision 1.1  2001/06/13 14:20:37  swa
6029  first import of project's documentation for the webserver.
6030
6031  -->
6032
6033 </article>