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