Add a FAQ entry for tainted sockets
[privoxy.git] / doc / source / privoxy-man-page.sgml
index 4560bc1..dc12a6a 100644 (file)
@@ -4,22 +4,22 @@
  Purpose     :  Manual Page
                 This file belongs into
                 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
-                
- $Id: privoxy-man-page.sgml,v 1.14 2002/05/26 17:04:25 hal9 Exp $
 
- Copyright (C) 2001, 2002 Privoxy Developers <developers@privoxy.org>
+ $Id: privoxy-man-page.sgml,v 2.51 2016/01/21 15:55:49 fabiankeil Exp $
+
+ Copyright (C) 2001-2012 Privoxy Developers http://www.privoxy.org/
  See LICENSE.
 
  ========================================================================
- NOTE: Please read developer-manual/documentation.html before touching 
- anything in this, or other Privoxy documentation. 
+ NOTE: Please read developer-manual/documentation.html before touching
+ anything in this, or other Privoxy documentation.
  ========================================================================
 
  Doc NOTES: This is some tricky markup! There are some quirks
  to how this markup is handled. It is not always so co-operative.
- Please don't change the markup unless you can verify the changes 
- will improve finished output! 
+ Please don't change the markup unless you can verify the changes
+ will improve finished output!
+
  literallayout tags are particularly sensitive to where they are placed.
  The 'replaceable' and 'command' tags are used here somewhat unconventionally,
  since it seems to generate the proper formatting (at least for me :).
 
  Requires docbook2man (short perl script), see CVS
  http://sources.redhat.com/docbook-tools/. Also requires openjade and SGMLSpm
- perl module. 
+ perl module.
+
  For man page references, see:
  http://www.linuxdoc.org/HOWTO/mini/DocBook-Install/using.html
  http://docbook.org/tdg/en/html/ch02.html#making-refentry
 
 -->
 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN"[
-<!entity % dummy "IGNORE"> 
+<!entity % dummy "IGNORE">
 <!entity p-intro SYSTEM "privoxy.sgml">
 <!entity seealso SYSTEM "seealso.sgml">
 <!entity copyright SYSTEM "copyright.sgml">
 <!entity license SYSTEM "license.sgml">
 <!entity authors SYSTEM "p-authors.sgml">
-<!entity p-version "2.9.15">
-<!entity p-status "beta">
+<!entity p-version "3.0.25">
+<!entity p-status "UNRELEASED">
 <!entity % p-not-stable "INCLUDE">
 <!entity % p-stable "IGNORE">
 <!entity % p-text "IGNORE">           <!-- define we are not a text only doc -->
 <!entity % p-authors-formal "IGNORE"> <!-- exclude additional formating      -->
 <!entity my-copy "(C)">               <!-- db2man barfs on copyright symbol  -->
+<!entity % seealso-extra "IGNORE">    <!-- for excluding sections of seealso -->
 ]>
 
 <refentry id="privoxy">
 <refentryinfo>
- <date>2002-05-14</date>
+ <date>2012-11-08</date>
 </refentryinfo>
 <refmeta>
- <refentrytitle>privoxy</refentrytitle> 
+ <refentrytitle>privoxy</refentrytitle>
  <manvolnum>1</manvolnum>
  <refmiscinfo>
   Privoxy &p-version;<![%p-not-stable;[ &p-status;]]>
 </refnamediv>
 
 <refsynopsisdiv>
- <cmdsynopsis> 
+ <cmdsynopsis>
   <command>privoxy</command>
+  <arg><option>--chroot</option></arg>
+  <arg><option>--config-test</option></arg>
   <arg><option>--help</option></arg>
-  <arg><option>--version</option></arg>
   <arg><option>--no-daemon</option></arg>
-  <arg><option>--pidfile </option><replaceable class="parameter">pidfile</replaceable></arg>  
-  <arg><option>--user </option><replaceable class="parameter">user[.group]</replaceable></arg> 
-  <arg><replaceable class="parameter">configfile</replaceable></arg>        
-  <command>(UNIX)</command>
+  <arg><option>--pidfile </option><replaceable class="parameter">pidfile</replaceable></arg>
+  <arg><option>--pre-chroot-nslookup </option><replaceable class="parameter">hostname</replaceable></arg>
+  <arg><option>--user </option><replaceable class="parameter">user[.group]</replaceable></arg>
+  <arg><option>--version</option></arg>
+  <arg><replaceable class="parameter">configfile</replaceable></arg>
  </cmdsynopsis>
 
