X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=doc%2Fwebserver%2Fuser-manual%2Fconfiguration.html;h=abfbabb402b556fcb95348af528619f59fa92b59;hp=523f10bdb542a0e799f83566f208404e33bbc7fd;hb=56d03106907472899fa6e8933e81058744ce0fed;hpb=c01c83eba954cb16fdc45a258e54fbc80100f161 diff --git a/doc/webserver/user-manual/configuration.html b/doc/webserver/user-manual/configuration.html index 523f10bd..abfbabb4 100644 --- a/doc/webserver/user-manual/configuration.html +++ b/doc/webserver/user-manual/configuration.html @@ -95,7 +95,7 @@ CLASS="SECT2" >
debug 1 # show each GET/POST/CONNECT request + debug 2 # show each connection status + debug 4 # show I/O status + debug 8 # show header parsing + debug 16 # log all data into the logfile + debug 32 # debug force feature + debug 64 # debug regular expression filter + debug 128 # debug fast redirects + debug 256 # debug GIF de-animation + debug 512 # Common Log Format + debug 1024 # debug kill pop-ups + debug 4096 # Startup banner and warnings. + debug 8192 # Non-fatal errors + |
To select multiple debug levels, you can either add them or use + multiple debug lines. +
It is A debug level of 1 is informative because it will show you each request + as it happens. highly recommended that you enable ERROR - reporting (debug 8192), at least until v3.0 is released.
1, 4096 and 8192 are highly recommended + so that you will notice when things go wrong. The other levels are probably + only of interest if you are hunting down a specific problem. They can produce + a hell of an output (especially 16). + +The reporting of FATAL errors (i.e. ones which crash - The reporting of fatal errors (i.e. ones which crash + Privoxy) is always on and cannot be disabled.
) is always on and cannot be disabled. +If you want to use CLF (Common Log Format), you should set If you want to use CLF (Common Log Format), you should set "debug - 512" ONLY, do not enable anything else.
Multiple "debug" directives, are OK - they're logical-OR'd - together.
debug 15 # same as setting the first 4 listed above
-
Default:
Whether to run only one server thread +
debug 1 # URLs
- debug 4096 # Info
- None
debug 8192 # Errors - *we highly recommended enabling this*
-
Privoxy normally uses - "multi-threading", a software technique that permits it to - handle many different requests simultaneously. In some cases you may wish to - disable this -- particularly if you're trying to debug a problem. The - "single-threaded" option forces - Privoxy to handle requests sequentially. - Default: Multi-threaded mode.
Multi-threaded (or, where unavailable: forked) operation, i.e. the ability to + serve multiple requests simultaneously. +
This option is only there for debug purposes and you should never
+ need to use it. #single-threaded
-
"toggle" allows you to temporarily disable all - Privoxy's filtering. Just set "toggle - 0".
The Windows version of Privoxy puts an icon in - the system tray, which also allows you to change this option. If you - right-click on that icon (or select the "Options" menu), one - choice is "Enable". Clicking on enable toggles - Privoxy on and off. This is useful if you want - to temporarily disable Privoxy, e.g., to access - a site that requires cookies which you would otherwise have blocked. This can also - be toggled via a web browser at the PrivoxyIt will drastically reduce performance. - internal address of http://p.p on - any platform.
"toggle 1" means Privoxy runs - normally, "toggle 0" means that - This section of the config file controls the security-relevant aspects + of Privoxy becomes a non-anonymizing non-blocking - proxy. Default: 1 (on).
's configuration. +
toggle 1
-
For content filtering, i.e. the "+filter" and - "+deanimate-gif" actions, it is necessary that - The IP address and TCP port on which Privoxy buffers the entire document body. - This can be potentially dangerous, since a server could just keep sending - data indefinitely and wait for your RAM to exhaust. With nasty consequences.
The buffer-limit option lets you set the maximum - size in Kbytes that each buffer may use. When the documents buffer exceeds - this size, it is flushed to the client unfiltered and no further attempt to - filter the rest of it is made. Remember that there may multiple threads - running, which might require increasing the "buffer-limit" - Kbytes each, unless you have enabled - "single-threaded" above.
buffer-limit 4069
-
[IP-Address]:Port
To enable the web-based default.action file editor set - enable-edit-actions to 1, or 0 to disable. Note - that you must have compiled
localhost:8118
Bind to localhost (127.0.0.1), port 8118. This is suitable and recommended for + home users who run Privoxy with - support for this feature, otherwise this option has no effect. This - internal page can be reached at http://p.p. -
on the same machine as + their browser. +Security note: If this is enabled, anyone who can use the proxy - can edit the actions file, and their changes will affect all users. - For shared proxies, you probably want to disable this. Default: enabled.
You will need to configure your browser(s) to this proxy address and port. +
enable-edit-actions 1
-
Allow If you leave out the IP address, Privoxy to be toggled on and off - remotely, using your web browser. Set will + bind to all interfaces (addresses) on your machine and may become reachable + from the Internet. In that case, consider using access control lists (acl's) + (see "enable-remote-toggle"to - 1 to enable, and 0 to disable. Note that you must have compiled - "ACLs" below), or a firewall. +
Suppose you are running Privoxy with support for this feature, - otherwise this option has no effect.
Security note: If this is enabled, anyone who can use the proxy can toggle - it on or off (see http://p.p), and - their changes will affect all users. For shared proxies, you probably want to - disable this. Default: enabled.
enable-remote-toggle 1
-
Access controls are included at the request of some ISPs and systems - administrators, and are not usually needed by individual users. Please note - the warnings in the FAQ that this proxy is not intended to be a substitute - for a firewall or to encourage anyone to defer addressing basic security - weaknesses.
If no access settings are specified, the proxy talks to anyone that - connects. If any access settings file are specified, then the proxy - talks only to IP addresses permitted somewhere in this file and not - denied later in this file.
Summary -- if using an ACL:
Client must have permission to receive service. - |
LAST match in ACL wins. - |
Default behavior is to deny service. - |
1 or 0
1
Act as if toggled on +
The syntax for an entry in the Access Control List is:
The windows version will only display the toggle icon in the system tray + if this option is present. +
ACTION SRC_ADDR[/SRC_MASKLEN] [ DST_ADDR[/DST_MASKLEN] ]
-
Whether or not the web-based toggle + feature may be used +
0 or 1
1
The web-based toggle feature is disabled. +
Where the individual fields are:
When toggled off, Privoxy acts like a normal, + content-neutral proxy, i.e. it acts as if none of the actions applied to + any URL. +
For the time being, access to the toggle feature can ACTION = "permit-access" or not be
+ controlled separately by "deny-access"
-
- SRC_ADDR = client hostname or dotted IP address
- SRC_MASKLEN = number of bits in the subnet mask for the source
-
- DST_ADDR = server or forwarder hostname or dotted IP address
- DST_MASKLEN = number of bits in the subnet mask for the target
-
- The field separator (FS) is whitespace (space or tab).
IMPORTANT NOTE: If "ACLs" or HTTP authentication, + so that everybody who can access Privoxy is using a - forwarder (see below) or a gateway for a particular destination URL, the - (see + "ACLs" and DST_ADDR that is examined is the address of the forwarder - or the gateway and listen-address above) can + toggle it for all users. So this option is NOT the address of the ultimate - target. This is necessary because it may be impossible for the local - not recommended + for multi-user environments with untrusted users. +
Note that you must have compiled Privoxy to determine the address of the - ultimate target (that's often what gateways are used for).
with + support for this feature, otherwise this option has no effect. +Here are a few examples to show how the ACL features work:
Whether or not the web-based actions + file editor may be used +
0 or 1
1
The web-based actions file editor is disabled. +
"localhost" is OK -- no DST_ADDR implies that - For the time being, access to the editor can ALL destination addresses are OK:
not be + controlled separately by "ACLs" or HTTP authentication, + so that everybody who can access Privoxy (see + "ACLs" and
listen-address above) can
+ modify its configuration for all users. So this option is permit-access localhost
-
A silly example to illustrate permitting any host on the class-C subnet with - Note that you must have compiled Privoxy to go anywhere:
with + support for this feature, otherwise this option has no effect. +
permit-access www.privoxy.com/24
-
Except deny one particular IP address from using it at all:
Who can access what. +src_addr[/src_masklen] + [dst_addr[/dst_masklen]] +
Where src_addr and + dst_addr are IP addresses in dotted decimal notation or valid + DNS names, and src_masklen and + dst_masklen are subnet masks in CIDR notation, i.e. integer + values from 2 to 30 representing the length (in bits) of the network address. The masks and the whole + destination part are optional. +
deny-access ident.privoxy.com
-
You can also specify an explicit network address and subnet mask. - Explicit addresses do not have to be resolved to be used.
Don't restrict access further than implied by
listen-address +
Access controls are included at the request of ISPs and systems
+ administrators, and permit-access 207.153.200.0/24
-
Please see the warnings in the FAQ that this proxy is not intended to be a substitute + for a firewall or to encourage anyone to defer addressing basic security + weaknesses. +
A subnet mask of 0 matches anything, so the next line permits everyone.
Multiple ACL lines are OK. + If any ACLs are specified, then the Privoxy + talks only to IP addresses that match at least one permit-access line + and don't match any subsequent deny-access line. In other words, the + last match wins, with the default being deny-access. +If Privoxy is using a forwarder (see
forward below)
+ for a particular destination URL, the dst_addr
+ that is examined is the address of the forwarder and permit-access 0.0.0.0/0
-
Note, you You should prefer using IP addresses over DNS names, because the address lookups take + time. All DNS names must resolve! You can cannot say:
not use domain patterns + like "*.org" or partial domain names. If a DNS name resolves to multiple + IP addresses, only the first one is used. +Denying access to particular sites by ACL may have undesired side effects + if the site in question is hosted on a machine which also hosts other sites. +
Explicitly define the default behavior if no ACL and +
permit-access .org
-
permit-access localhost + |
Allow any host on the same class C subnet as www.privoxy.org access to + nothing but www.example.com: +
permit-access www.privoxy.org/24 www.example.com/32 + |
Allow access from any host on the 26-bit subnet 192.168.45.64 to anywhere, + with the exception that 192.168.45.73 may not access www.dirty-stuff.example.com: +
permit-access 192.168.45.64/26 + deny-access 192.168.45.73 www.dirty-stuff.example.com + |
to allow all *.org domains. Every IP address listed must resolve fully.
Maximum size of the buffer for content filtering. +Size in Kbytes
4096
Use a 4MB (4096 KB) limit. +
An ISP may want to provide a For content filtering, i.e. the +filter and + +deanimate-gif actions, it is necessary that + Privoxy that is - accessible by "the world" and yet restrict use of some of their - private content to hosts on its internal network (i.e. its own subscribers). - Say, for instance the ISP owns the Class-B IP address block 123.124.0.0 (a 16 - bit netmask). This is how they could do it:
buffers the entire document body. + This can be potentially dangerous, since a server could just keep sending + data indefinitely and wait for your RAM to exhaust -- with nasty consequences. + Hence this option. +When a document buffer size reaches the
permit-access 0.0.0.0/0 0.0.0.0/0 # other clients can go anywhere
- # with the following exceptions:
-
- deny-access 0.0.0.0/0 123.124.0.0/16 # block all external requests for
- # sites on the ISP's network
-
- permit 0.0.0.0/0 www.my_isp.com # except for the ISP's main
- # web site
-
- buffer-limit, it is
+ flushed to the client unfiltered and no further attempt to
+ filter the rest of the document is made. Remember that there may be multiple threads
+ running, which might require up to buffer-limit Kbytes
+ permit 123.124.0.0/16 0.0.0.0/0 # the ISP's clients can go
- # anywhere
-
Note that if some hostnames are listed with multiple IP addresses, - the primary value returned by DNS (via gethostbyname()) is used. Default: - Anyone can access the proxy.
each, unless you have enabled "single-threaded" + above. +This feature allows chaining of HTTP requests via multiple proxies. +> This feature allows routing of HTTP requests through a chain of + multiple proxies. It can be used to better protect privacy and confidentiality when accessing specific domains by routing requests to those domains - to a special purpose filtering proxy such as lpwa.com. Or to use - a caching proxy to speed up browsing.
It can also be used in an environment with multiple networks to route - requests via multiple gateways allowing transparent access to multiple - networks without having to modify browser configurations.
http://www.multiproxy.org/anon_list.htm) + Or to use a caching proxy to speed up browsing. Or chaining to a parent + proxy may be necessary because the machine that Privoxy + runs on has no direct Internet access.Also specified here are SOCKS proxies. Privoxy - SOCKS 4 and SOCKS 4A. The difference is that SOCKS 4A will resolve the target - hostname using DNS on the SOCKS server, not our local DNS client.
The syntax of each line is:
forward target_domain[:port] http_proxy_host[:port]
- forward-socks4 target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]
- forward-socks4a target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]
-
To which parent HTTP proxy specific requests should be routed. +
target_domain[:port] + http_parent[/port] +
If http_proxy_host is Where target_domain is a domain name pattern (see the + chapter on domain matching in the actions file), + http_parent is the address of the parent HTTP proxy + as an IP addresses in dotted decimal notation or as a valid DNS name (or ".", then requests are not forwarded to a - HTTP proxy but are made directly to the web servers.
Lines are checked in sequence, and the last match wins.
There is an implicit line equivalent to the following, which specifies that - anything not finding a match on the list is to go out without forwarding - or gateway protocol, like so:
forward .* . # implicit
-
In the following common configuration, everything goes to Lucent's LPWA, - except SSL on port 443 (which it doesn't handle):
to denote + "no forwarding", and the optional + port parameters are TCP ports, i.e. integer + values from 1 to 64535 +
forward .* lpwa.com:8000
- forward :443 .
-
- Some users have reported difficulties related to LPWA's use of - Don't use parent HTTP proxies. +
If http_parent is "." as the last element of the domain, and have said that this - can be fixed with this:
, then requests are not + forwarded to another HTTP proxy but are made directly to the web servers. +
forward lpwa. lpwa.com:8000
-
(NOTE: the syntax for specifying target_domain has changed since the - previous paragraph was written -- it will not work now. More information - is welcome.)
Everything goes to an example anonymizing proxy, except SSL on port 443 (which it doesn't handle): +In this fictitious example, everything goes via an ISP's caching proxy, - except requests to that ISP:
forward .* anon-proxy.example.org:8080 + forward :443 . + |
forward .* caching.myisp.net:8000
- forward myisp.net .
-
For the @home network, we're told the forwarding configuration is this:
forward .*. caching-proxy.example-isp.net:8000 + forward .example-isp.net . + |
forward .* proxy:8080
-
Also, we're told they insist on getting cookies and JavaScript, so you should - allow cookies from home.com. We consider JavaScript a potential security risk. - Java need not be enabled.
Through which SOCKS proxy (and to which parent HTTP proxy) specific requests should be routed. +target_domain[:port] + socks_proxy[/port] + http_parent[/port] +
In this example direct connections are made to all "internal" Where target_domain is a domain name pattern (see the + chapter on domain matching in the actions file), + http_parent and socks_proxy + are IP addresses in dotted decimal notation or valid DNS names (http_parent - domains, but everything else goes through Lucent's LPWA by way of the - company's SOCKS gateway to the Internet.
"." to denote "no HTTP forwarding"), and the optional + port parameters are TCP ports, i.e. integer values from 1 to 64535 +
forward-socks4 .* lpwa.com:8000 firewall.my_company.com:1080
- forward my_company.com .
-
Don't use SOCKS proxies. +
This is how you could set up a site that always uses SOCKS but no forwarders:
Multiple lines are OK, they are checked in sequence, and the last match wins. +The difference between
forward-socks4a .* . firewall.my_company.com:1080
-
An advanced example for network administrators:
If http_parent is ".", then requests are not + forwarded to another HTTP proxy but are made (HTTP-wise) directly to the web servers, albeit through + a SOCKS proxy. +From the company example.com, direct connections are made to all + "internal" domains, but everything outbound goes through + their ISP's proxy by way of example.com's corporate SOCKS 4A gateway to + the Internet. +
forward-socks4a .*. socks-gw.example.com:1080 www-cache.example-isp.net:8080 + forward .example.com . + |
If you have links to multiple ISPs that provide various special content to - their subscribers, you can configure forwarding to pass requests to the - specific host that's connected to that ISP so that everybody can see all - of the content on all of the ISPs.
A rule that uses a SOCKS 4 gateway for all destinations but no HTTP parent looks like this: +This is a bit tricky, but here's an example:
forward-socks4 .*. socks-gw.example.com:1080 . + |
host-a has a PPP connection to isp-a.com. And host-b has a PPP connection to - isp-b.com. host-a can run a If you have links to multiple ISPs that provide various special content + only to their subscribers, you can configure multiple Privoxy proxy with - forwarding like this:
forward .* .
- Privoxies
+ which have connections to the respective ISPs to act as forwarders to each other, so that
+ forward isp-b.com host-b:8118
-
host-b can run a 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 Privoxy proxy with forwarding - like this:
. Their forwarding + configuration can look like this:
forward .* .
- forward isp-a.com host-a:8118
-
Now, anyone on the Internet (including users on host-a - and host-b) can set their browser's proxy to either - host-a or host-b and be able to browse the content on isp-a or isp-b.
forward .*. . + forward .isp-b.net host-b:8118 + |
Here's another practical example, for University of Kent at - Canterbury students with a network connection in their room, who - need to use the University's Squid web cache.
host-b:
forward *. ssbcache.ukc.ac.uk:3128 # Use the proxy, except for:
- forward .ukc.ac.uk . # Anything on the same domain as us
- forward * . # Host with no domain specified
- forward 129.12.*.* . # A dotted IP on our /16 network.
- forward 127.*.*.* . # Loopback address
- forward localhost.localdomain . # Loopback address
- forward www.ukc.mirror.ac.uk . # Specific host
-
forward .*. . + forward .isp-a.net host-a:8118 + |
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.
If you intend to chain Privoxybrowser -> squid -> privoxy is the recommended way.
Your squid configuration could then look like this (assuming that the IP -address of the box is 192.168.0.1 ):
Assuming that Privoxy and squid + run on the same box, your squid configuration could then look like this:
# Define Privoxy as parent cache
-
- cache_peer 192.168.0.1 parent 8118 0 no-query
-
- # don't listen to the whole world
- http_port 192.168.0.1:3128
-
- # define the local lan
- acl mylocallan src 192.168.0.1-192.168.0.5/255.255.255.255
-
- # grant access for http to local lan
- http_access allow mylocallan
-
- # Define ACL for protocol FTP
- acl FTP proto FTP
-
- # Do not forward ACL FTP to privoxy
- always_direct allow FTP
-
- # Do not forward ACL CONNECT (https) to privoxy
- always_direct allow CONNECT
-
- # Forward the rest to privoxy
- never_direct allow all
-
# 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 + |
You would then need to change your browser's proxy settings to squid's address and port. + Squid normally uses port 3128. If unsure consult http_port in squid.conf.
5.4. The Actions File The "default.action" file (formerly
+> The actions file (default.action, formerly:
actionsfilePrivoxy
Anything you want can blocked, 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). - Changes to default.action should be immediately visible - to Privoxy without the need to restart.
Note that some sites may misbehave, or possibly not work at all with some - actions. This may require some tinkering with the rules to get the most - mileage of Privoxy's features, and still be - able to see and enjoy just what you want to. There is no general rule of - thumb on these things. There just are too many variables, and sites are - always changing.
An actions file typically has sections. At the top, "aliases" are + defined (discussed below), then the default set of rules which will apply + universally to all sites and pages. And then below that is generally a lengthy + set of exceptions to the defined universal policies.Note that some actions like cookie suppression or script disabling may + render some sites unusable, which rely on these techniques to work properly. + Finding the right mix of actions is not easy and certainly a matter of personal + taste. In general, it can be said that the more "aggressive" + your default settings (in the top section of the actions file) are, + the more exceptions for "trusted" 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.
We have tried to provide you with reasonable rules to start from in the + distribution actions file. 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).
The easiest way to edit the "actions" file is with a browser by - loading http://p.p/, and then select - http://config.privoxy.org/edit-actions.
If you prefer plain text editing to GUIs, you can of course also directly edit the + default.action file.
The actions file is divided into sections. There are special sections, + like the "Edit Actions List". A text editor can also be used.
"alias" 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. To determine which actions apply to a request, the URL of the request is
compared to all patterns in this file. Every time it matches, the list of
- applicable actions for the URL is incrementally updated. You can trace
- this process by visiting You can trace this process by visiting http://p.p/show-url-info.
There are four types of lines in this file: comments (begin with a - "#" character), actions, aliases and patterns, all of which are - explained below, as well as the configuration file syntax that - Privoxy understands.
More detail on this is provided in the Appendix, Anatomy of an Action.Generally, a pattern has the form <domain>/<path>, where both the - <domain> and <path> part are optional. If you only specify a - domain part, the "/" can be left out:
www.example.com - is a domain only pattern and will match any request to - "www.example.com".
Generally, a pattern has the form <domain>/<path>, + where both the <domain> and <path> + are optional. (This is why the pattern / matches all URLs).www.example.com/ - means exactly the same.
www.example.com/index.html - matches only the single - document "/index.html" on "www.example.com".
is a domain-only pattern and will match any request to www.example.com, + regardless of which document on that server is requested. +/index.html - matches the document "/index.html", - regardless of the domain. So would match any page named "index.html" means exactly the same. For domain-only patterns, the trailing / may + be omitted. +
matches only the single document /index.html - on any site.
www.example.com. +matches the document /index.html, regardless of the domain, + i.e. on index.html - matches nothing, since it would be - interpreted as a domain name and there is no top-level domain called - ".html".
any web server. +matches nothing, since it would be interpreted as a domain name and + there is no top-level domain called .html. +
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:
.example.com - matches any domain or sub-domain that -
matches any domain that ENDS in ".example.com".
in + .example.com +www. - matches any domain that matches any domain that STARTS with - "www".
www. +matches any domain that CONTAINS .example. + (Correctly speaking: It matches any FQDN that contains example as a domain.) +
Additionally, there are wild-cards that you can use in the domain names themselves. They work pretty similar to shell wild-cards: "?" stands for - any single character. And you can define character classes in square - brackets and they can be freely mixed:
ad*.example.com - matches
matches "adserver.example.com", - "ads.example.com", etc but not "sfads.example.com".
+*ad*.example.com - matches all of the above, and then some.
matches all of the above, and then some. +.?pix.com - matches "www.ipix.com" matches www.ipix.com, - "pictures.epix.com", "a.b.c.d.e.upix.com", etc.
pictures.epix.com, a.b.c.d.e.upix.com etc. +www[1-9a-ez].example.com - matches "www1.example.com" matches www1.example.com, - "www4.example.com", "wwwd.example.com"www4.example.cc, wwwd.example.cy, - "wwwz.example.com", etc., but wwwz.example.com etc., but not - "wwww.example.com".
wwww.example.com. +If Privoxy was compiled with - "pcre" support (the default), Perl compatible regular expressions - can be used. These are more flexible and powerful than other types - of "regular expressions". See the pcre/docs/ directory or "man - perlre" (also available on uses Perl compatible regular expressions + (through the http://www.perldoc.com/perl5.6/pod/perlre.html) - for details. A brief discussion of regular expressions is in the - PCRE library) for + matching the path.
There is an Appendix. For instance:
with a brief quick-start into regular + expressions, and full (very technical) documentation on PCRE regex syntax is available on-line + at http://www.pcre.org/man.txt. + You might also find the Perl man page on regular expressions (man perlre) + useful, which is available on-line at http://www.perldoc.com/perl5.6/pod/perlre.html./.*/advert[0-9]+\.jpe?g - would match a URL from any - domain, with any path that includes Note that the path pattern is automatically left-anchored at the "advert" followed - immediately by one or more digits, then a "." and ending in - either "jpeg" or "jpg". So we match - "example.com/ads/advert2.jpg", and - "www.example.com/ads/banners/advert39.jpeg", but not - "/", + i.e. it matches as if it would start with a "www.example.com/ads/banners/advert39.gif" (no gifs in the - example pattern).
"^".Please note that matching in the path is case +> Please also note that matching in the path is case INSENSITIVE"(?-i)" switch:
www.example.com/(?-i)PaTtErN.* - will match only - documents whose path starts with "PaTtErN" switch: + www.example.com/(?-i)PaTtErN.* will match only + documents whose path starts with PaTtErN in exactly this capitalization.
Actions are enabled if preceded with a "-". Actions are invoked by enclosing the - action name in curly braces (e.g. {+some_action}), followed by a list of - URLs to which the action applies. There are three classes of actions:
. So a "+action" means + "do that action", e.g. "+block" means please + "block the following URLs and/or patterns". All actions are + disabled by default, until they are explicitly enabled somewhere in an actions + file.+ Actions are invoked by enclosing the action name in curly braces (e.g. + {+some_action}), followed by a list of URLs (or patterns that match URLs) to + which the action applies. There are three classes of actions:
- Boolean (e.g. "+/-block"): -
"on" or + "off". Examples: +
- parameterized (e.g. "+/-hide-user-agent"):
+>"+/-hide-user-agent{ Mozilla 1.0 }",
+ where some value is required in order to enable this type of action.
+ Examples:
{-name} # disable action
+> # disable action ("parameter") can be omitted
- Multi-value (e.g. "{+/-add-header{Name: value}}", ot + "{+/-wafer{name=value}}"): +>), where some value needs to be defined + in addition to simply enabling the actino. Examples:
{+name{param}} # enable action and add parameter {+name{param=value}} # enable action and set "param" to "value"
{-name{param}}{-name{param=value}} # remove the parameter "param"
+> completely
{-name} # disable this action totally
+> # disable this action totally and remove param too
Multi-value.
Send a user defined HTTP header to the web server. +
- Add the specified HTTP header, which is not checked for validity. - You may specify this many times to specify many different headers: -
Any value is possible. Validity of the defined HTTP headers is not checked. +
+add-header{Name: value}{+add-header{X-User-Tracking: sucks}}
-
- Block this URL totally. In a default installation, a This action may be specified multiple times, in order to define multiple + headers. This is rarely needed for the typical user. If you don't know what + "blocked" - URL will result in bright red banner that says "HTTP headers" are, you definitely don't need to worry about this + one. +
Boolean.
Used to block a URL from reaching your browser. The URL may be + anything, but is typically used to block ads or other obnoxious + content. +
N/A
{+block}
+ .example.com
+ .ads.r.us
+
Privoxy will display its + special "BLOCKED", - with a reason why it is being blocked, and an option to see it anyway. - The page displayed for this is the page if a URL matches one of the + blocked patterns. If there is sufficient space, a large red + banner will appear with a friendly message about why the page + was blocked, and a way to go there anyway. If there is insufficient + space a smaller blocked page will appear without the red banner. + One exception is if the URL matches both "+block" + and "+image", then it can be handled by + "+image-blocker" (see below). +
The "+filter" action can also perform some of the + same functionality as "+block", but by virtue of very + different programming techniques, and is typically used for different + reasons. +
Parameterized.
To stop those annoying, distracting animated GIF images. +
"last" or "blocked" template - file. -
"first" +
+block{+deanimate-gifs{last}}
-
- De-animate all animated GIF images, i.e. reduce them to their last frame. - This will also shrink the images considerably (in bytes, not pixels!). If - the option De-animate all animated GIF images, i.e. reduce them to their last frame. + This will also shrink the images considerably (in bytes, not pixels!). If + the option "first" is given, the first frame of the animation - is used as the replacement. If "last" is given, the last frame - of the animation is used instead, which probably makes more sense for most - banner animations, but also has the risk of not showing the entire last - frame (if it is only a delta to an earlier frame). -
is given, the last + frame of the animation is used instead, which probably makes more sense for + most banner animations, but also has the risk of not showing the entire + last frame (if it is only a delta to an earlier frame). +Boolean.
"+downgrade" will downgrade HTTP/1.1 client requests to + HTTP/1.0 and downgrade the responses as well. +
N/A +
+deanimate-gifs{last}{+downgrade}
- +deanimate-gifs{first}.example.com
-
Use this action for servers that use HTTP/1.1 protocol features that + Privoxy doesn't handle well yet. HTTP/1.1 is + only partially implemented. Default is not to downgrade requests. This is + an infrequently needed action, and is used to help with problem sites only. +
Boolean.
The "+downgrade" will downgrade HTTP/1.1 client requests to - HTTP/1.0 and downgrade the responses as well. Use this action for servers - that use HTTP/1.1 protocol features that - "+fast-redirects" action enables interception of + "redirect" requests from one server to another, which + are used to track users.Privoxy doesn't handle well yet. HTTP/1.1 - is only partially implemented. Default is not to downgrade requests. -
can cut off + all but the last valid URL in redirect request and send a local redirect + back to your browser without contacting the intermediate site(s). +N/A +
+downgrade{+fast-redirects}
-
- Many sites, like yahoo.com, don't just link to other sites. Instead, they - will link to some script on their own server, giving the destination as a - parameter, which will then redirect you to the final target. URLs resulting - from this scheme typically look like: - http://some.place/some_script?http://some.where-else.
Sometimes, there are even multiple consecutive redirects encoded in the - URL. These redirections via scripts make your web browsing more traceable, - since the server from which you follow such a link can see where you go to. - Apart from that, valuable bandwidth and time is wasted, while your browser - ask the server for one redirect after the other. Plus, it feeds the - advertisers. -
The "+fast-redirects" option enables interception of these - types of requests by Privoxy, who will cut off - all but the last valid URL in the request and send a local redirect back to - your browser without contacting the intermediate site(s). -
Sometimes, there are even multiple consecutive redirects encoded in the + URL. These redirections via scripts make your web browsing more traceable, + since the server from which you follow such a link can see where you go + to. Apart from that, valuable bandwidth and time is wasted, while your + browser ask the server for one redirect after the other. Plus, it feeds + the advertisers. +
This is a normally on feature, and often requires exceptions for sites that + are sensitive to defeating this mechanism. +
- Apply the filters in the section_header - section of the
Parameterized.
Apply page filtering as defined by named sections of the + default.filter file to the site(s). - file to the specified site(s). + "Filtering" can be any modification of the raw + page content, including re-writing or deletion of content. +
"+filter" must include the name of one of the section identifiers + from default.filter sections are grouped according to like - functionality. Filters can be used to - re-write any of the raw page content. This is a potentially a - very powerful feature! -
(or whatever
+ +filter{section_header}
-
- Filter sections that are pre-defined in the supplied - filterfile is specified in config). +
):
html-annoyances+filter{html-annoyances}: Get rid of particularly annoying HTML abuse. | js-annoyances+filter{js-annoyances}: Get rid of particularly annoying JavaScript abuse | no-poups+filter{content-cookies}: Kill cookies that come in the HTML or JS content + |
+filter{popups}: Kill all popups in JS and HTML | frameset-borders: Give frames a border +>+filter{frameset-borders}: Give frames a border and make them resizable | webbugs+filter{webbugs}: Squish WebBugs (1x1 invisible GIFs used for user tracking) | no-refresh: Automatic refresh sucks on auto-dialup lines +>+filter{refresh-tags}: Kill automatic refresh tags (for dial-on-demand setups) | fun+filter{fun}: Text replacements for subversive browsing fun! | nimda: Remove (virus) Nimda code. +>+filter{nimda}: Remove Nimda (virus) code. + |
+filter{banners-by-size}: Kill banners by size (very efficient!) |
banners-by-size: Kill banners by size +>+filter{shockwave-flash}: Kill embedded Shockwave Flash objects | crude-parental+filter{crude-parental}: Kill all web pages that contain the words "sex" or "warez" |
- Block any existing X-Forwarded-for header, and do not add a new one: -
This is potentially a very powerful feature! And requires a knowledge + of regular expressions if you want to "roll your own". + Filtering operates on a line by line basis. +
Filtering requires buffering the page content, which may appear to + slow down page rendering since nothing is displayed until all content has + passed the filters. (It does not really take longer, but seems that way + since the page is not incrementally displayed.) This effect will be more + noticeable on slower connections. +
Filtering can achieve some of the effects as the "+block" + action, i.e. it can be used to block ads and banners. In the overall + scheme of things, filtering is one of the last things "Privoxy" + does with a web page. So other actions are applied first. +
Boolean.
Block any existing X-Forwarded-for HTTP header, and do not add a new one. +
N/A +
{+hide-forwarded}
-
- If the browser sends a It is fairly safe to leave this on. It does not seem to break many sites. +
Parameterized.
To block the browser from sending your email address in a "From:" header containing your e-mail - address, this either completely removes the header ( + header. +
Keyword: "block"), or - changes it to the specified e-mail address. -
, or any user defined value. +
+hide-from{block}{+hide-from{block}}
- +hide-from{spam@sittingduck.xqq}.example.com
-
- Don't send the The keyword "block" will completely remove the header. + Alternately, you can specify any value you prefer to send to the web + server. +
Parameterized.
Don't send the "Referer:" (sic) header to the web site. You - can block it, forge a URL to the same server as the request (which is - preferred because some sites will not send images otherwise) or set it to a - constant, user defined string of your choice. -
(sic) HTTP header to the web site. + Or, alternately send a forged header instead. +Prevent the header from being sent with the keyword, "block". + Or, "forge" a URL to one from the same server as the request. + Or, set to user defined value of your choice. +
+hide-referer{block}
- +hide-referer{forge}{+hide-referer{forge}}
- +hide-referer{http://nowhere.com}.example.com
-
"forge" is the preferred option here, since some servers will + not send images back otherwise. +
- Alternative spelling of "+hide-referrer" is an alternate spelling of + "+hide-referer". It has the same - parameters, and can be freely mixed with, . It has the exact same parameters, and can be freely + mixed with, "+hide-referer". - (. ("referrer" is the correct English spelling, however the HTTP - specification has a bug - it requires it to be spelled is the + correct English spelling, however the HTTP specification has a bug - it + requires it to be spelled as "referer".)
Parameterized.
To change the "User-Agent:" header so web servers can't tell + your browser type. Who's business is it anyway? +
Any user defined string. +
+hide-referrer{...}{+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}}
-
Warning! This breaks many web sites that depend on this in order + to determine how the target browser will respond to various + requests. Use with caution. +
- Change the "User-Agent:" header so web servers can't tell your - browser type. Warning! This breaks many web sites. Specify the - user-agent value you want. Example, pretend to be using Netscape on - Linux: -
Boolean.
To define what Privoxy should treat + automatically as an image. +
N/A +
+hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)}{+image}
-
- Treat this URL as an image. This only matters if it's also This only has meaning if the URL (or pattern) also is + "+block"ed, - in which case a ed, in which case a "blocked" image can be sent rather than a HTML page. - See image can + be sent rather than a HTML page. (See "+image-blocker{}" below for the control over what is actually sent. - If you want invisible ads, they should be defined as - images and blocked. And also, - "image-blocker" should be set to "blank". Note you - cannot treat HTML pages as images in most cases. For instance, frames - require an HTML page to display. So a frame that is an ad, cannot be - treated as an image. Forcing an "image" in this - situation just will not work. -
below + for the control over what is actually sent.) +
There is little reason to change the default definition for this. +
Parameterized.
Decides what to do with URLs that end up tagged with Decide what to do with URLs that end up tagged with both "{+block - +image}", e.g an advertizement. There are five options. - "{+block}" + and "{+image}", e.g an advertisement. +
There are four available options: "-image-blocker" will send a HTML will send a HTML + "blocked" page, - usually resulting in a page, usually resulting in a "broken image" icon. -"broken + image" icon. "+image-blocker{blank}" will send a 1x1 transparent GIF -image. And finally, will send a 1x1 + transparent GIF image. "+image-blocker{http://xyz.com}""+image-blocker{pattern}" will send a -HTTP temporary redirect to the specified image. This has the advantage of the -icon being being cached by the browser, which will speed up the display. -"+image-blocker{pattern}" will send a checkboard type pattern -
"+image-blocker{http://xyz.com}" will send a HTTP temporary + redirect to the specified image. This has the advantage of the icon being + being cached by the browser, which will speed up the display. +
+image-blocker{blank}
- +image-blocker{pattern}{+image-blocker{blank}}
- +image-blocker{http://p.p/send-banner}.example.com
-
- By default (i.e. in the absence of a If you want invisible ads, they need to be both + defined as images and blocked. + And then, "+limit-connect" - action), "image-blocker" should be set to + "blank" for invisibility. Note you cannot treat HTML pages as + images in most cases. For instance, frames require an HTML page to display. + So a frame that is an ad, cannot be treated as an image. Forcing an + "image" in this situation just will not work. +
Parameterized.
By default, Privoxy will only allow CONNECT - requests to port 443, which is the standard port for https as a - precaution. -
only allows HTTP CONNECT + requests to port 443 (the standard, secure HTTPS port). Use + "+limit-connect" to disable this altogether, or to allow + more ports. +Any valid port number, or port number range. +
+limit-connect{443} # This is the default and need not be specified.
+ +limit-connect{80,443} # Ports 80 and 443 are OK.
+ +limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100 and above 500 are OK.
+
The CONNECT methods exists in HTTP to allow access to secure websites - (https:// URLs) through proxies. It works very simply: the proxy - connects to the server on the specified port, and then short-circuits - its connections to the client The CONNECT methods exists in HTTP to allow access to secure websites + (https:// URLs) through proxies. It works very simply: the proxy connects + to the server on the specified port, and then short-circuits its + connections to the client and to the remote proxy. - This can be a big security hole, since CONNECT-enabled proxies can - be abused as TCP relays very easily. + This can be a big security hole, since CONNECT-enabled proxies can be + abused as TCP relays very easily.
If you want to allow CONNECT for more ports than this, or want to forbid CONNECT altogether, you can specify a comma separated list of ports and port ranges (the latter using dashes, with the minimum defaulting to 0 and - max to 65K): + max to 65K).
If you don't know what any of this means, there probably is no reason to + change this one. +
Boolean.
Prevent the specified websites from compressing HTTP data. +
N/A +
+limit-connect{443} # This is the default and need no be specified.
- +limit-connect{80,443} # Ports 80 and 443 are OK.
- +limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100{+no-compression}
- #and above 500 are OK..example.com
-
"+no-compression" prevents the website from compressing the - data. Some websites do this, which can be a problem for - Some websites do this, which can be a problem for + Privoxy, since "+filter", - "+no-popup" and "+gif-deanimate" will not work on - compressed data. This will slow down connections to those websites, - though. Default is will not work + on compressed data. This will slow down connections to those websites, + though. Default typically is to turn "no-compression" is turned on. -
on. +Boolean.
Allow cookies for the current browser session only. +
N/A +
+nocompression{+no-cookies-keep}
-
- If the website sets cookies, If websites set cookies, "no-cookies-keep" will make sure - they are erased when you exit and restart your web browser. This makes - profiling cookies useless, but won't break sites which require cookies so - that you can log in for transactions. Default: on. -
"session cookies". +Boolean.
Explicitly prevent the web server from reading any cookies on your + system. +
N/A +
+no-cookies-keep{+no-cookies-read}
-
- Prevent the website from reading cookies: -
Often used in conjunction with "+no-cookies-set" to + disable persistant cookies completely. +Boolean.
Explicitly block the web server from sending cookies to your + system. +
N/A +
+no-cookies-read{+no-cookies-set}
-
- Prevent the website from setting cookies: -
Often used in conjunction with "+no-cookies-read" to + disable persistant cookies completely. +Boolean.
Stop those annoying JavaScript pop-up windows! +
N/A +
+no-cookies-set{+no-popup}
-
- Filter the website through a built-in filter to disable those obnoxious - JavaScript pop-up windows via window.open(), etc. The two alternative - spellings are equivalent. -
.example.com"+no-popup" uses a built in filter to disable pop-ups + that use the
window.open() function, etc. +
An alternate spelling is "+no-popups", which is + interchangeable. +
Boolean.
Sends a cookie for every site stating that you do not accept any copyright + on cookies sent to you, and asking them not to track you. +
N/A +
+no-popup{+vanilla-wafer}
- +no-popups.example.com
-
- This action only applies if you are using a This action only applies if you are using a jarfile - for saving cookies. It sends a cookie to every site stating that you do not - accept any copyright on cookies sent to you, and asking them not to track - you. Of course, this is a (relatively) unique header they could use to - track you. -
- This allows you to add an arbitrary cookie. It can be specified multiple - times in order to add as many cookies as you like. -
Multi-value.
This allows you to send an arbitrary, user definable cookie. +
User specified cookie name and corresponding value. +
+wafer{name=value}{+wafer{name=value}}
-
The meaning of any of the above is reversed by preceding the action with a - This can be specified multiple times in order to add as many cookies as you + like. +
Note that the meaning of any of the above examples is reversed by preceding + the action with a "-", in place of the "+".
. Also, + that some actions are turned on in the default section of the actions file, + and require little to no additional configuration. These are just "on". + Some actions that are turned on the default section do typically require + exceptions to be listed in the lower sections of actions file.Some examples:
# Turn off all persistent cookies
{ +no-cookies-read }
{ +no-cookies-set }
+
# Allow cookies for this browser session ONLY
{ +no-cookies-keep }
# Exceptions to the above, sites that benefit from persistent cookies
+ # that saved from one browser session to the next.
{ -no-cookies-read }
{ -no-cookies-set }
{ -no-cookies-keep }
@@ -3506,9 +5396,9 @@ CLASS="LITERALLAYOUT"
> Turn on page filtering according to rules in the defined sections
of refilterfiledefault.filter, and make one exception for
- sourceforge:
+ Sourceforge:
"blocked" banner). Many of these use regular expressions - that will expand to match multiple URLs:
banner). Many of these use + regular expressions that will expand to match + multiple URLs:for a brief example on troubleshooting actions.
Custom
.nytimes.com
- # Shopping sites - still want to block ads.
+ # Shopping sites - but we still want to block ads.
{shop}
.quietpc.com
.worldpay.com # for quietpc.com
.jungle.com
.scan.co.uk
- # These shops require pop-ups
+ # These shops require pop-ups also
{shop -no-popups}
.dabs.com
.overclockers.co.uk
@@ -3872,7 +5767,7 @@ CLASS="SECT2"
>5.6. Templates