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