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