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