80964e1a8198d44ae1ff5a6b860615906653ce9d
[privoxy.git] / doc / source / p-config.sgml
1 <!--
2  File        :  $Source: /cvsroot/ijbswa/current/doc/source/p-config.sgml,v $
3
4  Purpose     :  Used with other docs and files only.
5
6  $Id: p-config.sgml,v 2.2 2002/09/05 05:45:30 hal9 Exp $
7
8  Copyright (C) 2001, 2002 Privoxy Developers <developers@privoxy.org>
9  See LICENSE.
10
11  ========================================================================
12  NOTE: Please read developer-manual/documentation.html before touching 
13  anything in this, or other Privoxy documentation.
14  ========================================================================
15
16  
17  This file contains all the config file comments and options. It used to 
18  build both the user-manual config sections, and all of config (yes, the main
19  config file) itself.
20
21  Rationale: This is broken up into two files since a file with a prolog 
22  (DTD, etc) cannot be sourced as a secondary file. config.sgml is basically
23  a wrapper for this file.
24
25  IMPORTANT:
26
27  OPTIONS: The actual options are included in this file and prefixed with 
28  '@@', and processed by the Makefile to strip the '@@'. Default options 
29  that should appear commented out should be listed as: '@@#OPTION'. 
30  Otherwise, as '@@OPTION'. Example:
31
32   @@listen-address  127.0.0.1:8118
33
34  The Makefile does significant other processing too. The final results 
35  should be checked to make sure that the perl processing does not 
36  fubar something!!! Makefile processing requires w3m, fmt (shell line
37  formatter), and perl.
38  
39
40  This file is included into:
41
42    user-manual.sgml
43    config   (the actual Privoxy config file)
44
45 -->
46
47 <![%user-man;[
48 <!-- This part only goes into user-manual -->
49 <sect1 id="config">
50 <title>The Main Configuration File</title>
51
52 <para>
53  Again, the main configuration file is named <filename>config</filename> on
54  Linux/Unix/BSD and OS/2, and <filename>config.txt</filename> on Windows.
55  Configuration lines consist of an initial keyword followed by a list of
56  values, all separated by whitespace (any number of spaces or tabs). For
57  example:
58 </para>
59
60 <para>
61  <literal>
62   <msgtext> 
63    <literallayout>
64   <emphasis>confdir /etc/privoxy</emphasis></literallayout>
65   </msgtext>
66  </literal> 
67 </para>
68
69 <para>
70  Assigns the value <literal>/etc/privoxy</literal> to the option
71  <literal>confdir</literal> and thus indicates that the configuration
72  directory is named <quote>/etc/privoxy/</quote>.
73 </para>
74
75 <para>
76  All options in the config file except for <literal>confdir</literal> and
77  <literal>logdir</literal> are optional. Watch out in the below description
78  for what happens if you leave them unset.
79 </para>
80
81 <para>
82  The main config file controls all aspects of <application>Privoxy</application>'s
83  operation that are not location dependent (i.e. they apply universally, no matter
84  where you may be surfing).
85 </para>
86
87 ]]>
88
89
90 <![%config-file;[
91 <!-- This part only goes into the config file -->
92 <sect1 id="config">
93 <title>
94  @@TITLE<!-- between the @@ is stripped by Makefile -->@@
95  Sample Configuration File for Privoxy v&p-version;
96 </title>
97 <para>
98  $Id: p-config.sgml,v 2.2 2002/09/05 05:45:30 hal9 Exp $
99 </para>
100 <para>
101 Copyright (C) 2001, 2002 Privoxy Developers http://privoxy.org
102 </para>
103
104 <para>
105  <literallayout>
106 #################################################################
107                                                                 #
108                     Table of Contents                           #
109                                                                 #
110       I. INTRODUCTION                                           #
111      II. FORMAT OF THE CONFIGURATION FILE                       #
112                                                                 #
113       1. CONFIGURATION AND LOG FILE LOCATIONS                   #
114       2. LOCAL SET-UP DOCUMENTATION                             #
115       3. DEBUGGING                                              #
116       4. ACCESS CONTROL AND SECURITY                            #
117       5. FORWARDING                                             #
118       6. WINDOWS GUI OPTIONS                                    #
119                                                                 #
120 #################################################################
121  </literallayout>
122 </para>
123
124 <literallayout>I. INTRODUCTION
125  ===============  <!-- fuck this madness --></literallayout>
126
127 <para>
128  This file holds the Privoxy configuration.  If you modify this
129  file, you will need to send a couple of requests to the proxy
130  before any changes take effect.
131 </para>
132 <para>
133  When starting Privoxy on Unix systems, give the name of this
134  file as an argument.  On Windows systems, Privoxy will look for
135  this file with the name 'config.txt' in the same directory where
136  Privoxy is installed.
137 </para>
138
139 <para>
140  <literallayout><!-- funky spacing -->
141
142 II. FORMAT OF THE CONFIGURATION FILE
143 ====================================</literallayout>
144 </para>
145 <para>
146  Configuration lines consist of an initial keyword followed by a list
147  of values, all separated by whitespace (any number of spaces or
148  tabs).  For example,
149 </para>
150 <para>
151  actionsfile default.action
152 </para>
153 <para>
154  Indicates that the actionsfile is named 'default.action'.
155 </para>
156 <para>
157  The '#' indicates a comment.  Any part of a line following a '#' is
158  ignored, except if the '#' is preceded by a '\'.
159 </para>
160 <para>
161  Thus, by placing a # at the start of an existing configuration line,
162  you can make it a comment and it will be treated as if it weren't there. 
163  This is called "commenting out" an option and can be useful.
164 </para>
165 <para>
166  Note that commenting out and option and leaving it at its default
167  are two completely different things! Most options behave very
168  differently when unset. See the the "Effect if unset" explanation
169  in each option's description for details.
170 </para>
171 <para>
172  Long lines can be continued on the next line by using a `\' as
173  the last character.
174 </para>
175
176 ]]>
177
178 <!-- ************************************************ -->
179 <!-- The following is common to both outputs (mostly) -->
180 <!-- ************************************************ -->
181
182 <!--   ~~~~~       New section      ~~~~~     -->
183
184 <sect2 id="conf-log-loc">
185 <title>Configuration and Log File Locations</title>
186
187 <para>
188  <application>Privoxy</application> can (and normally does) use a number of
189  other files for additional configuration, help and logging.
190  This section of the configuration file tells <application>Privoxy</application>
191  where to find those other files. 
192 </para>
193
194 <para>
195  The user running <application>Privoxy</application>, must have read
196  permission for all configuration files, and write permission to any files
197  that would be modified, such as log files and actions files.
198 </para>
199
200
201 <!--   ~~~~~       New section      ~~~~~     -->
202 <sect3 renderas="sect4" id="confdir"><title>confdir</title>
203
204 <variablelist>
205  <varlistentry>
206   <term>Specifies:</term>
207   <listitem>
208    <para>The directory where the other configuration files are located</para>
209   </listitem>
210  </varlistentry>
211  <varlistentry>
212   <term>Type of value:</term>
213   <listitem>
214    <para>Path name</para>
215   </listitem>
216  </varlistentry>
217  <varlistentry>
218   <term>Default value:</term>
219   <listitem>
220    <para>/etc/privoxy (Unix) <emphasis>or</emphasis> <application>Privoxy</application> installation dir (Windows) </para>
221   </listitem>
222  </varlistentry>
223  <varlistentry>
224   <term>Effect if unset:</term>
225   <listitem>
226    <para><emphasis>Mandatory</emphasis></para>
227   </listitem>
228  </varlistentry>
229  <varlistentry>
230   <term>Notes:</term>
231   <listitem>
232    <para>
233     No trailing <quote><literal>/</literal></quote>, please
234    </para>
235    <para>
236     When development goes modular and multi-user, the blocker, filter, and
237     per-user config will be stored in subdirectories of <quote>confdir</quote>.
238     For now, the configuration directory structure is flat, except for 
239     <filename>confdir/templates</filename>, where the HTML templates for CGI 
240     output reside (e.g. <application>Privoxy's</application> 404 error page). 
241    </para>
242   </listitem>
243  </varlistentry>
244 </variablelist>
245
246 <![%config-file;[<literallayout>@@confdir .</literallayout>]]>
247 </sect3>
248
249
250 <!--   ~~~~~       New section      ~~~~~     -->
251 <sect3 renderas="sect4" id="logdir"><title>logdir</title>
252
253 <variablelist>
254  <varlistentry>
255   <term>Specifies:</term>
256   <listitem>
257    <para>
258     The directory where all logging takes place (i.e. where <filename>logfile</filename> and 
259     <filename>jarfile</filename> are located) 
260    </para>
261   </listitem>
262  </varlistentry>
263  <varlistentry>
264   <term>Type of value:</term>
265   <listitem>
266    <para>Path name</para>
267   </listitem>
268  </varlistentry>
269  <varlistentry>
270   <term>Default value:</term>
271   <listitem>
272    <para>/var/log/privoxy (Unix) <emphasis>or</emphasis> <application>Privoxy</application> installation dir (Windows) </para>
273   </listitem>
274  </varlistentry>
275  <varlistentry>
276   <term>Effect if unset:</term>
277   <listitem>
278    <para><emphasis>Mandatory</emphasis></para>
279   </listitem>
280  </varlistentry>
281  <varlistentry>
282   <term>Notes:</term>
283   <listitem>
284    <para>
285     No trailing <quote><literal>/</literal></quote>, please
286    </para>
287   </listitem>
288  </varlistentry>
289 </variablelist>
290
291 <![%config-file;[<literallayout>@@logdir .</literallayout>]]>
292 </sect3>
293
294
295 <!--   ~~~~~       New section      ~~~~~     -->
296 <sect3 renderas="sect4" id="actionsfile"><title>
297 actionsfile
298 </title>
299 <anchor id="default.action">
300 <anchor id="standard.action">
301 <anchor id="user.action">
302 <!-- Note: slightly modified this section 04/28/02, hal. See NOTE. -->
303 <variablelist>
304  <varlistentry>
305   <term>Specifies:</term>
306   <listitem>
307    <para>
308     The <link linkend="actions-file">actions file(s)</link> to use
309    </para>
310   </listitem>
311  </varlistentry>
312  <varlistentry>
313   <term>Type of value:</term>
314   <listitem>
315    <para>File name, relative to <literal>confdir</literal>, without the <literal>.action</literal> suffix</para>
316   </listitem>
317  </varlistentry>
318  <varlistentry>
319   <term>Default values:</term>
320   <listitem>
321    <simplelist>
322     <member>
323      <msgtext><literallayout>  standard     # Internal purposes, no editing recommended</literallayout></msgtext>
324     </member>
325     <member>
326      <msgtext><literallayout>  default      # Main actions file</literallayout></msgtext>
327     </member>
328     <member>
329      <msgtext><literallayout>  user         # User customizations</literallayout></msgtext>
330     </member>
331    </simplelist>
332   </listitem>
333  </varlistentry>
334  <varlistentry>
335   <term>Effect if unset:</term>
336   <listitem>
337    <para>
338     No actions are taken at all. Simple neutral proxying. 
339    </para>
340   </listitem>
341  </varlistentry>
342  <varlistentry>
343   <term>Notes:</term>
344   <listitem>
345    <para>
346     Multiple <literal>actionsfile</literal> lines are permitted, and are in fact recommended!
347    </para>
348    <para> 
349     The default values include standard.action, which is used for internal
350     purposes and should be loaded, default.action, which is the
351     <quote>main</quote> actions file maintained by the developers, and
352     <filename>user.action</filename>, where you can make your personal additions.
353    </para>
354    <para> 
355     Actions files are where all the per site and per URL configuration is done for 
356     ad blocking, cookie management, privacy considerations, etc.
357     There is no point in using <application>Privoxy</application> without at 
358     least one actions file.
359    </para>
360   </listitem>
361  </varlistentry>
362 </variablelist>
363
364 <!-- NOTE: alternate markup to make a simpler list doesn't work due to -->
365 <!-- html -> text conversion, blah -->
366 <![%config-file;[<literallayout>@@actionsfile standard  # Internal purpose, recommended</literallayout>]]>
367 <![%config-file;[<literallayout>@@actionsfile default   # Main actions file</literallayout>]]>
368 <![%config-file;[<literallayout>@@actionsfile user      # User customizations</literallayout>]]>
369 </sect3>
370
371 <!--   ~~~~~       New section      ~~~~~     -->
372 <sect3 renderas="sect4" id="filterfile"><title>filterfile</title>
373 <anchor id="default.filter">
374 <variablelist>
375  <varlistentry>
376   <term>Specifies:</term>
377   <listitem>
378    <para>
379     The <link linkend="filter-file">filter file</link> to use
380    </para>
381   </listitem>
382  </varlistentry>
383  <varlistentry>
384   <term>Type of value:</term>
385   <listitem>
386    <para>File name, relative to <literal>confdir</literal></para>
387   </listitem>
388  </varlistentry>
389  <varlistentry>
390   <term>Default value:</term>
391   <listitem>
392    <para>default.filter (Unix) <emphasis>or</emphasis> default.filter.txt (Windows)</para>
393   </listitem>
394  </varlistentry>
395  <varlistentry>
396   <term>Effect if unset:</term>
397   <listitem>
398    <para>
399     No textual content filtering takes place, i.e. all
400     <literal>+<link linkend="filter">filter</link>{<replaceable class="parameter">name</replaceable>}</literal>
401     actions in the actions files are turned neutral.
402    </para>
403   </listitem>
404  </varlistentry>
405  <varlistentry>
406   <term>Notes:</term>
407   <listitem>
408    <para>
409     The <link linkend="filter-file">filter file</link> contains content modification
410     rules that use <link linkend="regex">regular expressions</link>. These rules permit
411     powerful changes on the content of Web pages, e.g., you could disable your favorite
412     JavaScript annoyances, re-write the actual displayed text, or just have some
413     fun replacing <quote>Microsoft</quote> with <quote>MicroSuck</quote> wherever
414     it appears on a Web page.
415    </para>
416    <para>
417     The
418     <literal>+<link linkend="filter">filter</link>{<replaceable class="parameter">name</replaceable>}</literal>
419     actions rely on the relevant filter (<replaceable class="parameter">name</replaceable>)
420     to be defined in the filter file!
421    </para>
422    <para>
423     A pre-defined filter file called <filename>default.filter</filename> that contains
424     a bunch of handy filters for common problems is included in the distribution.
425     See the section on the <literal><link linkend="filter">filter</link></literal>
426     action for a list.
427    </para>
428   </listitem>
429  </varlistentry>
430 </variablelist>
431
432 <![%config-file;[<literallayout>@@filterfile default.filter</literallayout>]]>
433 </sect3>
434
435
436 <!--   ~~~~~       New section      ~~~~~     -->
437 <sect3 renderas="sect4" id="logfile"><title>logfile</title>
438
439 <variablelist>
440  <varlistentry>
441   <term>Specifies:</term>
442   <listitem>
443    <para>
444     The log file to use
445    </para>
446   </listitem>
447  </varlistentry>
448  <varlistentry>
449   <term>Type of value:</term>
450   <listitem>
451    <para>File name, relative to <literal>logdir</literal></para>
452   </listitem>
453  </varlistentry>
454  <varlistentry>
455   <term>Default value:</term>
456   <listitem>
457    <para>logfile (Unix) <emphasis>or</emphasis> privoxy.log (Windows)</para>
458   </listitem>
459  </varlistentry>
460  <varlistentry>
461   <term>Effect if unset:</term>
462   <listitem>
463    <para>
464     No log file is used, all log messages go to the console (<literal>STDERR</literal>).
465    </para>
466   </listitem>
467  </varlistentry>
468  <varlistentry>
469   <term>Notes:</term>
470   <listitem>
471    <para>
472     The windows version will additionally log to the console.
473    </para>
474    <para>
475     The logfile is where all logging and error messages are written. The level
476     of detail and number of messages are set with the <literal>debug</literal>
477     option (see below). The logfile can be useful for tracking down a problem with
478     <application>Privoxy</application> (e.g., it's not blocking an ad you
479     think it should block) but in most cases you probably will never look at it.
480    </para>
481    <para>
482     Your logfile will grow indefinitely, and you will probably want to
483     periodically remove it.  On Unix systems, you can do this with a cron job
484     (see <quote>man cron</quote>). For Red Hat, a <command>logrotate</command> 
485     script has been included.
486    </para> 
487    <para>
488     On SuSE Linux systems, you can place a line like <quote>/var/log/privoxy.*
489     +1024k 644 nobody.nogroup</quote> in <filename>/etc/logfiles</filename>, with
490     the effect that cron.daily will automatically archive, gzip, and empty the
491     log, when it exceeds 1M size.
492    </para>
493    <para>
494     Any log files must be writable by whatever user <application>Privoxy</application>
495     is being run as (default on UNIX, user id is <quote>privoxy</quote>).
496    </para>
497   </listitem>
498  </varlistentry>
499 </variablelist>
500
501 <![%config-file;[<literallayout>@@logfile logfile</literallayout>]]>
502 </sect3>
503
504
505 <!--   ~~~~~       New section      ~~~~~     -->
506 <sect3 renderas="sect4" id="jarfile"><title>jarfile</title>
507
508 <variablelist>
509  <varlistentry>
510   <term>Specifies:</term>
511   <listitem>
512    <para>
513     The file to store intercepted cookies in
514    </para>
515   </listitem>
516  </varlistentry>
517  <varlistentry>
518   <term>Type of value:</term>
519   <listitem>
520    <para>File name, relative to <literal>logdir</literal></para>
521   </listitem>
522  </varlistentry>
523  <varlistentry>
524   <term>Default value:</term>
525   <listitem>
526    <para>jarfile (Unix) <emphasis>or</emphasis> privoxy.jar (Windows)</para>
527   </listitem>
528  </varlistentry>
529  <varlistentry>
530   <term>Effect if unset:</term>
531   <listitem>
532    <para>
533     Intercepted cookies are not stored at all.
534    </para>
535   </listitem>
536  </varlistentry>
537  <varlistentry>
538   <term>Notes:</term>
539   <listitem>
540    <para>
541     The jarfile may grow to ridiculous sizes over time.
542    </para>
543   </listitem>
544  </varlistentry>
545 </variablelist>
546
547 <![%config-file;[<literallayout>@@jarfile jarfile</literallayout>]]>
548 </sect3>
549
550
551 <!--   ~~~~~       New section      ~~~~~     -->
552 <sect3 renderas="sect4" id="trustfile"><title>trustfile</title>
553 <variablelist>
554  <varlistentry>
555   <term>Specifies:</term>
556   <listitem>
557    <para>
558     The trust file to use
559    </para>
560   </listitem>
561  </varlistentry>
562  <varlistentry>
563   <term>Type of value:</term>
564   <listitem>
565    <para>File name, relative to <literal>confdir</literal></para>
566   </listitem>
567  </varlistentry>
568  <varlistentry>
569   <term>Default value:</term>
570   <listitem>
571    <para><emphasis>Unset (commented out)</emphasis>. When activated: trust (Unix) <emphasis>or</emphasis> trust.txt (Windows)</para>
572   </listitem>
573  </varlistentry>
574  <varlistentry>
575   <term>Effect if unset:</term>
576   <listitem>
577    <para>
578     The whole trust mechanism is turned off.
579    </para>
580   </listitem>
581  </varlistentry>
582  <varlistentry>
583   <term>Notes:</term>
584   <listitem>
585    <para>
586     The trust mechanism is an experimental feature for building white-lists and should
587     be used with care. It is <emphasis>NOT</emphasis> recommended for the casual user.
588    </para>
589    <para>
590     If you specify a trust file, <application>Privoxy</application> will only allow
591     access to sites that are specified in the trustfile. Sites can be listed 
592     in one of two ways:
593    </para>
594    <para>
595     Prepending a <literal>~</literal> character limits access to this site 
596     only (and any sub-paths within this site), e.g. 
597     <literal>~www.example.com</literal>. 
598    </para>
599    <para>
600     Or, you can designate sites as <emphasis>trusted referrers</emphasis>, by
601     prepending the name with a <literal>+</literal> character. The effect is that
602     access to untrusted sites will be granted -- but only if a link from this
603     trusted referrer was used. The link target will then be added to the
604     <quote>trustfile</quote> so that future, direct accesses will be granted.
605     Sites added via this mechanism do not become trusted referrers themselves
606     (i.e. they are added with a <literal>~</literal> designation).
607    </para>
608    <para>
609     If you use the <literal>+</literal> operator in the trust file, it may grow 
610     considerably over time.
611    </para>
612    <para>
613     It is recommended that <application>Privoxy</application> be compiled with
614     the <literal>--disable-force</literal>, <literal>--disable-toggle</literal> and
615     <literal> --disable-editor</literal> options, if this feature is to be
616     used.
617    </para>
618    <para>
619     Possible applications include limiting Internet access for children.
620    </para>
621   </listitem>
622  </varlistentry>
623 </variablelist>
624
625 <![%config-file;[<literallayout>@@#trustfile trust</literallayout>]]>
626 </sect3>
627 </sect2>
628
629 <!--  ~  End section  ~  -->
630
631
632 <!--   ~~~~~       New section      ~~~~~     -->
633 <sect2 id="local-set-up">
634 <title>Local Set-up Documentation</title>
635
636   <para>
637     If you intend to operate <application>Privoxy</application> for more users
638     than just yourself, it might be a good idea to let them know how to reach
639     you, what you block and why you do that, your policies, etc.
640    </para>
641
642
643 <!--   ~~~~~       New section      ~~~~~     -->
644 <sect3 renderas="sect4" id="user-manual"><title>user-manual</title>
645 <variablelist>
646  <varlistentry>
647   <term>Specifies:</term>
648   <listitem>
649    <para>
650     Location of the <application>Privoxy</application> User Manual.
651    </para>
652   </listitem>
653  </varlistentry>
654  <varlistentry>
655   <term>Type of value:</term>
656   <listitem>
657    <para>A fully qualified URI</para>
658   </listitem>
659  </varlistentry>
660  <varlistentry>
661   <term>Default value:</term>
662   <listitem>
663    <para><emphasis>Unset</emphasis></para>
664   </listitem>
665  </varlistentry>
666  <varlistentry>
667   <term>Effect if unset:</term>
668   <listitem>
669    <para>
670     <ulink url="http://www.privoxy.org/user-manual/">http://www.privoxy.org/<replaceable class="parameter">version</replaceable>/user-manual/</ulink>
671     will be used, where <replaceable class="parameter">version</replaceable> is the <application>Privoxy</application> version.
672    </para>
673   </listitem>
674  </varlistentry>
675  <varlistentry>
676   <term>Notes:</term>
677   <listitem>
678     <para>
679     The User Manual URI is used for help links from some of the internal CGI pages. 
680     The manual itself is normally packaged with the binary distributions, so you probably want
681     to set this to a locally installed copy. For multi-user setups, you could provide a copy on
682     a local webserver for all your users and use the corresponding URL here.
683    </para>
684    <para>
685     Examples:
686    </para>
687   <!-- The below needs checking after a rebuild due to long file names -->
688   <para>
689    Unix, in local filesystem:
690   </para>
691   <para>
692    <screen>&nbsp;user-manual&nbsp;&nbsp;file:///usr/share/doc/privoxy-&p-version;/user-manual/index.html</screen>
693   </para>
694   <para>
695    Windows, in local filesystem, <emphasis>must</emphasis> use forward slash notation, and <literal>%20</literal> to denote
696    spaces in path names:
697   </para>
698   <para>
699    <screen>&nbsp;user-manual&nbsp;&nbsp;file:///c:/some%20dir/privoxy/user-manual/index.html</screen>
700   </para>
701   <para>
702    Windows, UNC notation (forward slashes required again):
703   </para>
704   <para>
705    <screen>&nbsp;user-manual&nbsp;&nbsp;file://///some-server/some-path/privoxy/user-manual/index.html</screen>
706   </para>
707   <para>
708    Any platform, on local webserver (called <quote>local-webserver</quote>):
709   </para>
710   <para>
711    <screen>&nbsp;user-manual&nbsp;&nbsp;http://local-webserver/privoxy-user-manual/</screen>
712   </para>
713   <![%user-man;[
714    <!-- this gets hammered in conversion to config. Text repeated below. -->
715   <warning>
716    <para>
717      If set, this option should be <emphasis>the first option in the config
718      file</emphasis>, because it is used while the config file is being read.
719    </para>
720   </warning>     
721   ]]>
722
723   <![%config-file;[
724    <!-- alternate -->
725    <para>
726     WARNING!!!
727    </para>
728    <blockquote>
729     <para> 
730      If set, this option should be the first option in the config
731      file, because it is used while the config file is being read.
732     </para>
733    </blockquote>
734   ]]>
735
736  </listitem>
737  </varlistentry>
738 </variablelist>
739
740 <![%config-file;[<literallayout>@@#user-manual http://www.privoxy.org/user-manual/</literallayout>]]>
741 </sect3>
742
743
744 <!--   ~~~~~       New section      ~~~~~     -->
745 <sect3 renderas="sect4" id="trust-info-url"><title>trust-info-url</title>
746
747 <variablelist>
748  <varlistentry>
749   <term>Specifies:</term>
750   <listitem>
751    <para>
752     A URL to be displayed in the error page that users will see if access to an untrusted page is denied.    
753    </para>
754   </listitem>
755  </varlistentry>
756  <varlistentry>
757   <term>Type of value:</term>
758   <listitem>
759    <para>URL</para>
760   </listitem>
761  </varlistentry>
762  <varlistentry>
763   <term>Default value:</term>
764   <listitem>
765    <para>Two example URL are provided</para>
766   </listitem>
767  </varlistentry>
768  <varlistentry>
769   <term>Effect if unset:</term>
770   <listitem>
771    <para>
772     No links are displayed on the "untrusted" error page.
773    </para>
774   </listitem>
775  </varlistentry>
776  <varlistentry>
777   <term>Notes:</term>
778   <listitem>
779    <para>
780     The value of this option only matters if the experimental trust mechanism has been
781     activated. (See <link linkend="trustfile"><emphasis>trustfile</emphasis></link> above.)
782    </para>
783    <para>
784     If you use the trust mechanism, it is a good idea to write up some on-line
785     documentation about your trust policy and to specify the URL(s) here.
786     Use multiple times for multiple URLs.
787    </para>
788    <para>
789     The URL(s) should be added to the trustfile as well, so users don't end up
790     locked out from the information on why they were locked out in the first place!
791    </para>
792   </listitem>
793  </varlistentry>
794 </variablelist>
795
796 <![%config-file;[<literallayout>@@trust-info-url  http://www.example.com/why_we_block.html</literallayout>]]>
797 <![%config-file;[<literallayout>@@trust-info-url  http://www.example.com/what_we_allow.html</literallayout>]]>
798 </sect3>
799
800
801 <!--   ~~~~~       New section      ~~~~~     -->
802 <sect3 renderas="sect4" id="admin-address"><title>admin-address</title>
803
804 <variablelist>
805  <varlistentry>
806   <term>Specifies:</term>
807   <listitem>
808    <para>
809     An email address to reach the proxy administrator.
810    </para>
811   </listitem>
812  </varlistentry>
813  <varlistentry>
814   <term>Type of value:</term>
815   <listitem>
816    <para>Email address</para>
817   </listitem>
818  </varlistentry>
819  <varlistentry>
820   <term>Default value:</term>
821   <listitem>
822    <para><emphasis>Unset</emphasis></para>
823   </listitem>
824  </varlistentry>
825  <varlistentry>
826   <term>Effect if unset:</term>
827   <listitem>
828    <para>
829     No email address is displayed on error pages and the CGI user interface.
830    </para>
831   </listitem>
832  </varlistentry>
833  <varlistentry>
834   <term>Notes:</term>
835   <listitem>
836     <para>
837     If both <literal>admin-address</literal> and <literal>proxy-info-url</literal>
838     are unset, the whole "Local Privoxy Support" box on all generated pages will
839     not be shown.
840    </para>  
841   </listitem>
842  </varlistentry>
843 </variablelist>
844
845 <![%config-file;[<literallayout>@@#admin-address privoxy-admin@example.com</literallayout>]]>
846 </sect3>
847
848
849 <!--   ~~~~~       New section      ~~~~~     -->
850 <sect3 renderas="sect4" id="proxy-info-url"><title>proxy-info-url</title>
851
852 <variablelist>
853  <varlistentry>
854   <term>Specifies:</term>
855   <listitem>
856    <para>
857     A URL to documentation about the local <application>Privoxy</application> setup,
858     configuration or policies.
859    </para>
860   </listitem>
861  </varlistentry>
862  <varlistentry>
863   <term>Type of value:</term>
864   <listitem>
865    <para>URL</para>
866   </listitem>
867  </varlistentry>
868  <varlistentry>
869   <term>Default value:</term>
870   <listitem>
871    <para><emphasis>Unset</emphasis></para>
872   </listitem>
873  </varlistentry>
874  <varlistentry>
875   <term>Effect if unset:</term>
876   <listitem>
877    <para>
878     No link to local documentation is displayed on error pages and the CGI user interface.
879    </para>
880   </listitem>
881  </varlistentry>
882  <varlistentry>
883   <term>Notes:</term>
884   <listitem>
885    <para>
886     If both <literal>admin-address</literal> and <literal>proxy-info-url</literal>
887     are unset, the whole "Local Privoxy Support" box on all generated pages will
888     not be shown.
889    </para>  
890    <para>
891     This URL shouldn't be blocked ;-)
892    </para> 
893   </listitem>
894  </varlistentry>
895 </variablelist>
896
897 <![%config-file;[<literallayout>@@#proxy-info-url http://www.example.com/proxy-service.html</literallayout>]]>
898 </sect3>
899
900 </sect2>
901 <!--  ~  End section  ~  -->
902
903 <!--   ~~~~~       New section      ~~~~~     -->
904 <sect2 id="debugging">
905 <title>Debugging</title>
906
907  <para>
908   These options are mainly useful when tracing a problem.
909   Note that you might also want to invoke
910   <application>Privoxy</application> with the <literal>--no-daemon</literal>
911   command line option when debugging.
912  </para>
913
914 <sect3 renderas="sect4" id="debug"><title>debug</title>
915
916 <variablelist>
917  <varlistentry>
918   <term>Specifies:</term>
919   <listitem>
920    <para>
921     Key values that determine what information gets logged to the 
922     <link linkend="logfile"><emphasis>logfile</emphasis></link>.
923    </para>
924   </listitem>
925  </varlistentry>
926  <varlistentry>
927   <term>Type of value:</term>
928   <listitem>
929    <para>Integer values</para>
930   </listitem>
931  </varlistentry>
932  <varlistentry>
933   <term>Default value:</term>
934   <listitem>
935    <para>12289 (i.e.: URLs plus informational and warning messages)</para>
936   </listitem>
937  </varlistentry>
938  <varlistentry>
939   <term>Effect if unset:</term>
940   <listitem>
941    <para>
942     Nothing gets logged.
943    </para>
944   </listitem>
945  </varlistentry>
946  <varlistentry>
947   <term>Notes:</term>
948   <listitem>
949    <para>
950     The available debug levels are:
951    </para>
952    <para>
953     <programlisting>
954   debug         1 # show each GET/POST/CONNECT request
955   debug         2 # show each connection status
956   debug         4 # show I/O status
957   debug         8 # show header parsing
958   debug        16 # log all data into the logfile
959   debug        32 # debug force feature
960   debug        64 # debug regular expression filter
961   debug       128 # debug fast redirects
962   debug       256 # debug GIF de-animation
963   debug       512 # Common Log Format
964   debug      1024 # debug kill pop-ups
965   debug      2048 # CGI user interface
966   debug      4096 # Startup banner and warnings.
967   debug      8192 # Non-fatal errors
968 </programlisting>
969    </para>
970    <para>
971     To select multiple debug levels, you can either add them or use
972     multiple <literal>debug</literal> lines.
973    </para>
974    <para>
975     A debug level of 1 is informative because it will show you each request
976     as it happens. <emphasis>1, 4096 and 8192 are highly recommended</emphasis>
977     so that you will notice when things go wrong. The other levels are probably
978     only of interest if you are hunting down a specific problem. They can produce
979     a hell of an output (especially 16).
980     <!-- LOL -->
981    </para>
982    <para>
983     The reporting of <emphasis>fatal</emphasis> errors (i.e. ones which crash 
984     <application>Privoxy</application>) is always on and cannot be disabled.
985    </para>
986    <para>
987     If you want to use CLF (Common Log Format), you should set <quote>debug
988     512</quote> <emphasis>ONLY</emphasis> and not enable anything else.
989    </para>
990   </listitem>
991  </varlistentry>
992 </variablelist>
993
994 <![%config-file;[<literallayout>@@debug   1    # show each GET/POST/CONNECT request</literallayout>]]>
995 <![%config-file;[<literallayout>@@debug   4096 # Startup banner and warnings</literallayout>]]>
996 <![%config-file;[<literallayout>@@debug   8192 # Errors - *we highly recommended enabling this*</literallayout>]]>
997 </sect3>
998
999
1000 <!--   ~~~~~       New section      ~~~~~     -->
1001 <sect3 renderas="sect4" id="single-threaded"><title>single-threaded</title>
1002
1003 <variablelist>
1004  <varlistentry>
1005   <term>Specifies:</term>
1006   <listitem>
1007    <para>
1008     Whether to run only one server thread
1009    </para>
1010   </listitem>
1011  </varlistentry>
1012  <varlistentry>
1013   <term>Type of value:</term>
1014   <listitem>
1015    <para><emphasis>None</emphasis></para>
1016   </listitem>
1017  </varlistentry>
1018  <varlistentry>
1019   <term>Default value:</term>
1020   <listitem>
1021    <para><emphasis>Unset</emphasis></para>
1022   </listitem>
1023  </varlistentry>
1024  <varlistentry>
1025   <term>Effect if unset:</term>
1026   <listitem>
1027    <para>
1028     Multi-threaded (or, where unavailable: forked) operation, i.e. the ability to
1029     serve multiple requests simultaneously.
1030    </para>
1031   </listitem>
1032  </varlistentry>
1033  <varlistentry>
1034   <term>Notes:</term>
1035   <listitem>
1036    <para>
1037     This option is only there for debug purposes and you should never
1038     need to use it. <emphasis>It will drastically reduce performance.</emphasis>
1039    </para>
1040   </listitem>
1041  </varlistentry>
1042 </variablelist>
1043
1044 <![%config-file;[<literallayout>@@#single-threaded</literallayout>]]>
1045 </sect3>
1046
1047 </sect2>
1048
1049 <!--  ~  End section  ~  -->
1050
1051
1052 <!--   ~~~~~       New section      ~~~~~     -->
1053 <sect2 id="access-control">
1054 <title>Access Control and Security</title>
1055
1056  <para>
1057   This section of the config file controls the security-relevant aspects
1058   of <application>Privoxy</application>'s configuration.
1059  </para>
1060
1061
1062 <!--   ~~~~~       New section      ~~~~~     -->
1063 <sect3 renderas="sect4" id="listen-address"><title>listen-address</title>
1064
1065 <variablelist>
1066  <varlistentry>
1067   <term>Specifies:</term>
1068   <listitem>
1069    <para>
1070     The IP address and TCP port on which <application>Privoxy</application> will
1071     listen for client requests.
1072    </para>
1073   </listitem>
1074  </varlistentry>
1075  <varlistentry>
1076   <term>Type of value:</term>
1077   <listitem>
1078    <para>[<replaceable class="parameter">IP-Address</replaceable>]:<replaceable class="parameter">Port</replaceable></para>
1079   </listitem>
1080  </varlistentry>
1081
1082  <varlistentry>
1083   <term>Default value:</term>
1084   <listitem>
1085    <para>127.0.0.1:8118</para>
1086   </listitem>
1087  </varlistentry>
1088  <varlistentry>
1089   <term>Effect if unset:</term>
1090   <listitem>
1091    <para>
1092     Bind to 127.0.0.1 (localhost), port 8118. This is suitable and recommended for
1093     home users who run <application>Privoxy</application> on the same machine as
1094     their browser.
1095    </para>
1096   </listitem>
1097  </varlistentry>
1098  <varlistentry>
1099   <term>Notes:</term>
1100   <listitem>
1101    <para>
1102     You will need to configure your browser(s) to this proxy address and port.
1103    </para>
1104    <para>
1105     If you already have another service running on port 8118, or if you want to
1106     serve requests from other machines (e.g. on your local network) as well, you
1107     will need to override the default.
1108    </para>
1109    <para>
1110     If you leave out the IP address, <application>Privoxy</application> will
1111     bind to all interfaces (addresses) on your machine and may become reachable
1112     from the Internet. In that case, consider using <link
1113     linkend="acls">access control lists</link> (ACL's, see below), and/or
1114     a firewall.
1115    </para>
1116    <para>
1117     If you open <application>Privoxy</application> to untrusted users, you will
1118     also want to turn off the <literal><link
1119     linkend="enable-edit-actions">enable-edit-actions</link></literal> and
1120     <literal><link linkend="enable-remote-toggle">enable-remote-toggle</link></literal>
1121     options!
1122    </para>
1123   </listitem>
1124  </varlistentry>
1125  <varlistentry>
1126   <term>Example:</term>
1127   <listitem>
1128    <para>
1129      Suppose you are running <application>Privoxy</application> on
1130      a machine which has the address 192.168.0.1 on your local private network
1131      (192.168.0.0) and has another outside connection with a different address.
1132      You want it to serve requests from inside only:
1133    </para>
1134    <para>
1135     <programlisting>
1136   listen-address  192.168.0.1:8118
1137 </programlisting>
1138    </para>
1139   </listitem>
1140  </varlistentry>
1141 </variablelist>
1142
1143 <![%config-file;[<literallayout>@@listen-address  127.0.0.1:8118</literallayout>]]>
1144 </sect3>
1145
1146
1147 <!--   ~~~~~       New section      ~~~~~     -->
1148 <sect3 renderas="sect4" id="toggle"><title>toggle</title>
1149
1150 <variablelist>
1151  <varlistentry>
1152   <term>Specifies:</term>
1153   <listitem>
1154    <para>
1155     Initial state of "toggle" status
1156    </para>
1157   </listitem>
1158  </varlistentry>
1159  <varlistentry>
1160   <term>Type of value:</term>
1161   <listitem>
1162    <para>1 or 0</para>
1163   </listitem>
1164  </varlistentry>
1165  <varlistentry>
1166   <term>Default value:</term>
1167   <listitem>
1168    <para>1</para>
1169   </listitem>
1170  </varlistentry>
1171  <varlistentry>
1172   <term>Effect if unset:</term>
1173   <listitem>
1174    <para>
1175     Act as if toggled on
1176    </para>
1177   </listitem>
1178  </varlistentry>
1179  <varlistentry>
1180   <term>Notes:</term>
1181   <listitem>
1182    <para>
1183     If set to 0, <application>Privoxy</application> will start in
1184     <quote>toggled off</quote> mode, i.e. behave like a normal, content-neutral
1185     proxy where all ad blocking, filtering, etc are disabled. See
1186     <literal>enable-remote-toggle</literal> below. This is not really useful
1187     anymore, since toggling is much easier via <ulink
1188     url="http://config.privoxy.org/toggle">the web interface</ulink> than via
1189     editing the <filename>conf</filename> file.
1190    </para>
1191    <para>
1192     The windows version will only display the toggle icon in the system tray
1193     if this option is present.
1194    </para>
1195   </listitem>
1196  </varlistentry>
1197 </variablelist>
1198
1199 <![%config-file;[<literallayout>@@toggle  1</literallayout>]]>
1200 </sect3>
1201
1202
1203 <!--   ~~~~~       New section      ~~~~~     -->
1204 <sect3 renderas="sect4" id="enable-remote-toggle"><title>enable-remote-toggle</title>
1205 <variablelist>
1206  <varlistentry>
1207   <term>Specifies:</term>
1208   <listitem>
1209    <para>
1210     Whether or not the <ulink url="http://config.privoxy.org/toggle">web-based toggle
1211     feature</ulink> may be used
1212    </para>
1213   </listitem>
1214  </varlistentry>
1215  <varlistentry>
1216   <term>Type of value:</term>
1217   <listitem>
1218    <para>0 or 1</para>
1219   </listitem>
1220  </varlistentry>
1221  <varlistentry>
1222   <term>Default value:</term>
1223   <listitem>
1224    <para>1</para>
1225   </listitem>
1226  </varlistentry>
1227  <varlistentry>
1228   <term>Effect if unset:</term>
1229   <listitem>
1230    <para>
1231     The web-based toggle feature is disabled.
1232    </para>
1233   </listitem>
1234  </varlistentry>
1235  <varlistentry>
1236   <term>Notes:</term>
1237   <listitem>
1238    <para>
1239     When toggled off, <application>Privoxy</application> acts like a normal,
1240     content-neutral proxy, i.e. it acts as if none of the actions applied to
1241     any URL.
1242    </para>
1243    <para>
1244     For the time being, access to the toggle feature can <emphasis>not</emphasis> be
1245     controlled separately by <quote>ACLs</quote> or HTTP authentication,
1246     so that everybody who can access <application>Privoxy</application> (see
1247     <quote>ACLs</quote> and <literal>listen-address</literal> above) can
1248     toggle it for all users. So this option is <emphasis>not recommended</emphasis>
1249     for multi-user environments with untrusted users.
1250    </para>
1251    <para>
1252     Note that you must have compiled <application>Privoxy</application> with
1253     support for this feature, otherwise this option has no effect. 
1254    </para>
1255   </listitem>
1256  </varlistentry>
1257 </variablelist>
1258
1259 <![%config-file;[<literallayout>@@enable-remote-toggle  1</literallayout>]]>
1260 </sect3>
1261
1262
1263 <!--   ~~~~~       New section      ~~~~~     -->
1264 <sect3 renderas="sect4" id="enable-edit-actions"><title>enable-edit-actions</title>
1265 <variablelist>
1266  <varlistentry>
1267   <term>Specifies:</term>
1268   <listitem>
1269    <para>
1270     Whether or not the <ulink url="http://config.privoxy.org/show-status">web-based actions
1271     file editor</ulink> may be used
1272    </para>
1273   </listitem>
1274  </varlistentry>
1275  <varlistentry>
1276   <term>Type of value:</term>
1277   <listitem>
1278    <para>0 or 1</para>
1279   </listitem>
1280  </varlistentry>
1281  <varlistentry>
1282   <term>Default value:</term>
1283   <listitem>
1284    <para>1</para>
1285   </listitem>
1286  </varlistentry>
1287  <varlistentry>
1288   <term>Effect if unset:</term>
1289   <listitem>
1290    <para>
1291     The web-based actions file editor is disabled.
1292    </para>
1293   </listitem>
1294  </varlistentry>
1295  <varlistentry>
1296   <term>Notes:</term>
1297   <listitem>
1298    <para>
1299     For the time being, access to the editor can <emphasis>not</emphasis> be
1300     controlled separately by <quote>ACLs</quote> or HTTP authentication,
1301     so that everybody who can access <application>Privoxy</application> (see
1302     <quote>ACLs</quote> and <literal>listen-address</literal> above) can
1303     modify its configuration for all users. So this option is <emphasis>not
1304     recommended</emphasis> for multi-user environments with untrusted users.
1305    </para>
1306    <para>
1307     Note that you must have compiled <application>Privoxy</application> with
1308     support for this feature, otherwise this option has no effect. 
1309    </para>
1310   </listitem>
1311  </varlistentry>
1312 </variablelist>
1313
1314 <![%config-file;[<literallayout>@@enable-edit-actions 1</literallayout>]]>
1315 </sect3>
1316
1317 <!--   ~~~~~       New section      ~~~~~     -->
1318 <sect3 renderas="sect4" id="acls"><title>
1319 ACLs: permit-access and deny-access</title>
1320 <anchor id="permit-access">
1321 <anchor id="deny-access">
1322
1323 <variablelist>
1324  <varlistentry>
1325   <term>Specifies:</term>
1326   <listitem>
1327    <para>
1328     Who can access what.
1329    </para>
1330   </listitem>
1331  </varlistentry>
1332  <varlistentry>
1333   <term>Type of value:</term>
1334   <listitem>
1335    <para>
1336     <replaceable class="parameter">src_addr</replaceable>[/<replaceable class="parameter">src_masklen</replaceable>]
1337     [<replaceable class="parameter">dst_addr</replaceable>[/<replaceable class="parameter">dst_masklen</replaceable>]]
1338    </para>
1339    <para>
1340     Where <replaceable class="parameter">src_addr</replaceable> and 
1341    <replaceable class="parameter">dst_addr</replaceable> are IP addresses in dotted decimal notation or valid
1342     DNS names, and <replaceable class="parameter">src_masklen</replaceable> and
1343     <replaceable class="parameter">dst_masklen</replaceable> are subnet masks in CIDR notation, i.e. integer
1344     values from 2 to 30 representing the length (in bits) of the network address. The masks and the whole
1345     destination part are optional.
1346    </para>
1347   </listitem>
1348  </varlistentry>
1349  <varlistentry>
1350   <term>Default value:</term>
1351   <listitem>
1352    <para><emphasis>Unset</emphasis></para>
1353   </listitem>
1354  </varlistentry>
1355  <varlistentry>
1356   <term>Effect if unset:</term>
1357   <listitem>
1358    <para>
1359     Don't restrict access further than implied by <literal>listen-address</literal>
1360    </para>
1361   </listitem>
1362  </varlistentry>
1363  <varlistentry>
1364   <term>Notes:</term>
1365   <listitem>
1366    <para>
1367     Access controls are included at the request of ISPs and systems
1368     administrators, and <emphasis>are not usually needed by individual users</emphasis>.
1369     For a typical home user, it will normally suffice to ensure that 
1370     <application>Privoxy</application> only listens on the localhost
1371     (127.0.0.1) or internal (home) network address by means of the
1372     <link linkend="listen-address"><emphasis>listen-address</emphasis></link>
1373     option. 
1374    </para>
1375    <para>
1376     Please see the warnings in the FAQ that this proxy is not intended to be a substitute
1377     for a firewall or to encourage anyone to defer addressing basic security
1378     weaknesses.
1379    </para>
1380    <para>
1381     Multiple ACL lines are OK.
1382     If any ACLs are specified, then the <application>Privoxy</application>
1383     talks only to IP addresses that match at least one <literal>permit-access</literal> line
1384     and don't match any subsequent <literal>deny-access</literal> line. In other words, the
1385     last match wins, with the default being <literal>deny-access</literal>.
1386    </para>
1387    <para>
1388     If <application>Privoxy</application> is using a forwarder (see <literal>forward</literal> below)
1389     for a particular destination URL, the <replaceable class="parameter">dst_addr</replaceable>
1390     that is examined is the address of the forwarder and <emphasis>NOT</emphasis> the address
1391     of the ultimate target. This is necessary because it may be impossible for the local
1392     <application>Privoxy</application> to determine the IP address of the
1393     ultimate target (that's often what gateways are used for).
1394    </para>
1395    <para>
1396     You should prefer using IP addresses over DNS names, because the address lookups take
1397     time. All DNS names must resolve! You can <emphasis>not</emphasis> use domain patterns
1398     like <quote>*.org</quote> or partial domain names. If a DNS name resolves to multiple
1399     IP addresses, only the first one is used.
1400    </para>
1401    <para>
1402     Denying access to particular sites by ACL may have undesired side effects
1403     if the site in question is hosted on a machine which also hosts other sites.
1404    </para>
1405   </listitem>
1406  </varlistentry>
1407  <varlistentry>
1408   <term>Examples:</term>
1409   <listitem>
1410    <para>
1411     Explicitly define the default behavior if no ACL and
1412     <literal>listen-address</literal> are set: <quote>localhost</quote>
1413     is OK. The absence of a <replaceable class="parameter">dst_addr</replaceable> implies that
1414     <emphasis>all</emphasis> destination addresses are OK:
1415    </para>
1416    <para>
1417     <screen>
1418   permit-access  localhost
1419 </screen>
1420    </para>
1421    <para>
1422     Allow any host on the same class C subnet as www.privoxy.org access to
1423     nothing but www.example.com:
1424    </para>
1425    <para>
1426     <screen>
1427   permit-access  www.privoxy.org/24 www.example.com/32
1428 </screen>
1429    </para>
1430    <para>
1431     Allow access from any host on the 26-bit subnet 192.168.45.64 to anywhere,
1432     with the exception that 192.168.45.73 may not access www.dirty-stuff.example.com:
1433    </para>
1434    <para>
1435     <screen>
1436   permit-access  192.168.45.64/26
1437   deny-access    192.168.45.73    www.dirty-stuff.example.com
1438 </screen>
1439    </para>
1440   </listitem>
1441  </varlistentry>
1442 </variablelist>
1443 </sect3>
1444
1445
1446 <!--   ~~~~~       New section      ~~~~~     -->
1447 <sect3 renderas="sect4" id="buffer-limit"><title>buffer-limit</title>
1448
1449 <variablelist>
1450  <varlistentry>
1451   <term>Specifies:</term>
1452   <listitem>
1453    <para>
1454     Maximum size of the buffer for content filtering.
1455    </para>
1456   </listitem>
1457  </varlistentry>
1458  <varlistentry>
1459   <term>Type of value:</term>
1460   <listitem>
1461    <para>Size in Kbytes</para>
1462   </listitem>
1463  </varlistentry>
1464  <varlistentry>
1465   <term>Default value:</term>
1466   <listitem>
1467    <para>4096</para>
1468   </listitem>
1469  </varlistentry>
1470  <varlistentry>
1471   <term>Effect if unset:</term>
1472   <listitem>
1473    <para>
1474     Use a 4MB (4096 KB) limit.
1475    </para>
1476   </listitem>
1477  </varlistentry>
1478  <varlistentry>
1479   <term>Notes:</term>
1480   <listitem>
1481    <para>
1482     For content filtering, i.e. the <literal>+filter</literal> and
1483     <literal>+deanimate-gif</literal> actions, it is necessary that 
1484     <application>Privoxy</application> buffers the entire document body.
1485     This can be potentially dangerous, since a server could just keep sending
1486     data indefinitely and wait for your RAM to exhaust -- with nasty consequences.
1487     Hence this option.
1488    </para>
1489    <para>
1490     When a document buffer size reaches the <literal>buffer-limit</literal>, it is
1491     flushed to the client unfiltered and no further attempt to
1492     filter the rest of the document is made. Remember that there may be multiple threads
1493     running, which might require up to <literal>buffer-limit</literal> Kbytes
1494     <emphasis>each</emphasis>, unless you have enabled <quote>single-threaded</quote>
1495     above.
1496    </para>
1497   </listitem>
1498  </varlistentry>
1499 </variablelist>
1500
1501 <![%config-file;[<literallayout>@@buffer-limit 4096</literallayout>]]>
1502 </sect3>
1503
1504 </sect2>
1505
1506 <!--  ~  End section  ~  -->
1507
1508
1509 <!--   ~~~~~       New section      ~~~~~     -->
1510
1511 <sect2 id="forwarding">
1512 <title>Forwarding</title>
1513
1514 <para>
1515  This feature allows routing of HTTP requests through a chain of
1516  multiple proxies.
1517  It can be used to better protect privacy and confidentiality when
1518  accessing specific domains by routing requests to those domains
1519  through an anonymous public proxy (see e.g. <ulink
1520  url="http://www.multiproxy.org/anon_list.htm">http://www.multiproxy.org/anon_list.htm</ulink>)
1521  Or to use a caching proxy to speed up browsing. Or chaining to a parent
1522  proxy may be necessary because the machine that <application>Privoxy</application>
1523  runs on has no direct Internet access.
1524 </para>
1525
1526 <para>
1527  Also specified here are SOCKS proxies. <application>Privoxy</application>
1528  supports the SOCKS 4 and SOCKS 4A protocols.
1529 </para>
1530
1531 <sect3 renderas="sect4" id="forward"><title>forward</title>
1532 <variablelist>
1533  <varlistentry>
1534   <term>Specifies:</term>
1535   <listitem>
1536    <para>
1537     To which parent HTTP proxy specific requests should be routed.
1538    </para>
1539   </listitem>
1540  </varlistentry>
1541  <varlistentry>
1542   <term>Type of value:</term>
1543   <listitem>
1544    <para>
1545     <replaceable class="parameter">target_pattern</replaceable>
1546     <replaceable class="parameter">http_parent</replaceable>[:<replaceable class="parameter">port</replaceable>]
1547    </para>
1548    <para>
1549     where <replaceable class="parameter">target_pattern</replaceable> is a <link linkend="af-patterns">URL pattern</link> 
1550     that specifies to which requests (i.e. URLs) this forward rule shall apply. Use <literal>/</literal> to
1551     denote <quote>all URLs</quote>.
1552     <replaceable class="parameter">http_parent</replaceable>[:<replaceable class="parameter">port</replaceable>]
1553     is the DNS name or IP address of the parent HTTP proxy through which the requests should be forwarded,
1554     optionally followed by its listening port (default: 8080).
1555     Use a single dot (<literal>.</literal>) to denote <quote>no forwarding</quote>.
1556    </para>
1557   </listitem>
1558  </varlistentry>
1559  <varlistentry>
1560   <term>Default value:</term>
1561   <listitem>
1562    <para><emphasis>Unset</emphasis></para>
1563   </listitem>
1564  </varlistentry>
1565  <varlistentry>
1566   <term>Effect if unset:</term>
1567   <listitem>
1568    <para>
1569     Don't use parent HTTP proxies.
1570    </para>
1571   </listitem>
1572  </varlistentry>
1573  <varlistentry>
1574   <term>Notes:</term>
1575   <listitem>
1576    <para>
1577     If <replaceable class="parameter">http_parent</replaceable> is <quote>.</quote>, then requests are not
1578     forwarded to another HTTP proxy but are made directly to the web servers.
1579    </para>
1580    <para>
1581     Multiple lines are OK, they are checked in sequence, and the last match wins.
1582    </para>
1583   </listitem>
1584  </varlistentry>
1585  <varlistentry>
1586   <term>Examples:</term>
1587   <listitem>
1588    <para>
1589     Everything goes to an example anonymizing proxy, except SSL on port 443 (which it doesn't handle):
1590    </para>
1591    <para>
1592     <screen>
1593   forward   /      anon-proxy.example.org:8080
1594   forward   :443   .
1595 </screen>
1596    </para>
1597    <para>
1598     Everything goes to our example ISP's caching proxy, except for requests
1599     to that ISP's sites:
1600    </para>
1601    <para>
1602     <screen>
1603   forward   /                  caching-proxy.example-isp.net:8000
1604   forward   .example-isp.net   .
1605 </screen>
1606    </para>
1607   </listitem>
1608  </varlistentry>
1609 </variablelist>
1610 </sect3>
1611
1612
1613 <!--   ~~~~~       New section      ~~~~~     -->
1614 <sect3 renderas="sect4" id="socks"><title>
1615 forward-socks4 and forward-socks4a</title>
1616 <anchor id="forward-socks4">
1617 <anchor id="forward-socks4a">
1618
1619 <variablelist>
1620  <varlistentry>
1621   <term>Specifies:</term>
1622   <listitem>
1623    <para>
1624     Through which SOCKS proxy (and to which parent HTTP proxy) specific requests should be routed.
1625    </para>
1626   </listitem>
1627  </varlistentry>
1628  <varlistentry>
1629   <term>Type of value:</term>
1630   <listitem>
1631    <para>
1632     <replaceable class="parameter">target_pattern</replaceable>
1633     <replaceable class="parameter">socks_proxy</replaceable>[:<replaceable class="parameter">port</replaceable>]
1634     <replaceable class="parameter">http_parent</replaceable>[:<replaceable class="parameter">port</replaceable>]
1635    </para>
1636    <para>
1637     where <replaceable class="parameter">target_pattern</replaceable> is a <link linkend="af-patterns">URL pattern</link> 
1638     that specifies to which requests (i.e. URLs) this forward rule shall apply. Use <literal>/</literal> to
1639     denote <quote>all URLs</quote>.
1640     <replaceable class="parameter">http_parent</replaceable> and <replaceable class="parameter">socks_proxy</replaceable>
1641     are IP addresses in dotted decimal notation or valid DNS names (<replaceable class="parameter">http_parent</replaceable>
1642     may be <quote>.</quote> to denote <quote>no HTTP forwarding</quote>), and the optional 
1643     <replaceable class="parameter">port</replaceable> parameters are TCP ports, i.e. integer values from 1 to 64535
1644    </para>
1645   </listitem>
1646  </varlistentry>
1647  <varlistentry>
1648   <term>Default value:</term>
1649   <listitem>
1650    <para><emphasis>Unset</emphasis></para>
1651   </listitem>
1652  </varlistentry>
1653  <varlistentry>
1654   <term>Effect if unset:</term>
1655   <listitem>
1656    <para>
1657     Don't use SOCKS proxies.
1658    </para>
1659   </listitem>
1660  </varlistentry>
1661  <varlistentry>
1662   <term>Notes:</term>
1663   <listitem>
1664    <para>
1665     Multiple lines are OK, they are checked in sequence, and the last match wins.
1666    </para>
1667    <para>
1668     The difference between <literal>forward-socks4</literal> and <literal>forward-socks4a</literal>
1669     is that in the SOCKS 4A protocol, the DNS resolution of the target hostname happens on the SOCKS
1670     server, while in SOCKS 4 it happens locally.
1671    </para>
1672    <para>
1673     If <replaceable class="parameter">http_parent</replaceable> is <quote>.</quote>, then requests are not
1674     forwarded to another HTTP proxy but are made (HTTP-wise) directly to the web servers, albeit through
1675     a SOCKS proxy.
1676    </para>
1677   </listitem>
1678  </varlistentry>
1679  <varlistentry>
1680   <term>Examples:</term>
1681   <listitem>
1682    <para>
1683      From the company example.com, direct connections are made to all
1684      <quote>internal</quote> domains, but everything outbound goes through
1685      their ISP's proxy by way of example.com's corporate SOCKS 4A gateway to
1686      the Internet.
1687    </para>
1688    <para>
1689     <screen>
1690   forward-socks4a   /              socks-gw.example.com:1080  www-cache.example-isp.net:8080
1691   forward           .example.com   .
1692 </screen>
1693    </para>
1694    <para>
1695     A rule that uses a SOCKS 4 gateway for all destinations but no HTTP parent looks like this:
1696    </para>
1697    <para>
1698     <screen>
1699   forward-socks4   /               socks-gw.example.com:1080  .
1700 </screen>
1701    </para>
1702   </listitem>
1703  </varlistentry>
1704 </variablelist>
1705 </sect3>
1706
1707 <![%user-man;[     <!-- not included in config due to length -->
1708 <!--   ~~~~~       New section      ~~~~~     -->
1709 <sect3 renderas="sect4" id="advanced-forwarding-examples"><title>Advanced Forwarding Examples</title>
1710
1711 <para>
1712  If you have links to multiple ISPs that provide various special content 
1713  only to their subscribers, you can configure multiple <application>Privoxies</application>
1714  which have connections to the respective ISPs to act as forwarders to each other, so that
1715  <emphasis>your</emphasis> users can see the internal content of all ISPs.
1716 </para>
1717
1718 <para>
1719  Assume that host-a has a PPP connection to isp-a.net. And host-b has a PPP connection to
1720  isp-b.net. Both run <application>Privoxy</application>. Their forwarding
1721  configuration can look like this:
1722 </para>
1723
1724 <para>
1725  host-a:
1726 </para>
1727
1728 <para>
1729  <screen>
1730   forward    /           .
1731   forward    .isp-b.net  host-b:8118
1732 </screen>
1733 </para>
1734
1735 <para>
1736  host-b:
1737 </para>
1738
1739 <para>
1740  <screen>
1741   forward    /           .
1742   forward    .isp-a.net  host-a:8118
1743 </screen>
1744 </para>
1745
1746 <para>
1747  Now, your users can set their browser's proxy to use either
1748  host-a or host-b and be able to browse the internal content
1749  of both isp-a and isp-b.
1750 </para>
1751
1752 <para>
1753  If you intend to chain <application>Privoxy</application> and 
1754  <application>squid</application> locally, then chain as 
1755  <literal>browser -> squid -> privoxy</literal> is the recommended way. 
1756 </para>
1757
1758 <para>
1759  Assuming that <application>Privoxy</application> and <application>squid</application>
1760  run on the same box, your <application>squid</application> configuration could then look like this:
1761 </para>
1762
1763 <para>
1764  <screen>
1765   # Define Privoxy as parent proxy (without ICP) 
1766   cache_peer 127.0.0.1 parent 8118 7 no-query 
1767
1768   # Define ACL for protocol FTP 
1769   acl ftp proto FTP 
1770
1771   # Do not forward FTP requests to Privoxy
1772   always_direct allow ftp 
1773
1774   # Forward all the rest to Privoxy
1775   never_direct allow all</screen>
1776 </para>
1777
1778 <para>
1779  You would then need to change your browser's proxy settings to <application>squid</application>'s address and port.
1780  Squid normally uses port 3128. If unsure consult <literal>http_port</literal> in <filename>squid.conf</filename>.
1781 </para>
1782
1783 <para>
1784  You could just as well decide to only forward requests for Windows executables through
1785  a virus-scanning parent proxy, say, on <literal>antivir.example.com</literal>, port 8010:
1786 </para>
1787
1788 <para>
1789  <screen>
1790   forward   /                          .
1791   forward   /.*\.(exe|com|dll|zip)$    antivir.example.com:8010</screen> 
1792 </para>
1793
1794 </sect3>
1795 ]]>
1796
1797 </sect2>
1798
1799 <!--  ~  End section  ~  -->
1800
1801
1802 <!--   ~~~~~       New section      ~~~~~     -->
1803
1804 <sect2 id="windows-gui">
1805 <title>Windows GUI Options</title>
1806 <para>
1807  <application>Privoxy</application> has a number of options specific to the
1808  Windows GUI interface:
1809 </para>
1810
1811 <anchor id="activity-animation">
1812 <![%config-file;[<para>@@</para>]]> <!-- for spacing -->
1813 <para>
1814  If <quote>activity-animation</quote> is set to 1, the
1815  <application>Privoxy</application> icon will animate when
1816  <quote>Privoxy</quote> is active. To turn off, set to 0.
1817 </para>
1818
1819 <![%config-file;[<literallayout>@@#activity-animation   1</literallayout>]]>
1820 <![%user-man;[
1821 <para>
1822  <literal>
1823   <msgtext> 
1824    <literallayout>
1825   <emphasis>activity-animation   1</emphasis>
1826    </literallayout>
1827   </msgtext> 
1828  </literal>
1829 </para>
1830 ]]>
1831
1832 <anchor id="log-messages">
1833 <![%config-file;[<para>@@</para>]]> <!-- for spacing -->
1834 <para>
1835  If <quote>log-messages</quote> is set to 1,
1836  <application>Privoxy</application> will log messages to the console
1837  window:
1838 </para>
1839
1840 <![%config-file;[<literallayout>@@#log-messages   1</literallayout>]]>
1841 <![%user-man;[
1842 <para>
1843  <literal>
1844   <msgtext> 
1845    <literallayout>
1846   <emphasis>log-messages       1</emphasis>
1847    </literallayout>
1848   </msgtext> 
1849  </literal>
1850 </para>
1851 ]]>
1852
1853 <anchor id="log-buffer-size">
1854 <![%config-file;[<para>@@</para>]]> <!-- for spacing -->
1855 <para> 
1856  If <quote>log-buffer-size</quote> is set to 1, the size of the log buffer,
1857  i.e. the amount of memory used for the log messages displayed in the
1858  console window, will be limited to <quote>log-max-lines</quote> (see below).
1859 </para>
1860
1861 <para>
1862  Warning: Setting this to 0 will result in the buffer to grow infinitely and
1863  eat up all your memory!
1864 </para>
1865
1866 <![%config-file;[<literallayout>@@#log-buffer-size 1</literallayout>]]>
1867 <![%user-man;[
1868 <para>
1869  <literal>
1870   <msgtext> 
1871    <literallayout>
1872   <emphasis>log-buffer-size      1</emphasis>
1873    </literallayout>
1874   </msgtext> 
1875  </literal>
1876 </para>
1877 ]]>
1878
1879 <anchor id="log-max-lines">
1880 <![%config-file;[<para>@@</para>]]> <!-- for spacing -->
1881 <para>
1882  <application>log-max-lines</application> is the maximum number of lines held
1883  in the log buffer. See above.
1884 </para>
1885
1886 <![%config-file;[<literallayout>@@#log-max-lines 200</literallayout>]]>
1887 <![%user-man;[
1888 <para>
1889  <literal>
1890   <msgtext> 
1891    <literallayout>
1892   <emphasis>log-max-lines      200</emphasis>
1893    </literallayout>
1894   </msgtext> 
1895  </literal>
1896 </para>
1897 ]]>
1898
1899 <anchor id="log-highlight-messages">
1900 <![%config-file;[<para>@@</para>]]> <!-- for spacing -->
1901 <para>
1902  If <quote>log-highlight-messages</quote> is set to 1,
1903  <application>Privoxy</application> will highlight portions of the log
1904  messages with a bold-faced font:
1905 </para>
1906
1907 <![%config-file;[<literallayout>@@#log-highlight-messages 1</literallayout>]]>
1908 <![%user-man;[
1909 <para>
1910  <literal>
1911   <msgtext> 
1912    <literallayout>
1913   <emphasis>log-highlight-messages   1</emphasis>
1914    </literallayout>
1915   </msgtext> 
1916  </literal>
1917 </para>
1918 ]]>
1919
1920 <anchor id="log-font-name">
1921 <![%config-file;[<para>@@</para>]]> <!-- for spacing -->
1922 <para>
1923  The font used in the console window:
1924 </para>
1925
1926 <![%config-file;[<literallayout>@@#log-font-name Comic Sans MS</literallayout>]]>
1927 <![%user-man;[
1928 <para>
1929  <literal>
1930   <msgtext> 
1931    <literallayout>
1932   <emphasis>log-font-name        Comic Sans MS</emphasis>
1933    </literallayout>
1934   </msgtext> 
1935  </literal>
1936 </para>
1937 ]]>
1938
1939 <anchor id="log-font-size">
1940 <![%config-file;[<para>@@</para>]]> <!-- for spacing -->
1941 <para>
1942  Font size used in the console window:
1943 </para>
1944
1945 <![%config-file;[<literallayout>@@#log-font-size 8</literallayout>]]>
1946 <![%user-man;[
1947 <para>
1948  <literal>
1949   <msgtext> 
1950    <literallayout>
1951   <emphasis>log-font-size        8</emphasis>
1952    </literallayout>
1953   </msgtext> 
1954  </literal>
1955 </para>
1956 ]]>
1957
1958 <anchor id="show-on-task-bar">
1959 <![%config-file;[<para>@@</para>]]> <!-- for spacing -->
1960 <para>  
1961  <quote>show-on-task-bar</quote> controls whether or not
1962  <application>Privoxy</application> will appear as a button on the Task bar
1963  when minimized:
1964 </para>
1965
1966 <![%config-file;[<literallayout>@@#show-on-task-bar 0</literallayout>]]>
1967 <![%user-man;[
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
1979 <anchor id="close-button-minimizes">
1980 <![%config-file;[<para>@@</para>]]> <!-- for spacing -->
1981 <para>
1982  If <quote>close-button-minimizes</quote> is set to 1, the Windows close
1983  button will minimize <application>Privoxy</application> instead of closing
1984  the program (close with the exit option on the File menu).
1985 </para>
1986
1987 <![%config-file;[<literallayout>@@#close-button-minimizes 1</literallayout>]]>
1988 <![%user-man;[
1989 <para>
1990  <literal>
1991   <msgtext> 
1992    <literallayout>
1993   <emphasis>close-button-minimizes  1</emphasis>
1994    </literallayout>
1995   </msgtext> 
1996  </literal>
1997 </para>
1998 ]]>
1999
2000 <anchor id="hide-console">
2001 <![%config-file;[<para>@@</para>]]> <!-- for spacing -->
2002 <para>
2003  The <quote>hide-console</quote> option is specific to the MS-Win console
2004  version of <application>Privoxy</application>. If this option is used,
2005  <application>Privoxy</application> will disconnect from and hide  the
2006  command console.
2007 </para>
2008
2009 <![%config-file;[<literallayout>@@#hide-console</literallayout>]]>
2010 <![%user-man;[
2011 <para>
2012  <literal>
2013   <msgtext> 
2014    <literallayout>
2015   #<emphasis>hide-console</emphasis>
2016    </literallayout>
2017   </msgtext> 
2018  </literal>
2019 </para>
2020 ]]>
2021
2022 </sect2>
2023 </sect1>
2024
2025 <!-- end config content common to both outputs -->
2026
2027 <![%config-file;[
2028 <!-- These are dummy anchors to keep the processor quiet            -->
2029 <!-- when building config-file only (ie. they are used in u-m only) -->
2030 <sect1 label="">
2031 <title></title>
2032 <anchor id="filter">
2033 <anchor id="filter-file">
2034 <anchor id="regex">
2035 <anchor id="actions-file">
2036 <anchor id="af-patterns">
2037 </sect1>
2038 ]]>
2039
2040 <!-- eof p-config.sgml -->