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