- <cmdsynopsis> 
-  <command>privoxy.exe</command>              
-  <arg><replaceable class="parameter">configfile</replaceable></arg>
-  <command>(Windows)</command>
- </cmdsynopsis>                                      
 </refsynopsisdiv>
 
 
   options:
  </para>
 
- <variablelist>                                          
+ <variablelist>
+
   <varlistentry>
-    <term>--help</term>
+    <term>--chroot</term>
+     <listitem>
+      <para>
+       Before changing to the user ID given in the --user option, chroot to
+       that user's home directory, i.e. make the kernel pretend to the
+       <command>Privoxy</command> process that the directory tree starts
+       there. If set up carefully, this can limit the impact of possible
+       vulnerabilities in <command>Privoxy</command> to the files contained in
+       that hierarchy.
+      </para>
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term>--config-test</term>
       <listitem>
        <para>
-         Print brief usage info and exit.
+         Exit after loading the configuration files before binding to
+         the listen address. The exit code signals whether or not the
+         configuration files have been successfully loaded.
+       </para>
+       <para>
+         If the exit code is 1, at least one of the configuration files
+         is invalid, if it is 0, all the configuration files have been
+         successfully loaded (but may still contain errors that can
+         currently only be detected at run time).
         </para>
+       <para>
+         This option doesn't affect the log setting, combination with
+         "--no-daemon" is recommended if a configured log file shouldn't
+         be used.
+       </para>
       </listitem>
   </varlistentry>
 
   <varlistentry>
-    <term>--version</term>
+    <term>--help</term>
       <listitem>
        <para>
-         Print version info and exit.
+         Print brief usage info and exit.
         </para>
       </listitem>
   </varlistentry>
       <para>
         On startup, write the process ID to <replaceable class="parameter">pidfile</replaceable>.
         Delete the <replaceable class="parameter">pidfile</replaceable> on exit.
-        Failiure to create or delete the <replaceable class="parameter">pidfile</replaceable>
+        Failure to create or delete the <replaceable class="parameter">pidfile</replaceable>
         is non-fatal. If no <command>--pidfile</command> option is given, no PID file will be used.
       </para>
     </listitem>
   </varlistentry>
 
+  <varlistentry>
+    <term>--pre-chroot-nslookup <replaceable class="parameter">hostname</replaceable></term>
+     <listitem>
+      <para>
+        Initialize the resolver library using <replaceable class="parameter">hostname</replaceable>
+        before chroot'ing. On some systems this reduces the number of files
+        that must be copied into the chroot tree.
+     </para>
+    </listitem>
+  </varlistentry>
+
   <varlistentry>
     <term>--user <replaceable class="parameter">user[.group]</replaceable></term>
      <listitem>
      </para>
     </listitem>
   </varlistentry>
+
+  <varlistentry>
+    <term>--version</term>
+      <listitem>
+       <para>
+         Print version info and exit.
+        </para>
+      </listitem>
+  </varlistentry>
+
  </variablelist>
+
  <para>
   If the <filename>configfile</filename> is not specified on  the  command  line,
   <command>Privoxy</command>  will  look for a file named
-  <filename>config</filename> in the current directory (except on Win32 where
-  it will try <filename>config.txt</filename>). If no
-  <filename>configfile</filename> is found, <command>Privoxy</command> will 
+  <filename>config</filename> in the current directory. If no
+  <filename>configfile</filename> is found, <command>Privoxy</command> will
   fail to start.
  </para>
 
 <!--   ~~~~~       New section      ~~~~~     -->
 <refsect1><title>Installation and Usage</title>
 <para>
- Browsers must be individually configured to use <command>Privoxy</command> as
- a HTTP proxy.  The default setting is  for  localhost,  on port  8118
- (configurable in the main config file).  To set the HTTP proxy in Netscape
- and Mozilla, go through:  <command>Edit</command>;
- <command>Preferences</command>;  <command>Advanced</command>;
- <command>Proxies</command>;  <command>Manual Proxy Configuration</command>;
- <command>View</command>. 
+ Browsers can either be individually configured to use
+ <command>Privoxy</command> as a HTTP proxy (recommended),
+ or <command>Privoxy</command> can be combined with a packet
+ filter to build an intercepting proxy
+ (see <filename>config</filename>).  The default setting is  for
+ localhost,  on port  8118 (configurable in the main config file).  To set the
+ HTTP proxy in Firefox, go through: <command>Tools</command>;
+ <command>Options</command>; <command>General</command>;
+ <command>Connection Settings</command>;
+ <command>Manual Proxy Configuration</command>.
 </para>
 <para>
