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