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