Rebuild docs with updated OS X instructions
[privoxy.git] / doc / webserver / user-manual / actions-file.html
index 993e9ca..a0efab2 100644 (file)
@@ -6,7 +6,7 @@
   <title>Actions Files</title>
   <meta name="GENERATOR" content=
   "Modular DocBook HTML Stylesheet Version 1.79">
-  <link rel="HOME" title="Privoxy 3.0.22 User Manual" href="index.html">
+  <link rel="HOME" title="Privoxy 3.0.24 User Manual" href="index.html">
   <link rel="PREVIOUS" title="The Main Configuration File" href=
   "config.html">
   <link rel="NEXT" title="Filter Files" href="filter-file.html">
@@ -21,7 +21,7 @@
     <table summary="Header navigation table" width="100%" border="0"
     cellpadding="0" cellspacing="0">
       <tr>
-        <th colspan="3" align="center">Privoxy 3.0.22 User Manual</th>
+        <th colspan="3" align="center">Privoxy 3.0.24 User Manual</th>
       </tr>
 
       <tr>
         in <tt class="FILENAME">default.action</tt> are:</p>
 
         <div class="TABLE">
-          <a name="AEN2891" id="AEN2891"></a>
+          <a name="AEN2614" id="AEN2614"></a>
 
           <p><b>Table 1. Default Configurations</b></p>
 
     actions</a>.</p>
 
     <div class="SECT2">
-      <h2 class="SECT2"><a name="AEN2990" id="AEN2990">8.1. Finding the Right
+      <h2 class="SECT2"><a name="AEN2713" id="AEN2713">8.1. Finding the Right
       Mix</a></h2>
 
       <p>Note that some <a href="actions-file.html#ACTIONS">actions</a>, like
     </div>
 
     <div class="SECT2">
-      <h2 class="SECT2"><a name="AEN2997" id="AEN2997">8.2. How to
+      <h2 class="SECT2"><a name="AEN2720" id="AEN2720">8.2. How to
       Edit</a></h2>
 
       <p>The easiest way to edit the actions files is with a browser by using
       </div>
 
       <div class="SECT3">
-        <h3 class="SECT3"><a name="AEN3191" id="AEN3191">8.4.2. The Path
+        <h3 class="SECT3"><a name="AEN2914" id="AEN2914">8.4.2. The Path
         Pattern</a></h3>
 
         <p><span class="APPLICATION">Privoxy</span> uses <span class=
             <dt>Type:</dt>
 
             <dd>
-              <p>Parameterized.</p>
+              <p>Multi-value.</p>
             </dd>
 
             <dt>Parameter:</dt>
             <dt>Type:</dt>
 
             <dd>
-              <p>Parameterized.</p>
+              <p>Multi-value.</p>
             </dd>
 
             <dt>Parameter:</dt>
@@ -2026,7 +2026,7 @@ problem-host.example.com
             <dt>Type:</dt>
 
             <dd>
-              <p>Parameterized.</p>
+              <p>Multi-value.</p>
             </dd>
 
             <dt>Parameter:</dt>
@@ -2050,7 +2050,10 @@ problem-host.example.com
               <p>External filters are scripts or programs that can modify the
               content in case common <tt class="LITERAL"><a href=
               "actions-file.html#FILTER">filters</a></tt> aren't powerful
-              enough.</p>
+              enough. With the exception that this action doesn't use
+              pcrs-based filters, the notes in the <tt class=
+              "LITERAL"><a href="actions-file.html#FILTER">filter</a></tt>
+              section apply.</p>
 
               <div class="WARNING">
                 <table class="WARNING" border="1" width="90%">
@@ -2243,7 +2246,7 @@ problem-host.example.com
             <dt>Type:</dt>
 
             <dd>
-              <p>Parameterized.</p>
+              <p>Multi-value.</p>
             </dd>
 
             <dt>Parameter:</dt>
@@ -2791,7 +2794,7 @@ problem-host.example.com
             <dt>Type:</dt>
 
             <dd>
-              <p>Multi-value.</p>
+              <p>Parameterized.</p>
             </dd>
 
             <dt>Parameter:</dt>
@@ -2830,6 +2833,30 @@ problem-host.example.com
                   <span class="QUOTE">"forward-socks5"</span> for socks5
                   connections (with remote DNS resolution).</p>
                 </li>
+
+                <li>
+                  <p><span class="QUOTE">"forward-webserver
+                  127.0.0.1:80"</span> to use the HTTP server listening at
+                  127.0.0.1 port 80 without adjusting the request
+                  headers.</p>
+
+                  <p>This makes it more convenient to use Privoxy to make
+                  existing websites available as onion services as well.</p>
+
+                  <p>Many websites serve content with hardcoded URLs and
+                  can't be easily adjusted to change the domain based on the
+                  one used by the client.</p>
+
+                  <p>Putting Privoxy between Tor and the webserver (or an
+                  stunnel that forwards to the webserver) allows to rewrite
+                  headers and content to make client and server happy at the
+                  same time.</p>
+
+                  <p>Using Privoxy for webservers that are only reachable
+                  through onion addresses and whose location is supposed to
+                  be secret is not recommended and should not be necessary
+                  anyway.</p>
+                </li>
               </ul>
             </dd>
 
@@ -2859,7 +2886,9 @@ problem-host.example.com
                       <p>If the ports are missing or invalid, default values
                       will be used. This might change in the future and you
                       shouldn't rely on it. Otherwise incorrect syntax causes
-                      Privoxy to exit.</p>
+                      Privoxy to exit. Due to design limitations, invalid
+                      parameter syntax isn't detected until the action is
+                      used the first time.</p>
 
                       <p>Use the <a href=
                       "http://config.privoxy.org/show-url-info" target=
