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