Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
- <meta name="generator" content="HTML Tidy, see www.w3.org">
<title>
Actions Files
</title>
<meta name="GENERATOR" content=
"Modular DocBook HTML Stylesheet Version 1.79">
- <link rel="HOME" title="Privoxy 3.0.18 User Manual" href="index.html">
+ <link rel="HOME" title="Privoxy 3.0.26 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">
<link rel="STYLESHEET" type="text/css" href="../p_doc.css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="STYLESHEET" type="text/css" href="p_doc.css">
-<style type="text/css">
- body {
- background-color: #EEEEEE;
- color: #000000;
- }
- :link { color: #0000FF }
- :visited { color: #840084 }
- :active { color: #0000FF }
- p.c2 {font-weight: bold}
- hr.c1 {text-align: left}
-</style>
</head>
- <body class="SECT1">
+ <body class="SECT1" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink=
+ "#840084" alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
<th colspan="3" align="center">
- Privoxy 3.0.18 User Manual
+ Privoxy 3.0.26 User Manual
</th>
</tr>
<tr>
</td>
</tr>
</table>
- <hr width="100%" class="c1">
+ <hr align="LEFT" width="100%">
</div>
<div class="SECT1">
<h1 class="SECT1">
<p>
</p>
<div class="TABLE">
- <a name="AEN2625"></a>
- <p class="c2">
- Table 1. Default Configurations
+ <a name="AEN2791"></a>
+ <p>
+ <b>Table 1. Default Configurations</b>
</p>
<table border="1" frame="border" rules="all" class="CALSTABLE">
<col width="1*" title="C1">
</p>
<div class="SECT2">
<h2 class="SECT2">
- <a name="AEN2724">8.1. Finding the Right Mix</a>
+ <a name="RIGHT-MIX">8.1. Finding the Right Mix</a>
</h2>
<p>
Note that some <a href="actions-file.html#ACTIONS">actions</a>,
</div>
<div class="SECT2">
<h2 class="SECT2">
- <a name="AEN2731">8.2. How to Edit</a>
+ <a name="HOW-TO-EDIT">8.2. How to Edit</a>
</h2>
<p>
The easiest way to edit the actions files is with a browser by
</p>
<p>
Generally, an URL pattern has the form <tt class=
- "LITERAL"><domain><port>/<path></tt>, where the
- <tt class="LITERAL"><domain></tt>, the <tt class=
+ "LITERAL"><host><port>/<path></tt>, where the <tt
+ class="LITERAL"><host></tt>, the <tt class=
"LITERAL"><port></tt> and the <tt class=
"LITERAL"><path></tt> are optional. (This is why the special
<tt class="LITERAL">/</tt> pattern matches all URLs). Note that the
assumed already!
</p>
<p>
- The pattern matching syntax is different for the domain and path
- parts of the URL. The domain part uses a simple globbing type
+ The pattern matching syntax is different for the host and path
+ parts of the URL. The host part uses a simple globbing type
matching technique, while the path part uses more flexible <a href=
"http://en.wikipedia.org/wiki/Regular_expressions" target=
"_top"><span class="QUOTE">"Regular Expressions"</span></a> (POSIX
</p>
<p>
The port part of a pattern is a decimal port number preceded by a
- colon (<tt class="LITERAL">:</tt>). If the domain part contains a
+ colon (<tt class="LITERAL">:</tt>). If the host part contains a
numerical IPv6 address, it has to be put into angle brackets (<tt
class="LITERAL"><</tt>, <tt class="LITERAL">></tt>).
</p>
</dt>
<dd>
<p>
- is a domain-only pattern and will match any request to <tt
+ is a host-only pattern and will match any request to <tt
class="LITERAL">www.example.com</tt>, regardless of which
document on that server is requested. So ALL pages in this
domain would be covered by the scope of this action. Note
</dt>
<dd>
<p>
- means exactly the same. For domain-only patterns, the
- trailing <tt class="LITERAL">/</tt> may be omitted.
+ means exactly the same. For host-only patterns, the trailing
+ <tt class="LITERAL">/</tt> may be omitted.
</p>
</dd>
<dt>
Matches any URL pointing to TCP port 8000.
</p>
</dd>
+ <dt>
+ <tt class="LITERAL">10.0.0.1/</tt>
+ </dt>
+ <dd>
+ <p>
+ Matches any URL with the host address <tt class=
+ "LITERAL">10.0.0.1</tt>. (Note that the real URL uses plain
+ brackets, not angle brackets.)
+ </p>
+ </dd>
<dt>
<tt class="LITERAL"><2001:db8::1>/</tt>
</dt>
</div>
<div class="SECT3">
<h3 class="SECT3">
- <a name="AEN2843">8.4.1. The Domain Pattern</a>
+ <a name="HOST-PATTERN">8.4.1. The Host Pattern</a>
</h3>
<p>
- 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:
+ The matching of the host part offers some flexible options: if
+ the host pattern starts or ends with a dot, it becomes unanchored
+ at that end. The host pattern is often referred to as domain
+ pattern as it is usually used to match domain names and not IP
+ addresses. For example:
</p>
<div class="VARIABLELIST">
<dl>
</div>
<div class="SECT3">
<h3 class="SECT3">
- <a name="AEN2919">8.4.2. The Path Pattern</a>
+ <a name="PATH-PATTERN">8.4.2. The Path Pattern</a>
</h3>
<p>
<span class="APPLICATION">Privoxy</span> uses <span class=
</div>
<div class="SECT3">
<h3 class="SECT3">
- <a name="TAG-PATTERN">8.4.3. The Tag Pattern</a>
+ <a name="TAG-PATTERN">8.4.3. The Request Tag Pattern</a>
</h3>
<p>
- Tag patterns are used to change the applying actions based on the
- request's tags. Tags can be created with either the <a href=
+ Request tag patterns are used to change the applying actions
+ based on the request's tags. Tags can be created based on HTTP
+ headers with either the <a href=
"actions-file.html#CLIENT-HEADER-TAGGER">client-header-tagger</a>
or the <a href=
"actions-file.html#SERVER-HEADER-TAGGER">server-header-tagger</a>
action.
</p>
<p>
- Tag patterns have to start with <span class=
+ Request tag patterns have to start with <span class=
"QUOTE">"TAG:"</span>, so <span class=
- "APPLICATION">Privoxy</span> can tell them apart from URL
+ "APPLICATION">Privoxy</span> can tell them apart from other
patterns. Everything after the colon including white space, is
interpreted as a regular expression with path pattern syntax,
except that tag patterns aren't left-anchored automatically
space.
</p>
<p>
- Sections can contain URL and tag patterns at the same time, but
- tag patterns are checked after the URL patterns and thus always
- overrule them, even if they are located before the URL patterns.
+ Sections can contain URL and request tag patterns at the same
+ time, but request tag patterns are checked after the URL patterns
+ and thus always overrule them, even if they are located before
+ the URL patterns.
</p>
<p>
- Once a new tag is added, Privoxy checks right away if it's
- matched by one of the tag patterns and updates the action
- settings accordingly. As a result tags can be used to activate
- other tagger actions, as long as these other taggers look for
- headers that haven't already be parsed.
+ Once a new request tag is added, Privoxy checks right away if
+ it's matched by one of the request tag patterns and updates the
+ action settings accordingly. As a result request tags can be used
+ to activate other tagger actions, as long as these other taggers
+ look for headers that haven't already be parsed.
</p>
<p>
For example you could tag client requests which use the <tt
make too much sense.
</p>
</div>
+ <div class="SECT3">
+ <h3 class="SECT3">
+ <a name="NEGATIVE-TAG-PATTERNS">8.4.4. The Negative Request Tag
+ Patterns</a>
+ </h3>
+ <p>
+ To match requests that do not have a certain request tag, specify
+ a negative tag pattern by prefixing the tag pattern line with
+ either <span class="QUOTE">"NO-REQUEST-TAG:"</span> or <span
+ class="QUOTE">"NO-RESPONSE-TAG:"</span> instead of <span class=
+ "QUOTE">"TAG:"</span>.
+ </p>
+ <p>
+ Negative request tag patterns created with <span class=
+ "QUOTE">"NO-REQUEST-TAG:"</span> are checked after all client
+ headers are scanned, the ones created with <span class=
+ "QUOTE">"NO-RESPONSE-TAG:"</span> are checked after all server
+ headers are scanned. In both cases all the created tags are
+ considered.
+ </p>
+ </div>
+ <div class="SECT3">
+ <h3 class="SECT3">
+ <a name="CLIENT-TAG-PATTERN">8.4.5. The Client Tag Pattern</a>
+ </h3>
+ <div class="WARNING">
+ <table class="WARNING" border="1" width="100%">
+ <tr>
+ <td align="CENTER">
+ <b>Warning</b>
+ </td>
+ </tr>
+ <tr>
+ <td align="LEFT">
+ <p>
+ This is an experimental feature. The syntax is likely to
+ change in future versions.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <p>
+ Client tag patterns are not set based on HTTP headers but based
+ on the client's IP address. Users can enable them themselves, but
+ the Privoxy admin controls which tags are available and what
+ their effect is.
+ </p>
+ <p>
+ After a client-specific tag has been defined with the <a href=
+ "config.html#CLIENT-SPECIFIC-TAG">client-specific-tag</a>,
+ directive, action sections can be activated based on the tag by
+ using a CLIENT-TAG pattern. The CLIENT-TAG pattern is evaluated
+ at the same priority as URL patterns, as a result the last
+ matching pattern wins. Tags that are created based on client or
+ server headers are evaluated later on and can overrule CLIENT-TAG
+ and URL patterns!
+ </p>
+ <p>
+ The tag is set for all requests that come from clients that
+ requested it to be set. Note that "clients" are differentiated by
+ IP address, if the IP address changes the tag has to be requested
+ again.
+ </p>
+ <p>
+ Clients can request tags to be set by using the CGI interface <a
+ href="http://config.privoxy.org/client-tags" target=
+ "_top">http://config.privoxy.org/client-tags</a>.
+ </p>
+ <p>
+ Example:
+ </p>
+ <p>
+ </p>
+ <table border="0" bgcolor="#E0E0E0" width="100%">
+ <tr>
+ <td>
+<pre class="SCREEN">
+# If the admin defined the client-specific-tag circumvent-blocks,
+# and the request comes from a client that previously requested
+# the tag to be set, overrule all previous +block actions that
+# are enabled based on URL to CLIENT-TAG patterns.
+{-block}
+CLIENT-TAG:^circumvent-blocks$
+
+# This section is not overruled because it's located after
+# the previous one.
+{+block{Nobody is supposed to request this.}}
+example.org/blocked-example-page
+</pre>
+ </td>
+ </tr>
+ </table>
+ </div>
</div>
<div class="SECT2">
<h2 class="SECT2">
<tr>
<td>
<pre class="SCREEN">
-+add-header{X-User-Tracking: sucks}
+# Add a DNT ("Do not track") header to all requests,
+# event to those that already have one.
+#
+# This is just an example, not a recommendation.
+#
+# There is no reason to believe that user-tracking websites care
+# about the DNT header and depending on the User-Agent, adding the
+# header may make user-tracking easier.
+{+add-header{DNT: 1}}
+/
</pre>
</td>
</tr>
</dt>
<dd>
<p>
- Parameterized.
+ Multi-value.
</p>
</dd>
<dt>
actions have finished and use their output as input.
</p>
<p>
- If the request URL gets changed, <span class=
+ If the request URI gets changed, <span class=
"APPLICATION">Privoxy</span> will detect that and use the
new one. This can be used to rewrite the request
destination behind the client's back, for example to
</dt>
<dd>
<p>
- Parameterized.
+ Multi-value.
</p>
</dd>
<dt>
TAG:^User-Agent: Ubuntu APT-HTTP/
TAG:^User-Agent: MPlayer/
+</pre>
+ </td>
+ </tr>
+ </table>
+
+ <p>
+ </p>
+ <table border="0" bgcolor="#E0E0E0" width="90%">
+ <tr>
+ <td>
+<pre class="SCREEN">
+# Tag all requests with the Range header set
+{+client-header-tagger{range-requests}}
+/
+
+# Disable filtering for the tagged requests.
+#
+# With filtering enabled Privoxy would remove the Range headers
+# to be able to filter the whole response. The downside is that
+# it prevents clients from resuming downloads or skipping over
+# parts of multimedia files.
+{-filter -deanimate-gifs}
+TAG:^RANGE-REQUEST$
+
</pre>
</td>
</tr>
This is a left-over from the time when <span class=
"APPLICATION">Privoxy</span> didn't support important
HTTP/1.1 features well. It is left here for the unlikely
- case that you experience HTTP/1.1 related problems with
- some server out there. Not all HTTP/1.1 features and
- requirements are supported yet, so there is a chance you
- might need this action.
+ case that you experience HTTP/1.1-related problems with
+ some server out there.
+ </p>
+ <p>
+ Note that enabling this action is only a workaround. It
+ should not be enabled for sites that work without it. While
+ it shouldn't break any pages, it has an (usually negative)
+ performance impact.
+ </p>
+ <p>
+ If you come across a site where enabling this action helps,
+ please report it, so the cause of the problem can be
+ analyzed. If the problem turns out to be caused by a bug in
+ <span class="APPLICATION">Privoxy</span> it should be fixed
+ so the following release works without the work around.
</p>
</dd>
<dt>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="FAST-REDIRECTS">8.5.14. fast-redirects</a>
+ <a name="EXTERNAL-FILTER">8.5.14. external-filter</a>
+ </h4>
+ <div class="VARIABLELIST">
+ <dl>
+ <dt>
+ Typical use:
+ </dt>
+ <dd>
+ <p>
+ Modify content using a programming language of your choice.
+ </p>
+ </dd>
+ <dt>
+ Effect:
+ </dt>
+ <dd>
+ <p>
+ All instances of text-based type, most notably HTML and
+ JavaScript, to which this action applies, can be filtered
+ on-the-fly through the specified external filter. By
+ default plain text documents are exempted from filtering,
+ because web servers often use the <tt class=
+ "LITERAL">text/plain</tt> MIME type for all files whose
+ type they don't know.)
+ </p>
+ </dd>
+ <dt>
+ Type:
+ </dt>
+ <dd>
+ <p>
+ Multi-value.
+ </p>
+ </dd>
+ <dt>
+ Parameter:
+ </dt>
+ <dd>
+ <p>
+ The name of an external content filter, as defined in the
+ <a href="filter-file.html">filter file</a>. External
+ filters can be defined in one or more files as defined by
+ the <tt class="LITERAL"><a href=
+ "config.html#FILTERFILE">filterfile</a></tt> option in the
+ <a href="config.html">config file</a>.
+ </p>
+ <p>
+ When used in its negative form, and without parameters,
+ <span class="emphasis"><i class="EMPHASIS">all</i></span>
+ filtering with external filters is completely disabled.
+ </p>
+ </dd>
+ <dt>
+ Notes:
+ </dt>
+ <dd>
+ <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. 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%">
+ <tr>
+ <td align="CENTER">
+ <b>Warning</b>
+ </td>
+ </tr>
+ <tr>
+ <td align="LEFT">
+ <p>
+ Currently external filters are executed with <span
+ class="APPLICATION">Privoxy</span>'s privileges.
+ Only use external filters you understand and trust.
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <p>
+ This feature is experimental, the <tt class="LITERAL"><a
+ href=
+ "filter-file.html#EXTERNAL-FILTER-SYNTAX">syntax</a></tt>
+ may change in the future.
+ </p>
+ </dd>
+ <dt>
+ Example usage:
+ </dt>
+ <dd>
+ <p>
+ </p>
+ <table border="0" bgcolor="#E0E0E0" width="90%">
+ <tr>
+ <td>
+<pre class="SCREEN">
++external-filter{fancy-filter}
+</pre>
+ </td>
+ </tr>
+ </table>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ <div class="SECT3">
+ <h4 class="SECT3">
+ <a name="FAST-REDIRECTS">8.5.15. fast-redirects</a>
</h4>
<div class="VARIABLELIST">
<dl>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="FILTER">8.5.15. filter</a>
+ <a name="FILTER">8.5.16. filter</a>
</h4>
<div class="VARIABLELIST">
<dl>
</dt>
<dd>
<p>
- Parameterized.
+ Multi-value.
</p>
</dd>
<dt>
"LITERAL">-filter</tt> exceptions.
</p>
<p>
- Compressed content can't be filtered either, unless <span
+ Compressed content can't be filtered either, but if <span
class="APPLICATION">Privoxy</span> is compiled with zlib
- support (requires at least <span class=
- "APPLICATION">Privoxy</span> 3.0.7), in which case <span
- class="APPLICATION">Privoxy</span> will decompress the
- content before filtering it.
+ support and a supported compression algorithm is used (gzip
+ or deflate), <span class="APPLICATION">Privoxy</span> can
+ first decompress the content and then filter it.
</p>
<p>
If you use a <span class="APPLICATION">Privoxy</span>
<tr>
<td>
<pre class="SCREEN">
-+filter{js-events} # Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).
++filter{js-events} # Kill JavaScript event bindings and timers (Radically destructive! Only for extra nasty sites).
</pre>
</td>
</tr>
<tr>
<td>
<pre class="SCREEN">
-+filter{refresh-tags} # Kill automatic refresh tags (for dial-on-demand setups).
++filter{refresh-tags} # Kill automatic refresh tags if refresh time is larger than 9 seconds.
</pre>
</td>
</tr>
<tr>
<td>
<pre class="SCREEN">
-+filter{unsolicited-popups} # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.
++filter{unsolicited-popups} # Disable only unsolicited pop-up windows.
</pre>
</td>
</tr>
<tr>
<td>
<pre class="SCREEN">
-+filter{all-popups} # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.
++filter{all-popups} # Kill all popups in JavaScript and HTML.
</pre>
</td>
</tr>
</tr>
</table>
+ <p>
+ <a name="FILTER-IFRAMES"></a>
+ </p>
+ <table border="0" bgcolor="#E0E0E0" width="90%">
+ <tr>
+ <td>
+<pre class="SCREEN">
++filter{iframes} # Removes all detected iframes. Should only be enabled for individual sites.
+</pre>
+ </td>
+ </tr>
+ </table>
+
<p>
<a name="FILTER-DEMORONIZER"></a>
</p>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="FORCE-TEXT-MODE">8.5.16. force-text-mode</a>
+ <a name="FORCE-TEXT-MODE">8.5.17. force-text-mode</a>
</h4>
<div class="VARIABLELIST">
<dl>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="FORWARD-OVERRIDE">8.5.17. forward-override</a>
+ <a name="FORWARD-OVERRIDE">8.5.18. forward-override</a>
</h4>
<div class="VARIABLELIST">
<dl>
</dt>
<dd>
<p>
- Multi-value.
+ Parameterized.
</p>
</dd>
<dt>
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>
<dt>
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.
+ syntax causes 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=
<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 \
}
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="HANDLE-AS-EMPTY-DOCUMENT">8.5.18.
+ <a name="HANDLE-AS-EMPTY-DOCUMENT">8.5.19.
handle-as-empty-document</a>
</h4>
<div class="VARIABLELIST">
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="HANDLE-AS-IMAGE">8.5.19. handle-as-image</a>
+ <a name="HANDLE-AS-IMAGE">8.5.20. handle-as-image</a>
</h4>
<div class="VARIABLELIST">
<dl>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="HIDE-ACCEPT-LANGUAGE">8.5.20. hide-accept-language</a>
+ <a name="HIDE-ACCEPT-LANGUAGE">8.5.21. hide-accept-language</a>
</h4>
<div class="VARIABLELIST">
<dl>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="HIDE-CONTENT-DISPOSITION">8.5.21.
+ <a name="HIDE-CONTENT-DISPOSITION">8.5.22.
hide-content-disposition</a>
</h4>
<div class="VARIABLELIST">
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="HIDE-IF-MODIFIED-SINCE">8.5.22.
+ <a name="HIDE-IF-MODIFIED-SINCE">8.5.23.
hide-if-modified-since</a>
</h4>
<div class="VARIABLELIST">
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="HIDE-FROM-HEADER">8.5.23. hide-from-header</a>
+ <a name="HIDE-FROM-HEADER">8.5.24. hide-from-header</a>
</h4>
<div class="VARIABLELIST">
<dl>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="HIDE-REFERRER">8.5.24. hide-referrer</a>
+ <a name="HIDE-REFERRER">8.5.25. hide-referrer</a>
</h4>
<a name="HIDE-REFERER"></a>
<div class="VARIABLELIST">
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="HIDE-USER-AGENT">8.5.25. hide-user-agent</a>
+ <a name="HIDE-USER-AGENT">8.5.26. hide-user-agent</a>
</h4>
<div class="VARIABLELIST">
<dl>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="LIMIT-CONNECT">8.5.26. limit-connect</a>
+ <a name="LIMIT-CONNECT">8.5.27. limit-connect</a>
</h4>
<div class="VARIABLELIST">
<dl>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="PREVENT-COMPRESSION">8.5.27. prevent-compression</a>
+ <a name="LIMIT-COOKIE-LIFETIME">8.5.28. limit-cookie-lifetime</a>
+ </h4>
+ <div class="VARIABLELIST">
+ <dl>
+ <dt>
+ Typical use:
+ </dt>
+ <dd>
+ <p>
+ Limit the lifetime of HTTP cookies to a couple of minutes
+ or hours.
+ </p>
+ </dd>
+ <dt>
+ Effect:
+ </dt>
+ <dd>
+ <p>
+ Overwrites the expires field in Set-Cookie server headers
+ if it's above the specified limit.
+ </p>
+ </dd>
+ <dt>
+ Type:
+ </dt>
+ <dd>
+ <p>
+ Parameterized.
+ </p>
+ </dd>
+ <dt>
+ Parameter:
+ </dt>
+ <dd>
+ <p>
+ The lifetime limit in minutes, or 0.
+ </p>
+ </dd>
+ <dt>
+ Notes:
+ </dt>
+ <dd>
+ <p>
+ This action reduces the lifetime of HTTP cookies coming
+ from the server to the specified number of minutes,
+ starting from the time the cookie passes Privoxy.
+ </p>
+ <p>
+ Cookies with a lifetime below the limit are not modified.
+ The lifetime of session cookies is set to the specified
+ limit.
+ </p>
+ <p>
+ The effect of this action depends on the server.
+ </p>
+ <p>
+ In case of servers which refresh their cookies with each
+ response (or at least frequently), the lifetime limit set
+ by this action is updated as well. Thus, a session
+ associated with the cookie continues to work with this
+ action enabled, as long as a new request is made before the
+ last limit set is reached.
+ </p>
+ <p>
+ However, some servers send their cookies once, with a
+ lifetime of several years (the year 2037 is a popular
+ choice), and do not refresh them until a certain event in
+ the future, for example the user logging out. In this case
+ this action may limit the absolute lifetime of the session,
+ even if requests are made frequently.
+ </p>
+ <p>
+ If the parameter is <span class="QUOTE">"0"</span>, this
+ action behaves like <tt class="LITERAL"><a href=
+ "actions-file.html#SESSION-COOKIES-ONLY">session-cookies-only</a></tt>.
+ </p>
+ </dd>
+ <dt>
+ Example usages:
+ </dt>
+ <dd>
+ <p>
+ </p>
+ <table border="0" bgcolor="#E0E0E0" width="90%">
+ <tr>
+ <td>
+<pre class="SCREEN">
++limit-cookie-lifetime{60}
+
+</pre>
+ </td>
+ </tr>
+ </table>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ <div class="SECT3">
+ <h4 class="SECT3">
+ <a name="PREVENT-COMPRESSION">8.5.29. prevent-compression</a>
</h4>
<div class="VARIABLELIST">
<dl>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="OVERWRITE-LAST-MODIFIED">8.5.28.
+ <a name="OVERWRITE-LAST-MODIFIED">8.5.30.
overwrite-last-modified</a>
</h4>
<div class="VARIABLELIST">
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="REDIRECT">8.5.29. redirect</a>
+ <a name="REDIRECT">8.5.31. redirect</a>
</h4>
<div class="VARIABLELIST">
<dl>
single pcrs command to the original URL.
</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=
+ The syntax for pcrs commands is documented in the <a href=
+ "filter-file.html">filter file</a> section.
+ </p>
+ <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>
example.com/stylesheet\.css
# Create a short, easy to remember nickname for a favorite site
-# (relies on the browser accept and forward invalid URLs to <span class=
+# (relies on the browser to accept and forward invalid URLs to <span class=
"APPLICATION">Privoxy</span>)
-{ +redirect{http://www.privoxy.org/user-manual/actions-file.html} }
+{ +redirect{https://www.privoxy.org/user-manual/actions-file.html} }
a
# Always use the expanded view for Undeadly.org articles
{+redirect{s@^http://[^/]*/results\.aspx\?q=([^&]*).*@http://search.yahoo.com/search?p=$1@}}
search.msn.com//results\.aspx\?q=
+# Redirect http://example.com/&bla=fasel&toChange=foo (and any other value but "bar")
+# to http://example.com/&bla=fasel&toChange=bar
+#
+# The URL pattern makes sure that the following request isn't redirected again.
+{+redirect{s@toChange=[^&]+@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@}}
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="SERVER-HEADER-FILTER">8.5.30. server-header-filter</a>
+ <a name="SERVER-HEADER-FILTER">8.5.32. server-header-filter</a>
</h4>
<div class="VARIABLELIST">
<dl>
</dt>
<dd>
<p>
- Parameterized.
+ Multi-value.
</p>
</dd>
<dt>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="SERVER-HEADER-TAGGER">8.5.31. server-header-tagger</a>
+ <a name="SERVER-HEADER-TAGGER">8.5.33. server-header-tagger</a>
</h4>
<div class="VARIABLELIST">
<dl>
</dt>
<dd>
<p>
- Parameterized.
+ Multi-value.
</p>
</dd>
<dt>
{+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>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="SESSION-COOKIES-ONLY">8.5.32. session-cookies-only</a>
+ <a name="SESSION-COOKIES-ONLY">8.5.34. session-cookies-only</a>
</h4>
<div class="VARIABLELIST">
<dl>
</div>
<div class="SECT3">
<h4 class="SECT3">
- <a name="SET-IMAGE-BLOCKER">8.5.33. set-image-blocker</a>
+ <a name="SET-IMAGE-BLOCKER">8.5.35. set-image-blocker</a>
</h4>
<div class="VARIABLELIST">
<dl>
</div>
<div class="SECT3">
<h3 class="SECT3">
- <a name="AEN4549">8.5.34. Summary</a>
+ <a name="SUMMARY">8.5.36. Summary</a>
</h3>
<p>
Note that many of these actions have the potential to cause a
</p>
<div class="SECT3">
<h3 class="SECT3">
- <a name="AEN4613">8.7.1. match-all.action</a>
+ <a name="MATCH-ALL">8.7.1. match-all.action</a>
</h3>
<p>
Remember <span class="emphasis"><i class="EMPHASIS">all actions
</div>
<div class="SECT3">
<h3 class="SECT3">
- <a name="AEN4635">8.7.2. default.action</a>
+ <a name="DEFAULT-ACTION">8.7.2. default.action</a>
</h3>
<p>
If you aren't a developer, there's no need for you to edit the
</div>
<div class="SECT3">
<h3 class="SECT3">
- <a name="AEN4748">8.7.3. user.action</a>
+ <a name="USER-ACTION">8.7.3. user.action</a>
</h3>
<p>
So far we are painting with a broad brush by setting general
</div>
</div>
<div class="NAVFOOTER">
- <hr width="100%" class="c1">
+ <hr align="LEFT" width="100%">
<table summary="Footer navigation table" width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>