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