- For Internet Explorer, go through: <command>Tools</command>; 
+ For Internet Explorer, go through: <command>Tools</command>;
  <command>Internet Properties</command>; <command>Connections</command>;
- <command>LAN Settings</command>. 
+ <command>LAN Settings</command>.
 </para>
 <para>
  The Secure (SSL) Proxy should also be set to the same values, otherwise
- https: URLs will not be proxied. 
+ https: URLs will not be proxied. Note: <command>Privoxy</command> can only
+ proxy HTTP and HTTPS traffic. Do not try it with FTP or other protocols.
+ HTTPS presents some limitations, and not all features will work with HTTPS
+ connections.
 </para>
+
 <para>
  For other browsers, check the documentation.
 </para>
 <para>
  <command>Privoxy</command> can be configured with the various configuration
  files. The default configuration files are: <filename>config</filename>,
- <filename>default.filter</filename>, and
- <filename>default.action</filename>. <filename>user.action</filename> should 
- be used for locally defined exceptions to the default rules of
- <filename>default.action</filename> These are all well commented.  On Unix
- and Unix-like systems, these are located in
- <filename>/etc/privoxy/</filename> by default. On Windows, OS/2 and AmigaOS,
- these files are in the same directory as the <command>Privoxy</command>
- executable.
+ <filename>default.filter</filename>, <filename>default.action</filename> and
+ <filename>default.action</filename>. <filename>user.action</filename> should
+ be used for locally defined exceptions to the default rules in
+ <filename>match-all.action</filename> and <filename>default.action</filename>,
+ and <filename>user.filter</filename> for locally defined filters. These are
+ well commented.  On Unix and Unix-like systems, these are located in
+ <filename>/etc/privoxy/</filename> by default.
 </para>
 <para>
- The name and number of configuration files has changed from previous
- versions<![%p-not-stable;[, and is subject to change as development
- progresses]]>. In fact, the configuration itself is changed  and  much more
- sophisticated. See the <ulink
- url="http://www.privoxy.org/user-manual/">user-manual</ulink> for a complete
- explanation of all configuration options and general usage, and notes for 
- upgrading from <command>Junkbuster</command> and earlier <command>Privoxy</command>
- versions.
+ <command>Privoxy</command> uses the concept of <command>actions</command>
+ in order to manipulate the data stream between the browser and remote sites.
+ There are various actions available with specific functions for such things
+ as blocking web sites, managing cookies, etc. These actions can be invoked
+ individually or combined, and used against individual URLs, or groups of URLs
+ that can be defined using wildcards and regular expressions. The result is
+ that the user has greatly enhanced control and freedom.
 </para>
 <para>
  The actions list (ad blocks, etc) can also be configured with your
- web browser at <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>.
+ web browser at <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
+ (assuming the configuration allows it).
  <command>Privoxy's</command> configuration parameters  can also  be viewed at
  the same page. In addition, <command>Privoxy</command> can be toggled on/off.
  This is an internal page, and does not require Internet access.
 </para>
-</refsect1>
-
-
-<!--   ~~~~~       New section      ~~~~~     -->
-<refsect1><title>Sample Configuration</title>
 <para>
- A brief example of what a simple <filename>default.action</filename>
- configuration might look like:
+ See the <ulink
+ url="http://www.privoxy.org/user-manual/"><citetitle>User Manual</citetitle></ulink> for a detailed
+ explanation of installation, general usage, all configuration options, new
+ features and notes on upgrading.
 </para>
