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