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