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