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