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