-
-<literallayout>
- # Define a few useful custom aliases for later use
- {{alias}}
-
- # Useful aliases
- +crunch-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
- -crunch-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
- +imageblock      = +block +handle-as-image
-
- # Fragile sites should have the minimum changes
- fragile     = -block -deanimate-gifs -fast-redirects -filter \
-               -hide-referer -prevent-cookies -kill-popups
-
- ## Turn some actions on ################################
- { \
- -add-header \
- -block \
- +deanimate-gifs{last} \
- -downgrade-http-version \
- -fast-redirects \
- +filter{html-annoyances} \
- +filter{js-annoyances} \
- +filter{content-cookies} \
- +filter{webbugs} \
- +filter{banners-by-size} \
- +hide-forwarded-for-headers \
- +hide-from-header{block} \
- +hide-referrer{forge} \
- -hide-user-agent \
- -handle-as-image \
- +set-image-blocker{pattern} \
- -limit-connect \
- +prevent-compression \
- +session-cookies-only \
- -crunch-cookies \
- -kill-popups \
- }
- /   # '/' Matches *all* URL patterns
- # Block, and treat these URL patterns as if they were 'images'.
- # We would expect these to be ads.
- {+imageblock}
-  .ad.doubleclick.net
-  .a[0-9].yimg.com/(?:(?!/i/).)*$
-  ad.*.doubleclick.net
-
- # Block any URLs that match these patterns
- {+block}
-  ad*.
-  .*ads.
-  banner?.
-  /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
-  .hitbox.com 
-
- # Make exceptions for these harmless ones that would be 
- # caught by our +block patterns just above.
- {-block}
-  adsl.
-  advice.
-  .*downloads.
-
-</literallayout>
-
-<para>
- Then for a <filename>user.action</filename>, we would put local,
- narrowly defined exceptions:
-</para>
-
-<literallayout>
- # Re-define aliases as needed here
- {{alias}}
-
- # Useful aliases
- -crunch-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
- # Set personal exceptions to the policies in default.action #######
-
- # Sites where we want persistant cookies, so allow *all* cookies
- {-crunch-cookies -session-cookies-only}
-  .redhat.com
-  .sun.com
-  .msdn.microsoft.com
- # This site breaks easily.
- {-block -fast-redirects}
-  .forbes.com
-
-</literallayout>
-
-<para>
- See the comments in the configuration files themselves, or the 
- <citetitle>user-manual</citetitle>
- for explanations of the above syntax, and other <command>Privoxy</command>
- configuration options.
-</para>
-
 </refsect1>
 
 
+
 <!--   ~~~~~       New section      ~~~~~     -->
 <refsect1><title>Files</title>
 <!-- this is a cheesy way to do this, but WTF. -->
-<literallayout> 
+<literallayout>
  <filename>/usr/sbin/privoxy</filename>
  <filename>/etc/privoxy/config</filename>
+ <filename>/etc/privoxy/match-all.action</filename>
  <filename>/etc/privoxy/default.action</filename>
- <filename>/etc/privoxy/standard.action</filename>
  <filename>/etc/privoxy/user.action</filename>
  <filename>/etc/privoxy/default.filter</filename>
+ <filename>/etc/privoxy/user.filter</filename>
  <filename>/etc/privoxy/trust</filename>
  <filename>/etc/privoxy/templates/*</filename>
  <filename>/var/log/privoxy/logfile</filename>
 
 <para>
  Various other files should be included, but may vary depending on platform
- and build configuration. More documentation should be included in the local
+ and build configuration. Additional documentation should be included in the local
  documentation directory.
 </para>
 
 <refsect1><title>Signals</title>
 <para>
  <!-- command tag is used here to get proper looking format  -->
- <command>Privoxy</command> terminates on the <command>SIGINT</command>,
<command>SIGTERM</command> and <command>SIGABRT</command> signals. Log
- rotation scripts may cause a re-opening of the logfile by sending a 
+ <command>Privoxy</command> terminates on the <command>SIGINT</command>
and <command>SIGTERM</command> signals. Log
+ rotation scripts may cause a re-opening of the logfile by sending a
  <command>SIGHUP</command> to <command>Privoxy</command>. Note that unlike
  other daemons,  <command>Privoxy</command> does not need to be made aware of
  config file changes by <command>SIGHUP</command> -- it will detect them
- automatically. 
+ automatically. Signals other than the ones listed above aren't explicitly
+ handled and result in the default action defined by the operating system.
 </para>
 
 </refsect1>
 <refsect1><title>Notes</title>
 <![%p-not-stable;[
 <para>
- This is a &p-status; version of <command>Privoxy</command>. Not 
+ This is a &p-status; version of <command>Privoxy</command>. Not
  all features are well tested.
 </para>]]>
 <para>
  Please see the <citetitle>User Manual</citetitle> on how to contact the
- developers for feature requests, reporting problems, and other questions.
+ developers, for feature requests, reporting problems, and other questions.
 </para>
 
 </refsect1>