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