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