@@ -2878,15 +2907,17 @@ problem-host.example.com
                 <tr>
                   <td>
                     <pre class="SCREEN">
-# Always use direct connections for requests previously tagged as
+# Use an ssh tunnel for requests previously tagged as
 # <span class="QUOTE">"User-Agent: fetch libfetch/2.0"</span> and make sure
 # resuming downloads continues to work.
+#
 # This way you can continue to use Tor for your normal browsing,
 # without overloading the Tor network with your FreeBSD ports updates
 # or downloads of bigger files like ISOs.
+#
 # Note that HTTP headers are easy to fake and therefore their
 # values are as (un)trustworthy as your clients and users.
-{+forward-override{forward .} \
+{+forward-override{forward-socks5 10.0.0.2:2222 .} \
  -hide-if-modified-since      \
  -overwrite-last-modified     \
 }
@@ -4012,11 +4043,15 @@ nasty-banner-server.example.com/junk.cgi\?output=trash
               <p>The syntax for pcrs commands is documented in the <a href=
               "filter-file.html">filter file</a> section.</p>
 
-              <p>This action will be ignored if you use it together with
-              <tt class="LITERAL"><a href=
-              "actions-file.html#BLOCK">block</a></tt>. It can be combined
-              with <tt class="LITERAL"><a href=
-              "actions-file.html#FAST-REDIRECTS">fast-redirects{check-decoded-url}</a></tt>
+              <p>Requests can't be blocked and redirected at the same time,
+              applying this action together with <tt class="LITERAL"><a href=
+              "actions-file.html#BLOCK">block</a></tt> is a configuration
+              error. Currently the request is blocked and an error message
+              logged, the behavior may change in the future and result in
+              Privoxy rejecting the action file.</p>
+
+              <p>This action can be combined with <tt class=
+              "LITERAL"><a href="actions-file.html#FAST-REDIRECTS">fast-redirects{check-decoded-url}</a></tt>
               to redirect to a decoded version of a rewritten URL.</p>
 
               <p>Use this action carefully, make sure not to create
@@ -4059,6 +4094,19 @@ undeadly.org/cgi\?action=article&amp;sid=\d*$
 {+redirect{s@^http://[^/]*/results\.aspx\?q=([^&amp;]*).*@http://search.yahoo.com/search?p=$1@}}
 search.msn.com//results\.aspx\?q=
 
+# Redirect http://example.com/&amp;bla=fasel&amp;toChange=foo (and any other value but "bar")
+# to       http://example.com/&amp;bla=fasel&amp;toChange=bar
+#
+# The URL pattern makes sure that the following request isn't redirected again.
+{+redirect{s@toChange=[^&amp;]+@toChange=bar@}}
+example.com/.*toChange=(?!bar)
+
+# Add a shortcut to look up illumos bugs
+{+redirect{s@^http://i([0-9]+)/.*@https://www.illumos.org/issues/$1@}}
+# Redirected URL = http://i4974/
+# Redirect Destination = https://www.illumos.org/issues/4974
+i[0-9][0-9][0-9][0-9]*/
+
 # Redirect remote requests for this manual
 # to the local version delivered by Privoxy
 {+redirect{s@^http://www@http://config@}}
@@ -4095,7 +4143,7 @@ www.privoxy.org/user-manual/
             <dt>Type:</dt>
 
             <dd>
-              <p>Parameterized.</p>
+              <p>Multi-value.</p>
             </dd>
 
             <dt>Parameter:</dt>
@@ -4168,7 +4216,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not
             <dt>Type:</dt>
 
             <dd>
-              <p>Parameterized.</p>
+              <p>Multi-value.</p>
             </dd>
 
             <dt>Parameter:</dt>
@@ -4208,6 +4256,15 @@ example.org/instance-that-is-delivered-as-xml-but-is-not
 {+server-header-tagger{content-type}}
 /
 
+# If the response has a tag starting with 'image/' enable an external
+# filter that only applies to images.
+#
+# Note that the filter is not available by default, it's just a
+# <tt class="LITERAL"><a href=
+"filter-file.html#EXTERNAL-FILTER-SYNTAX">silly example</a></tt>.
+{+external-filter{rotate-image} +force-text-mode}
+TAG:^image/
+
 </pre>
                   </td>
                 </tr>
@@ -4456,7 +4513,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not
       </div>
 
       <div class="SECT3">
-        <h3 class="SECT3"><a name="AEN4918" id="AEN4918">8.5.36.
+        <h3 class="SECT3"><a name="AEN4653" id="AEN4653">8.5.36.
         Summary</a></h3>
 
         <p>Note that many of these actions have the potential to cause a page
@@ -4615,7 +4672,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not
       together:</p>
 
       <div class="SECT3">
-        <h3 class="SECT3"><a name="AEN4982" id="AEN4982">8.7.1.
+        <h3 class="SECT3"><a name="AEN4717" id="AEN4717">8.7.1.
         match-all.action</a></h3>
 
         <p>Remember <span class="emphasis"><i class="EMPHASIS">all actions
@@ -4664,7 +4721,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not
       </div>
 
       <div class="SECT3">
-        <h3 class="SECT3"><a name="AEN5004" id="AEN5004">8.7.2.
+        <h3 class="SECT3"><a name="AEN4739" id="AEN4739">8.7.2.
         default.action</a></h3>
 
         <p>If you aren't a developer, there's no need for you to edit the
@@ -5007,7 +5064,7 @@ wiki.
       </div>
 
       <div class="SECT3">
-        <h3 class="SECT3"><a name="AEN5117" id="AEN5117">8.7.3.
+        <h3 class="SECT3"><a name="AEN4852" id="AEN4852">8.7.3.
         user.action</a></h3>
 
         <p>So far we are painting with a broad brush by setting general