- <screen>
- forward-socks4 .*. socks-gw.example.com:1080 .
-</screen>
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-</sect3>
-
-<sect3 renderas="sect4" id="advanced-forwarding-examples"><title>Advanced Forwarding Examples</title>
-
-<para>
- If you have links to multiple ISPs that provide various special content
- only to their subscribers, you can configure multiple <application>Privoxies</application>
- which have connections to the respective ISPs to act as forwarders to each other, so that
- <emphasis>your</emphasis> users can see the internal content of all ISPs.
-</para>
-
-<para>
- Assume that host-a has a PPP connection to isp-a.net. And host-b has a PPP connection to
- isp-b.net. Both run <application>Privoxy</application>. Their forwarding
- configuration can look like this:
-</para>
-
-<para>
- host-a:
-</para>
-
-<para>
- <screen>
- forward .*. .
- forward .isp-b.net host-b:8118
-</screen>
-</para>
-
-<para>
- host-b:
-</para>
-
-<para>
- <screen>
- forward .*. .
- forward .isp-a.net host-a:8118
-</screen>
-</para>
-
-<para>
- Now, your users can set their browser's proxy to use either
- host-a or host-b and be able to browse the internal content
- of both isp-a and isp-b.
-</para>
-
-<para>
- If you intend to chain <application>Privoxy</application> and
- <application>squid</application> locally, then chain as
- <literal>browser -> squid -> privoxy</literal> is the recommended way.
-</para>
-
-<para>
- Assuming that <application>Privoxy</application> and <application>squid</application>
- run on the same box, your squid configuration could then look like this:
-</para>
-
-<para>
- <screen>
- # Define Privoxy as parent proxy (without ICP)
- cache_peer 127.0.0.1 parent 8118 7 no-query
-
- # Define ACL for protocol FTP
- acl ftp proto FTP
-
- # Do not forward FTP requests to Privoxy
- always_direct allow ftp
-
- # Forward all the rest to Privoxy
- never_direct allow all</screen>
-</para>
-
-<para>
- You would then need to change your browser's proxy settings to <application>squid</application>'s address and port.
- Squid normally uses port 3128. If unsure consult <literal>http_port</literal> in <filename>squid.conf</filename>.
-</para>
-
-</sect3>
-
-</sect2>
-
-<!-- ~ End section ~ -->
-
-
-<!-- ~~~~~ New section ~~~~~ -->
-
-<sect2 id="windows-gui">
-<title>Windows GUI Options</title>
-<para>
- <application>Privoxy</application> has a number of options specific to the
- Windows GUI interface:
-</para>
-
-<anchor id="activity-animation">
-<para>
- If <quote>activity-animation</quote> is set to 1, the
- <application>Privoxy</application> icon will animate when
- <quote>Privoxy</quote> is active. To turn off, set to 0.
-</para>
-
-<para>
- <literal>
- <msgtext>
- <literallayout>
- <emphasis>activity-animation 1</emphasis>
- </literallayout>
- </msgtext>
- </literal>
-</para>
-
-<anchor id="log-messages">
-<para>
- If <quote>log-messages</quote> is set to 1,
- <application>Privoxy</application> will log messages to the console
- window:
-</para>
-
-<para>
- <literal>
- <msgtext>
- <literallayout>
- <emphasis>log-messages 1</emphasis>
- </literallayout>
- </msgtext>
- </literal>
-</para>
-
-<anchor id="log-buffer-size">
-<para>
- If <quote>log-buffer-size</quote> is set to 1, the size of the log buffer,
- i.e. the amount of memory used for the log messages displayed in the
- console window, will be limited to <quote>log-max-lines</quote> (see below).
-</para>
-
-<para>
- Warning: Setting this to 0 will result in the buffer to grow infinitely and
- eat up all your memory!
-</para>
-
-<para>
- <literal>
- <msgtext>
- <literallayout>
- <emphasis>log-buffer-size 1</emphasis>
- </literallayout>
- </msgtext>
- </literal>
-</para>
-
-<anchor id="log-max-lines">
-<para>
- <application>log-max-lines</application> is the maximum number of lines held
- in the log buffer. See above.
-</para>
-
-<para>
- <literal>
- <msgtext>
- <literallayout>
- <emphasis>log-max-lines 200</emphasis>
- </literallayout>
- </msgtext>
- </literal>
-</para>
-
-<anchor id="log-highlight-messages">
-<para>
- If <quote>log-highlight-messages</quote> is set to 1,
- <application>Privoxy</application> will highlight portions of the log
- messages with a bold-faced font:
-</para>
-
-<para>
- <literal>
- <msgtext>
- <literallayout>
- <emphasis>log-highlight-messages 1</emphasis>
- </literallayout>
- </msgtext>
- </literal>
-</para>
-
-<anchor id="log-font-name">
-<para>
- The font used in the console window:
-</para>
-
-<para>
- <literal>
- <msgtext>
- <literallayout>
- <emphasis>log-font-name Comic Sans MS</emphasis>
- </literallayout>
- </msgtext>
- </literal>
-</para>
-
-<anchor id="log-font-size">
-<para>
- Font size used in the console window:
-</para>
-
-<para>
- <literal>
- <msgtext>
- <literallayout>
- <emphasis>log-font-size 8</emphasis>
- </literallayout>
- </msgtext>
- </literal>
-</para>
-
-<anchor id="show-on-task-bar">
-<para>
- <quote>show-on-task-bar</quote> controls whether or not
- <application>Privoxy</application> will appear as a button on the Task bar
- when minimized:
-</para>
-
-<para>
- <literal>
- <msgtext>
- <literallayout>
- <emphasis>show-on-task-bar 0</emphasis>
- </literallayout>
- </msgtext>
- </literal>
-</para>
-
-<anchor id="close-button-minimizes">
-<para>
- If <quote>close-button-minimizes</quote> is set to 1, the Windows close
- button will minimize <application>Privoxy</application> instead of closing
- the program (close with the exit option on the File menu).
-</para>
-
-<para>
- <literal>
- <msgtext>
- <literallayout>
- <emphasis>close-button-minimizes 1</emphasis>
- </literallayout>
- </msgtext>
- </literal>
-</para>
-
-<anchor id="hide-console">
-<para>
- The <quote>hide-console</quote> option is specific to the MS-Win console
- version of <application>Privoxy</application>. If this option is used,
- <application>Privoxy</application> will disconnect from and hide the
- command console.
-</para>
-
-<para>
- <literal>
- <msgtext>
- <literallayout>
- #<emphasis>hide-console</emphasis>
- </literallayout>
- </msgtext>
- </literal>
-</para>
-
-</sect2>
-</sect1>
-
-<!-- ~ End section ~ -->
-
-
-
-<!-- ~~~~~~~~ New section Header ~~~~~~~~~ -->
-
-<sect1 id="actions-file"><title>Actions Files</title>
-
-<para>
- The actions files are used to define what actions
- <application>Privoxy</application> takes for which URLs, and thus determine
- how ad images, cookies and various other aspects of HTTP content and
- transactions are handled, and on which sites (or even parts thereof). There
- are three such files included with <application>Privoxy</application> (as of
- version 2.9.15), with differing purposes:
- </para>
-
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <filename>default.action</filename> - is the primary action file
- that sets the initial values for all actions. It is intended to
- provide a base level of functionality for
- <application>Privoxy's</application> array of features. So it is
- a set of broad rules that should work reasonably well for users everywhere.
- This is the file that the developers are keeping updated, and making
- available to users.
- </para>
- </listitem>
- <listitem>
- <para>
- <filename>user.action</filename> - is intended to be for local site
- preferences and exceptions. As an example, if your ISP or your bank
- has specific requirements, and need special handling, this kind of
- thing should go here. This file will not be upgraded.
- </para>
- </listitem>
- <listitem>
- <para>
- <filename>standard.action</filename> - is used by the web based editor,
- to set various pre-defined sets of rules for the default actions section
- in <filename>default.action</filename>. These have increasing levels of
- aggressiveness <emphasis>and have no influence on your browsing unless
- you select them explicitly in the editor</emphasis>. It is not recommend
- to edit this file.
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
-<para>
- The list of actions files to be used are defined in the main configuration
- file, and are processed in the order they are defined. The content of these
- can all be viewed and edited from <ulink
- url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>.
-</para>
-
-<para>
- An actions file typically has multiple sections. If you want to use
- <quote>aliases</quote> in an actions file, you have to place the (optional)
- <link linkend="aliases">alias section</link> at the top of that file.
- Then comes the default set of rules which will apply universally to all
- sites and pages (be <emphasis>very careful</emphasis> with using such a
- universal set in <filename>user.action</filename> or any other actions file after
- <filename>default.action</filename>, because it will override the result
- from consulting any previous file). And then below that,
- exceptions to the defined universal policies. You can regard
- <filename>user.action</filename> as an appendix to <filename>default.action</filename>,
- with the advantage that is a separate file, which makes preserving your
- personal settings across <application>Privoxy</application> upgrades easier.
-</para>
-
-<para>
- Actions can be used to block anything you want, including ads, banners, or
- just some obnoxious URL that you would rather not see. Cookies can be accepted
- or rejected, or accepted only during the current browser session (i.e. not
- written to disk), content can be modified, JavaScripts tamed, user-tracking
- fooled, and much more. See below for a <link linkend="actions">complete list
- of actions</link>.
-</para>
-
-<!-- ~~~~~ New section ~~~~~ -->
-<sect2>
-<title>Finding the Right Mix</title>
-<para>
- Note that some <link linkend="actions">actions</link>, like cookie suppression
- or script disabling, may render some sites unusable that rely on these
- techniques to work properly. Finding the right mix of actions is not always easy and
- certainly a matter of personal taste. In general, it can be said that the more
- <quote>aggressive</quote> your default settings (in the top section of the
- actions file) are, the more exceptions for <quote>trusted</quote> sites you
- will have to make later. If, for example, you want to kill popup windows per
- default, you'll have to make exceptions from that rule for sites that you
- regularly use and that require popups for actually useful content, like maybe
- your bank, favorite shop, or newspaper.
-</para>
-
-<para>
- We have tried to provide you with reasonable rules to start from in the
- distribution actions files. But there is no general rule of thumb on these
- things. There just are too many variables, and sites are constantly changing.
- Sooner or later you will want to change the rules (and read this chapter again :).
-</para>
-</sect2>
-
-<!-- ~~~~~ New section ~~~~~ -->
-<sect2>
-<title>How to Edit</title>
-<para>
- The easiest way to edit the actions files is with a browser by
- using our browser-based editor, which can be reached from <ulink
- url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>.
- The editor allows both fine-grained control over every single feature on a
- per-URL basis, and easy choosing from wholesale sets of defaults like
- <quote>Cautious</quote>, <quote>Medium</quote> or <quote>Advanced</quote>.
-</para>
-
-<para>
- If you prefer plain text editing to GUIs, you can of course also directly edit the
- the actions files. Look at <filename>default.action</filename> which is richly
- commented.
-</para>
-</sect2>
-
-
-<sect2 id="actions-apply">
-<title>How Actions are Applied to URLs</title>
-<para>
- Actions files are divided into sections. There are special sections,
- like the <quote><link linkend="aliases">alias</link></quote> sections which will
- be discussed later. For now let's concentrate on regular sections: They have a
- heading line (often split up to multiple lines for readability) which consist
- of a list of actions, separated by whitespace and enclosed in curly braces.
- Below that, there is a list of URL patterns, each on a separate line.
-</para>
-
-<para>
- To determine which actions apply to a request, the URL of the request is
- compared to all patterns in each action file file. Every time it matches, the list of
- applicable actions for the URL is incrementally updated, using the heading
- of the section in which the pattern is located. If multiple matches for
- the same URL set the same action differently, the last match wins. If not,
- the effects are aggregated. E.g. a URL might match a regular section with
- a heading line of <literal>{
- +<ulink url="actions-file.html#HANDLE-AS-IMAGE">handle-as-image</ulink> }</literal>,
- then later another one with just <literal>{
- +<ulink url="actions-file.html#BLOCK">block</ulink> }</literal>, resulting
- in <emphasis>both</emphasis> actions to apply.
-</para>
-
-<para>
- You can trace this process for any given URL by visiting <ulink
- url="http://config.privoxy.org/show-url-info">http://config.privoxy.org/show-url-info</ulink>.
-</para>
-
-<para>
- More detail on this is provided in the Appendix, <link linkend="ACTIONSANAT">
- Anatomy of an Action</link>.
-</para>
-</sect2>
-
-<!-- ~~~~~ New section ~~~~~ -->
-<sect2 id="af-patterns">
-<title>Patterns</title>
-<para>
- Generally, a pattern has the form <literal><domain>/<path></literal>,
- where both the <literal><domain></literal> and <literal><path></literal>
- are optional. (This is why the pattern <literal>/</literal> matches all URLs).
-</para>
-
-<variablelist>
- <varlistentry>
- <term><literal>www.example.com/</literal></term>
- <listitem>
- <para>
- is a domain-only pattern and will match any request to <literal>www.example.com</literal>,
- regardless of which document on that server is requested.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>www.example.com</literal></term>
- <listitem>
- <para>
- means exactly the same. For domain-only patterns, the trailing <literal>/</literal> may
- be omitted.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>www.example.com/index.html</literal></term>
- <listitem>
- <para>
- matches only the single document <literal>/index.html</literal>
- on <literal>www.example.com</literal>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>/index.html</literal></term>
- <listitem>
- <para>
- matches the document <literal>/index.html</literal>, regardless of the domain,
- i.e. on <emphasis>any</emphasis> web server.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>index.html</literal></term>
- <listitem>
- <para>
- matches nothing, since it would be interpreted as a domain name and
- there is no top-level domain called <literal>.html</literal>.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-
-
-<!-- ~~~~~ New section ~~~~~ -->
-<sect3><title>The Domain Pattern</title>
-
-<para>
- The matching of the domain part offers some flexible options: if the
- domain starts or ends with a dot, it becomes unanchored at that end.
- For example:
-</para>
-
-<variablelist>
- <varlistentry>
- <term><literal>.example.com</literal></term>
- <listitem>
- <para>
- matches any domain that <emphasis>ENDS</emphasis> in
- <literal>.example.com</literal>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>www.</literal></term>
- <listitem>
- <para>
- matches any domain that <emphasis>STARTS</emphasis> with
- <literal>www.</literal>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>.example.</literal></term>
- <listitem>
- <para>
- matches any domain that <emphasis>CONTAINS</emphasis> <literal>.example.</literal>
- (Correctly speaking: It matches any FQDN that contains <literal>example</literal> as a domain.)
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-
-<para>
- Additionally, there are wild-cards that you can use in the domain names
- themselves. They work pretty similar to shell wild-cards: <quote>*</quote>
- stands for zero or more arbitrary characters, <quote>?</quote> stands for
- any single character, you can define character classes in square
- brackets and all of that can be freely mixed:
-</para>
-
-<variablelist>
- <varlistentry>
- <term><literal>ad*.example.com</literal></term>
- <listitem>
- <para>
- matches <quote>adserver.example.com</quote>,
- <quote>ads.example.com</quote>, etc but not <quote>sfads.example.com</quote>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>*ad*.example.com</literal></term>
- <listitem>
- <para>
- matches all of the above, and then some.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>.?pix.com</literal></term>
- <listitem>
- <para>
- matches <literal>www.ipix.com</literal>,
- <literal>pictures.epix.com</literal>, <literal>a.b.c.d.e.upix.com</literal> etc.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><literal>www[1-9a-ez].example.c*</literal></term>
- <listitem>
- <para>
- matches <literal>www1.example.com</literal>,
- <literal>www4.example.cc</literal>, <literal>wwwd.example.cy</literal>,
- <literal>wwwz.example.com</literal> etc., but <emphasis>not</emphasis>
- <literal>wwww.example.com</literal>.
- </para>
- </listitem>
- </varlistentry>
-</variablelist>
-
-</sect3>
-
-<!-- ~ End section ~ -->
-
-
-<!-- ~~~~~ New section ~~~~~ -->
-<sect3><title>The Path Pattern</title>
-
-<para>
- <application>Privoxy</application> uses Perl compatible regular expressions
- (through the <ulink url="http://www.pcre.org/">PCRE</ulink> library) for
- matching the path.
-</para>
-
-<para>
- There is an <link linkend="regex">Appendix</link> with a brief quick-start into regular
- expressions, and full (very technical) documentation on PCRE regex syntax is available on-line
- at <ulink url="http://www.pcre.org/man.txt">http://www.pcre.org/man.txt</ulink>.
- You might also find the Perl man page on regular expressions (<literal>man perlre</literal>)
- useful, which is available on-line at <ulink
- url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>.
-</para>
-
-<para>
- Note that the path pattern is automatically left-anchored at the <quote>/</quote>,
- i.e. it matches as if it would start with a <quote>^</quote> (regular expression speak
- for the beginning of a line).
-</para>
-
-<para>
- Please also note that matching in the path is <emphasis>CASE INSENSITIVE</emphasis>
- by default, but you can switch to case sensitive at any point in the pattern by using the
- <quote>(?-i)</quote> switch: <literal>www.example.com/(?-i)PaTtErN.*</literal> will match
- only documents whose path starts with <literal>PaTtErN</literal> in
- <emphasis>exactly</emphasis> this capitalization.
-</para>
-</sect3>
-
-</sect2>
-
-<!-- ~ End section ~ -->
-
-
-<!-- ~~~~~ New section ~~~~~ -->
-
-<sect2 id="actions">
-<title>Actions</title>
-<para>
- All actions are disabled by default, until they are explicitly enabled
- somewhere in an actions file. Actions are turned on if preceded with a
- <quote>+</quote>, and turned off if preceded with a <quote>-</quote>. So a
- <literal>+action</literal> means <quote>do that action</quote>, e.g.
- <literal>+block</literal> means <quote>please block URLs that match the
- following patterns</quote>, and <literal>-block</literal> means <quote>don't
- block URLs that match the following patterns, even if <literal>+block</literal>
- previously applied.</quote>
-
-</para>
-
-<para>
- Again, actions are invoked by placing them on a line, enclosed in curly braces and
- separated by whitespace, like in
- <literal>{+some-action -some-other-action{some-parameter}}</literal>,
- followed by a list of URL patterns, one per line, to which they apply.
- Together, the actions line and the following pattern lines make up a section
- of the actions file.
-</para>
-
-<para>
- There are three classes of actions:
-</para>
-
-<para>
- <itemizedlist>
- <listitem>
- <para>
- Boolean, i.e the action can only be <quote>enabled</quote> or
- <quote>disabled</quote>. Syntax:
- </para>
- <para>
- <screen>
- +<replaceable class="function">name</replaceable> # enable action <replaceable class="parameter">name</replaceable>
- -<replaceable class="function">name</replaceable> # disable action <replaceable class="parameter">name</replaceable></screen>
- </para>
- <para>
- Example: <literal>+block</literal>
- </para>
- </listitem>
-
-
- <listitem>
- <para>
- Parameterized, where some value is required in order to enable this type of action.
- Syntax:
- </para>
- <para>
- <screen>
- +<replaceable class="function">name</replaceable>{<replaceable class="parameter">param</replaceable>} # enable action and set parameter to <replaceable class="parameter">param</replaceable>,
- # overwriting parameter from previous match if necessary
- -<replaceable class="function">name</replaceable> # disable action. The parameter can be omitted</screen>
- </para>
- <para>
- Note that if the URL matches multiple positive forms of a parameterized action,
- the last match wins, i.e. the params from earlier matches are simply ignored.
- </para>
- <para>
- Example: <literal>+hide-user-agent{ Mozilla 1.0 }</literal>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Multi-value. These look exactly like parameterized actions,
- but they behave differently: If the action applies multiple times to the
- same URL, but with different parameters, <emphasis>all</emphasis> the parameters
- from <emphasis>all</emphasis> matches are remembered. This is used for actions
- that can be executed for the same request repeatedly, like adding multiple
- headers, or filtering through multiple filters. Syntax:
- </para>
- <para>
- <screen>
- +<replaceable class="function">name</replaceable>{<replaceable class="parameter">param</replaceable>} # enable action and add <replaceable class="parameter">param</replaceable> to the list of parameters
- -<replaceable class="function">name</replaceable>{<replaceable class="parameter">param</replaceable>} # remove the parameter <replaceable class="parameter">param</replaceable> from the list of parameters
- # If it was the last one left, disable the action.
- <replaceable class="parameter">-name</replaceable> # disable this action completely and remove all parameters from the list</screen>
- </para>
- <para>
- Examples: <literal>+add-header{X-Fun-Header: Some text}</literal> and
- <literal>+filter{html-annoyances}</literal>
- </para>
- </listitem>
-
- </itemizedlist>
-</para>
-
-<para>
- If nothing is specified in any actions file, no <quote>actions</quote> are
- taken. So in this case <application>Privoxy</application> would just be a
- normal, non-blocking, non-anonymizing proxy. You must specifically enable the
- privacy and blocking features you need (although the provided default actions
- files will give a good starting point).
-</para>
-
-<para>
- Later defined actions always over-ride earlier ones. So exceptions
- to any rules you make, should come in the latter part of the file (or
- in a file that is processed later when using multiple actions files). For
- multi-valued actions, the actions are applied in the order they are specified.
- Actions files are processed in the order they are defined in
- <filename>config</filename> (the default installation has three actions
- files). It also quite possible for any given URL pattern to match more than
- one pattern and thus more than one set of actions!
-</para>
-
-<!-- start actions listing -->
-<para>
- The list of valid <application>Privoxy</application> actions are:
-</para>
-
-
-<!-- ********************************************************** -->
-<!-- Please note the below defined actions use id's that are -->
-<!-- probably linked from other places, so please don't change. -->
-<!-- -->
-<!-- ********************************************************** -->
-
-
-<!-- ~~~~~ New section ~~~~~ -->
-
-<sect3 renderas="sect4" id="add-header">
-<title>add-header</title>
-
-<variablelist>
- <varlistentry>
- <term>Typical use:</term>
- <listitem>
- <para>Confuse log analysis, custom applications</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Effect:</term>
- <listitem>
- <para>
- Sends a user defined HTTP header to the web server.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Type:</term>
- <!-- boolean, parameterized, Multi-value -->
- <listitem>
- <para>Multi-value.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Parameter:</term>
- <listitem>