1 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
2 <!entity % dummy "IGNORE">
3 <!entity supported SYSTEM "supported.sgml">
4 <!entity newfeatures SYSTEM "newfeatures.sgml">
5 <!entity p-intro SYSTEM "privoxy.sgml">
6 <!entity seealso SYSTEM "seealso.sgml">
7 <!entity buildsource SYSTEM "buildsource.sgml">
8 <!entity contacting SYSTEM "contacting.sgml">
9 <!entity history SYSTEM "history.sgml">
10 <!entity copyright SYSTEM "copyright.sgml">
11 <!entity p-version "2.9.14">
12 <!entity p-status "beta">
13 <!entity % p-not-stable "INCLUDE">
14 <!entity % p-stable "IGNORE">
15 <!entity % p-text "IGNORE"> <!-- define we are not a text only doc -->
16 <!entity % p-doc "INCLUDE"> <!-- and we are a formal doc -->
17 <!entity % p-readme "IGNORE">
18 <!entity % p-config "IGNORE">
19 <!entity % p-supp-userman "IGNORE"> <!-- Omit some from supported.sgml -->
22 File : $Source: /cvsroot/ijbswa/current/doc/source/user-manual.sgml,v $
25 This file belongs into
26 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
28 $Id: user-manual.sgml,v 1.94 2002/04/26 05:24:36 hal9 Exp $
30 Written by and Copyright (C) 2001 the SourceForge
31 Privoxy team. http://www.privoxy.org/
33 Based on the Internet Junkbuster originally written
34 by and Copyright (C) 1997 Anonymous Coders and
35 Junkbusters Corporation. http://www.junkbusters.com
38 ========================================================================
39 NOTE: Please read developer-manual/documentation.html before touching
40 anything in this, or other Privoxy documentation.
41 ========================================================================
47 <title>Privoxy User Manual</title>
49 <pubdate>$Id: user-manual.sgml,v 1.94 2002/04/26 05:24:36 hal9 Exp $</pubdate>
54 <orgname>By: Privoxy Developers</orgname>
63 This is here to keep vim syntax file from breaking :/
64 If I knew enough to fix it, I would.
65 PLEASE DO NOT REMOVE! HB: hal@foobox.net
71 The user manual gives users information on how to install, configure and use
73 url="http://www.privoxy.org/"><application>Privoxy</application></ulink>.
76 <!-- Include privoxy.sgml boilerplate: -->
78 <!-- end privoxy.sgml -->
81 You can find the latest version of the user manual at <ulink
82 url="http://www.privoxy.org/user-manual/">http://www.privoxy.org/user-manual/</ulink>.
83 Please see the <ulink url="contact.html">Contact section</ulink> on how to
84 contact the developers.
88 <!-- Feel free to send a note to the developers at <email>ijbswa-developers@lists.sourceforge.net</email>. -->
94 <!-- ~~~~~ New section ~~~~~ -->
95 <sect1 id="intro" label=""><title></title>
96 <!-- dummy section to force TOC on page by itself -->
97 <!-- DO NOT REMOVE! please ;) -->
101 <!-- ~~~~~ New section ~~~~~ -->
102 <sect1 label="1" id="introduction"><title>Introduction</title>
104 This documentation is included with the current &p-status; version of
105 <application>Privoxy</application>, v.&p-version;<![%p-not-stable;[,
106 and is mostly complete at this point. The most up to date reference for the
107 time being is still the comments in the source files and in the individual
108 configuration files. Development of version 3.0 is currently nearing
109 completion, and includes many significant changes and enhancements over
110 earlier versions. The target release date for
111 stable v3.0 is <quote>soon</quote> ;-)]]>.
114 <!-- include only in non-stable versions -->
117 Since this is a &p-status; version, not all new features are well tested. This
118 documentation may be slightly out of sync as a result (especially with
119 CVS sources). And there <emphasis>may be</emphasis> bugs, though hopefully
124 <!-- ~~~~~ New section ~~~~~ -->
125 <sect2 id="features"><title>Features</title>
127 In addition to <application>Internet Junkbuster's</application> traditional
128 features of ad and banner blocking and cookie management,
129 <application>Privoxy</application> provides new features<![%p-not-stable;[,
130 some of them currently under development]]>:
132 <!-- Include newfeatures.sgml boilerplate here: -->
134 <!-- end boilerplate -->
139 <!-- ~ End section ~ -->
142 <!-- ~~~~~ New section ~~~~~ -->
143 <sect1 id="installation"><title>Installation</title>
146 <application>Privoxy</application> is available both in convenient pre-compiled
147 packages for a wide range of operating systems, and as raw source code.
148 For most users, we recommend using the packages, which can be downloaded from our
149 <ulink url="http://sourceforge.net/projects/ijbswa/">Privoxy Project
150 Page</ulink>. For installing and compiling the source code, please look
151 into our Developer Manual.
155 If you like to live on the bleeding edge and are not afraid of using
156 possibly unstable development versions, you can check out the up-to-the-minute
157 version directly from <ulink url="http://sourceforge.net/cvs/?group_id=11118">the
158 CVS repository</ulink> or simply download <ulink
159 url="http://cvs.sourceforge.net/cvstarballs/ijbswa-cvsroot.tar.gz">the nightly CVS
160 tarball.</ulink> Again, we refer you to the Developer Manual.
163 <!-- Include supported.sgml boilerplate -->
165 <!-- end boilerplate -->
168 Note: If you have a previous <application>Junkbuster</application> or
169 <application>Privoxy</application> installation on your system, you
170 will need to remove it. Some platforms do this for you as part
171 of their installation procedure. (See below for your platform).
175 In any case <emphasis>be sure to backup your old configuration
176 if it is valuable to you.</emphasis> See the
177 <link linkend="upgradersnote">note to upgraders</link> section
181 <!-- ~~~~~ New section ~~~~~ -->
182 <sect2 id="installation-pack-rpm"><title>Red Hat and SuSE RPMs</title>
185 RPMs can be installed with <literal>rpm -Uvh privoxy-&p-version;-1.rpm</literal>,
186 and will use <filename>/etc/privoxy</filename> for the location
187 of configuration files.
191 Note that on Red Hat, <application>Privoxy</application> will
192 <emphasis>not</emphasis> be automatically started on system boot. You will
193 need to enable that using <command>chkconfig</command>,
194 <command>ntsysv</command>, or similar methods. Note that SuSE will
195 automatically start Privoxy in the boot process.
199 If you have problems with failed dependencies, try rebuilding the SRC RPM:
200 <literal>rpm --rebuild privoxy-&p-version;-1.src.rpm;</literal>. This
201 will use your locally installed libraries and RPM version.
205 Also note that if you have a <application>Junkbuster</application> RPM installed
206 on your system, you need to remove it first, because the packages conflict.
207 Otherwise, RPM will try to remove <application>Junkbuster</application>
208 automatically, before installing <application>Privoxy</application>.
212 <!-- ~~~~~ New section ~~~~~ -->
213 <sect2 id="installation-deb"><title>Debian</title>
219 <!-- ~~~~~ New section ~~~~~ -->
220 <sect2 id="installation-pack-win"><title>Windows</title>
223 Just double-click the installer, which will guide you through
224 the installation process. You will find the configuration files
225 in the same directory as you installed Privoxy in. We do not
226 use the registry of Windows.
230 <!-- ~~~~~ New section ~~~~~ -->
231 <sect2 id="installation-pack-bintgz"><title>Solaris, NetBSD, FreeBSD, HP-UX</title>
234 Create a new directory, <literal>cd</literal> to it, then unzip and
235 untar the archive. For the most part, you'll have to figure out where
240 <!-- ~~~~~ New section ~~~~~ -->
241 <sect2 id="installation-os2"><title>OS/2</title>
244 First, make sure that no previous installations of
245 <application>Junkbuster</application> and / or
246 <application>Privoxy</application> are left on your
247 system. You can do this by
251 Then, just double-click the WarpIN self-installing archive, which will
252 guide you through the installation process. A shadow of the
253 <application>Privoxy</application> executable will be placed in your
254 startup folder so it will start automatically whenever OS/2 starts.
258 The directory you choose to install <application>Privoxy</application>
259 into will contain all of the configuration files.
263 <!-- ~~~~~ New section ~~~~~ -->
264 <sect2 id="installation-mac"><title>Max OSX</title>
266 Unzip the downloaded package (you can either double-click on the file
267 in the finder, or on the desktop if you downloaded it there). Then,
268 double-click on the package installer icon and follow the installation
270 <application>Privoxy</application> will be installed in the subdirectory
271 <literal>/Applications/Privoxy.app</literal>.
272 <application>Privoxy</application> will set itself up to start
273 automatically on system bring-up via
274 <literal>/System/Library/StartupItems/Privoxy</literal>.
278 <!-- ~~~~~ New section ~~~~~ -->
279 <sect2 id="installation-amiga"><title>AmigaOS</title>
281 Copy and then unpack the <filename>lha</filename> archive to a suitable location.
282 All necessary files will be installed into <application>Privoxy</application>
283 directory, including all configuration and log files. To uninstall, just
284 remove this directory.
287 Start <application>Privoxy</application> (with RUN <>NIL:) in your
288 <filename>startnet</filename> script (AmiTCP), in
289 <filename>s:user-startup</filename> (RoadShow), as startup program in your
290 startup script (Genesis), or as startup action (Miami and MiamiDx).
291 <application>Privoxy</application> will automatically quit when you quit your
292 TCP/IP stack (just ignore the harmless warning your TCP/IP stack may display that
293 <application>Privoxy</application> is still running).
298 <!-- ~ End section ~ -->
300 <!-- ~~~~~ New section ~~~~~ -->
301 <sect1 id="upgradersnote">
302 <title>Note to Upgraders</title>
304 There are very significant changes from older versions of
305 <application>Junkbuster</application> to the current
306 <application>Privoxy</application>. Configuration is substantially
307 changed. <application>Junkbuster 2.0.x</application> and earlier
308 configuration files will not migrate. The functionality of the old
309 <filename>blockfile</filename>, <filename>cookiefile</filename> and
310 <filename>imagelist</filename>, are now combined into the
311 <quote>actions files</quote>. <filename>default.action</filename>,
312 is the main actions file. Local exceptions should best be put into
313 <filename>user.action</filename>.
316 A <quote>filter file</quote> (typically <filename>default.filter</filename>)
317 is new as of <application>Privoxy 2.9.x</application>, and provides some
318 of the new sophistication (explained below). <filename>config</filename> is
319 much the same as before.
322 If upgrading from a 2.0.x version, you will have to use the new config
323 files, and possibly adapt any personal rules from your older files.
324 When porting personal rules over from the old <filename>blockfile</filename>
325 to the new actions files, please note that even the pattern syntax has
326 changed. If upgrading from 2.9.x development versions, it is still
327 recommended to use the new configuration files.
330 A quick list of things to be aware of before upgrading:
338 The default listening port is now 8118 due to a conflict with another
344 Some installers may remove earlier versions completely. Save any
345 important configuration files!
350 <application>Privoxy</application> is controllable with a web browser
351 at the special URL: <ulink
352 url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
353 (Shortcut: <ulink url="http://p.p/">http://p.p/</ulink>). Many
354 aspects of configuration can be done here, including temporarily disabling
355 <application>Privoxy</application>.
360 The primary configuration file for cookie management, ad and banner
361 blocking, and many other aspects of <application>Privoxy</application>
362 configuration is in the <quote>actions</quote> files. It is strongly
363 recommended to become familiar with the new actions concept below,
364 before modifying these files. Locally defined rules
365 should go into <filename>user.action</filename>.
370 <!-- I think it is best to keep this somewhat vague, in case -->
371 <!-- the situation changes under our feet. -->
372 Some installers may not automatically start
373 <application>Privoxy</application> after installation.
381 <!-- ~~~~~ New section ~~~~~ -->
382 <sect1 id="quickstart"><title>Quickstart to Using <application>Privoxy</application></title>
388 Install <application>Privoxy</application>. See the section <link linkend="installation">Installing</link>.
394 Start <application>Privoxy</application>. See the section <link linkend="startup">Starting <application>Privoxy</application></link>.
400 Change your browser's configuration to use the proxy <literal>localhost</literal> on port
401 <literal>8118</literal>. See the section <link linkend="startup">Starting <application>Privoxy</application></link>.
407 Enjoy surfing with enhanced comfort and privacy. Please see the section
408 <link linkend="contact">Contacting the Developers</link> on how to report
409 bugs or problems with websites or to get help. You may want to change the
410 file <filename>user.action</filename> to further tweak your new browsing
420 <!-- ~~~~~ New section ~~~~~ -->
422 <title>Starting <application>Privoxy</application></title>
424 Before launching <application>Privoxy</application> for the first time, you
425 will want to configure your browser(s) to use <application>Privoxy</application>
426 as a HTTP and HTTPS proxy. The default is localhost for the proxy address,
427 and port 8118 (earlier versions used port 8000). This is the one
428 configuration step that must be done!
432 With <application>Netscape</application> (and
433 <application>Mozilla</application>), this can be set under <literal>Edit
434 -> Preferences -> Advanced -> Proxies -> HTTP Proxy</literal>.
435 For <application>Internet Explorer</application>: <literal>Tools ->
436 Internet Properties -> Connections -> LAN Setting</literal>. Then,
437 check <quote>Use Proxy</quote> and fill in the appropriate info (Address:
438 localhost, Port: 8118). Include if HTTPS proxy support too.
442 After doing this, flush your browser's disk and memory caches to force a
443 re-reading of all pages and to get rid of any ads that may be cached. You
444 are now ready to start enjoying the benefits of using
445 <application>Privoxy</application>!
450 <application>Privoxy</application> is typically started by specifying the
451 main configuration file to be used on the command line. Example Unix startup
458 # /usr/sbin/privoxy /etc/privoxy/config
463 See <link linkend="cmdoptions">below</link> for other command line options.
467 An init script is provided for SuSE and Red Hat.
471 For for SuSE: <command>rcprivoxy start</command>
475 For Red Hat and Debian: <command>/etc/rc.d/init.d/privoxy start</command>
480 If no configuration file is specified on the command line,
481 <application>Privoxy</application> will look for a file named
482 <filename>config</filename> in the current directory. Except on Win32 where
483 it will try <filename>config.txt</filename>. If no file is specified on the
484 command line and no default configuration file can be found,
485 <application>Privoxy</application> will fail to start.
490 The included default configuration files should give a reasonable starting
491 point. Most of the per site configuration is done in the
492 <quote>actions</quote> files. These are where various cookie actions are
493 defined, ad and banner blocking, and other aspects of
494 <application>Privoxy</application> configuration. There are several such
495 files included, with varying levels of aggressiveness.
499 You will probably want to keep an eye out for sites for which you may prefer
500 persistent cookies, and add these to your actions configuration as needed. By
501 default, most of these will be accepted only during the current browser
502 session (aka <quote>session cookies</quote>), unless you add them to the
503 configuration. If you want the browser to handle this instead, you will need
504 to edit <filename>user.action</filename> (or through the web based interface)
505 and disable this feature. If you use more than one browser, it would make
506 more sense to let <application>Privoxy</application> handle this. In which
507 case, the browser(s) should be set to accept all cookies.
511 Another feature where you will probably want to define exceptions for trusted
512 sites is the popup-killing (through the <literal>+popup</literal> and
513 <literal>+filter{popups}</literal> actions), because your favorite shopping,
514 banking, or leisure site may need popups (explained below).
518 <application>Privoxy</application> is HTTP/1.1 compliant, but not all of
519 the optional 1.1 features are as yet supported. In the unlikely event that
520 you experience inexplicable problems with browsers that use HTTP/1.1 per default
521 (like <application>Mozilla</application> or recent versions of I.E.), you might
522 try to force HTTP/1.0 compatibility. For Mozilla, look under <literal>Edit ->
523 Preferences -> Debug -> Networking</literal>.
524 Alternatively, set the <quote>+downgrade-http-version</quote> config option in
525 <filename>default.action</filename> which will downgrade your browser's HTTP
526 requests from HTTP/1.1 to HTTP/1.0 before processing them.
530 After running <application>Privoxy</application> for a while, you can
531 start to fine tune the configuration to suit your personal, or site,
532 preferences and requirements. There are many, many aspects that can
533 be customized. <quote>Actions</quote>
534 can be adjusted by pointing your browser to
535 <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
536 (shortcut: <ulink url="http://p.p/">http://p.p/</ulink>),
537 and then follow the link to <quote>View & Change the Current Configuration</quote>.
538 (This is an internal page and does not require Internet access.)
542 In fact, various aspects of <application>Privoxy</application>
543 configuration can be viewed from this page, including
544 current configuration parameters, source code version numbers,
545 the browser's request headers, and <quote>actions</quote> that apply
546 to a given URL. In addition to the actions file
547 editor mentioned above, <application>Privoxy</application> can also
548 be turned <quote>on</quote> and <quote>off</quote> (toggled) from this page.
552 If you encounter problems, try loading the page without
553 <application>Privoxy</application>. If that helps, enter the URL where
554 you have the problems into <ulink url="http://p.p/show-url-info">the browser
555 based rule tracing utility</ulink>. See which rules apply and why, and
556 then try turning them off for that site one after the other, until the problem
557 is gone. When you have found the culprit, you might want to turn the rest on
562 If the above paragraph sounds gibberish to you, you might want to <ulink
563 url="configuration.html#ACTIONSFILE">read more about the actions concept</ulink>
564 or even dive deep into the <ulink url="appendix.html#ACTIONSANAT">Appendix
569 If you can't get rid of the problem at all, think you've found a bug in
570 Privoxy, want to propose a new feature or smarter rules, please see the
571 section <ulink url="contact.html"><quote>Contacting the
572 Developers</quote></ulink> below.
575 <!-- ~~~~~ New section ~~~~~ -->
576 <sect2 id="cmdoptions">
577 <title>Command Line Options</title>
579 <application>Privoxy</application> may be invoked with the following
580 command-line options:
588 <emphasis>--version</emphasis>
591 Print version info and exit. Unix only.
596 <emphasis>--help</emphasis>
599 Print short usage info and exit. Unix only.
604 <emphasis>--no-daemon</emphasis>
607 Don't become a daemon, i.e. don't fork and become process group
608 leader, and don't detach from controlling tty. Unix only.
613 <emphasis>--pidfile FILE</emphasis>
617 On startup, write the process ID to <emphasis>FILE</emphasis>. Delete the
618 <emphasis>FILE</emphasis> on exit. Failure to create or delete the
619 <emphasis>FILE</emphasis> is non-fatal. If no <emphasis>FILE</emphasis>
620 option is given, no PID file will be used. Unix only.
625 <emphasis>--user USER[.GROUP]</emphasis>
629 After (optionally) writing the PID file, assume the user ID of
630 <emphasis>USER</emphasis>, and if included the GID of GROUP. Exit if the
631 privileges are not sufficient to do so. Unix only.
636 <emphasis>configfile</emphasis>
639 If no <emphasis>configfile</emphasis> is included on the command line,
640 <application>Privoxy</application> will look for a file named
641 <quote>config</quote> in the current directory (except on Win32
642 where it will look for <quote>config.txt</quote> instead). Specify
643 full path to avoid confusion. If no config file is found,
644 <application>Privoxy</application> will fail to start.
655 <!-- ~ End section ~ -->
658 <!-- ~~~~~ New section ~~~~~ -->
659 <sect1 id="configuration"><title><application>Privoxy</application> Configuration</title>
661 All <application>Privoxy</application> configuration is stored
662 in text files. These files can be edited with a text editor.
663 Many important aspects of <application>Privoxy</application> can
664 also be controlled easily with a web browser.
668 <!-- ~~~~~ New section ~~~~~ -->
671 <title>Controlling <application>Privoxy</application> with Your Web Browser</title>
673 <application>Privoxy</application>'s user interface can be reached through the special
674 URL <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
675 (shortcut: <ulink url="http://p.p/">http://p.p/</ulink>),
676 which is a built-in page and works without Internet access.
677 You will see the following section:
681 <!-- Needs to be put in a table and colorized -->
684 <bridgehead renderas="sect2">Privoxy Menu</bridgehead>
688 ▪ <ulink url="http://config.privoxy.org/show-status">View & change the current configuration</ulink>
691 ▪ <ulink url="http://config.privoxy.org/show-version">View the source code version numbers</ulink>
694 ▪ <ulink url="http://config.privoxy.org/show-request">View the request headers.</ulink>
697 ▪ <ulink url="http://config.privoxy.org/show-url-info">Look up which actions apply to a URL and why</ulink>
700 ▪ <ulink url="http://config.privoxy.org/toggle">Toggle Privoxy on or off</ulink>
708 This should be self-explanatory. Note the first item leads to an editor for the
709 <quote>actions list</quote>, which is where the ad, banner, cookie,
710 and URL blocking magic is configured as well as other advanced features of
711 <application>Privoxy</application>. This is an easy way to adjust various
712 aspects of <application>Privoxy</application> configuration. The actions
713 file, and other configuration files, are explained in detail below.
717 <quote>Toggle Privoxy On or Off</quote> is handy for sites that might
718 have problems with your current actions and filters. You can in fact use
719 it as a test to see whether it is <application>Privoxy</application>
720 causing the problem or not. <application>Privoxy</application> continues
721 to run as a proxy in this case, but all filtering is disabled. There
722 is even a toggle <link linkend="bookmarklets">Bookmarklet</link> offered, so
723 that you can toggle <application>Privoxy</application> with one click from
729 <!-- ~ End section ~ -->
734 <!-- ~~~~~ New section ~~~~~ -->
736 <sect2 id="confoverview">
737 <title>Configuration Files Overview</title>
739 For Unix, *BSD and Linux, all configuration files are located in
740 <filename>/etc/privoxy/</filename> by default. For MS Windows, OS/2, and
741 AmigaOS these are all in the same directory as the
742 <application>Privoxy</application> executable. <![%p-not-stable;[ The name
743 and number of configuration files has changed from previous versions, and is
744 subject to change as development progresses.]]>
748 The installed defaults provide a reasonable starting point, though
749 some settings may be aggressive by some standards. For the time being, the
750 principle configuration files are:
758 The main configuration file is named <link linkend="config">config</link>
759 on Linux, Unix, BSD, OS/2, and AmigaOS and <filename>config.txt</filename>
760 on Windows. This is a required file.
766 <filename>default.action</filename> (the main <link linkend="actions-file">actions file</link>) is used to define
767 the default settings for various <quote>actions</quote> relating to images, banners,
768 pop-ups, access restrictions, banners and cookies.
771 Multiple actions files may be defined in <filename>config</filename>. These
772 are processed in the order they are defined. Local customizations and locally
773 preferred exceptions to the default policies as defined in
774 <filename>default.action</filename> are probably best applied in
775 <filename>user.action</filename>, which should be preserved across
776 upgrades. <filename>standard.action</filename> is also included. This is mostly
777 for <application>Privoxy's</application> internal use.
780 There is also a web based editor that can be accessed from
782 url="http://config.privoxy.org/show-status/">http://config.privoxy.org/show-status/</ulink>
784 url="http://p.p/show-status/">http://p.p/show-status/</ulink>) for the
785 various actions files.
791 <filename>default.filter</filename> (the <link linkend="filter-file">filter
792 file</link>) can be used to re-write the raw page content, including
793 viewable text as well as embedded HTML and JavaScript, and whatever else
794 lurks on any given web page. The filtering jobs are only pre-defined here;
795 whether to apply them or not is up to the actions files.
803 All files use the <quote><literal>#</literal></quote> character to denote a
804 comment (the rest of the line will be ignored) angd understand line continuation
805 through placing a backslash ("<literal>\</literal>") as the very last character
806 in a line. If the <literal>#</literal> is preceded by a backslash, it looses
807 its special function. Placing a <literal>#</literal> in front of an otherwise
808 valid configuration line to prevent it from being interpreted is called "commenting
813 The actions files and <filename>default.filter</filename>
814 can use Perl style <link linkend="regex">regular expressions</link> for
819 After making any changes, there is no need to restart
820 <application>Privoxy</application> in order for the changes to take
821 effect. <application>Privoxy</application> detects such changes
822 automatically. Note, however, that it may take one or two additional
823 requests for the change to take effect. When changing the listening address
824 of <application>Privoxy</application>, these <quote>wake up</quote> requests
825 must obviously be sent to the <emphasis>old</emphasis> listening address.
830 While under development, the configuration content is subject to change.
831 The below documentation may not be accurate by the time you read this.
832 Also, what constitutes a <quote>default</quote> setting, may change, so
833 please check all your configuration files on important issues.
839 <!-- ~~~~~ New section ~~~~~ -->
842 <title>The Main Configuration File</title>
844 Again, the main configuration file is named <filename>config</filename> on
845 Linux/Unix/BSD and OS/2, and <filename>config.txt</filename> on Windows.
846 Configuration lines consist of an initial keyword followed by a list of
847 values, all separated by whitespace (any number of spaces or tabs). For
855 <emphasis>confdir /etc/privoxy</emphasis>
862 Assigns the value <literal>/etc/privoxy</literal> to the option
863 <literal>confdir</literal> and thus indicates that the configuration
864 directory is named <quote>/etc/privoxy/</quote>.
868 All options in the config file except for <literal>confdir</literal> and
869 <literal>logdir</literal> are optional. Watch out in the below description
870 for what happens if you leave them unset.
874 The main config file controls all aspects of <application>Privoxy</application>'s
875 operation that are not location dependent (i.e. they apply universally, no matter
876 where you may be surfing).
880 <!-- ~~~~~ New section ~~~~~ -->
882 <sect3 id="conf-log-loc">
883 <title>Configuration and Log File Locations</title>
886 <application>Privoxy</application> can (and normally does) use a number of
887 other files for additional configuration and logging.
888 This section of the configuration file tells <application>Privoxy</application>
889 where to find those other files.
893 <sect4 id="confdir"><title>confdir</title>
897 <term>Specifies:</term>
899 <para>The directory where the other configuration files are located</para>
903 <term>Type of value:</term>
905 <para>Path name</para>
909 <term>Default value:</term>
911 <para>/etc/privoxy (Unix) <emphasis>or</emphasis> <application>Privoxy</application> installation dir (Windows) </para>
915 <term>Effect if unset:</term>
917 <para><emphasis>Mandatory</emphasis></para>
924 No trailing <quote><literal>/</literal></quote>, please
927 When development goes modular and multi-user, the blocker, filter, and
928 per-user config will be stored in subdirectories of <quote>confdir</quote>.
929 For now, the configuration directory structure is flat, except for
930 <filename>confdir/templates</filename>, where the HTML templates for CGI
931 output reside (e.g. <application>Privoxy's</application> 404 error page).
939 <sect4 id="logdir"><title>logdir</title>
943 <term>Specifies:</term>
946 The directory where all logging takes place (i.e. where <filename>logfile</filename> and
947 <filename>jarfile</filename> are located)
952 <term>Type of value:</term>
954 <para>Path name</para>
958 <term>Default value:</term>
960 <para>/var/log/privoxy (Unix) <emphasis>or</emphasis> <application>Privoxy</application> installation dir (Windows) </para>
964 <term>Effect if unset:</term>
966 <para><emphasis>Mandatory</emphasis></para>
973 No trailing <quote><literal>/</literal></quote>, please
980 <sect4 id="actionsfile"><title>
981 <anchor id="default.action">
982 <anchor id="standard.action">
983 <anchor id="user.action">
989 <term>Specifies:</term>
992 The <link linkend="actions">actions</link> file(s) to use
997 <term>Type of value:</term>
999 <para>File name, relative to <literal>confdir</literal></para>
1003 <term>Default value:</term>
1007 <msgtext><literallayout> standard # Internal purposes, recommended not editing</literallayout></msgtext>
1010 <msgtext><literallayout> default # Main actions file</literallayout></msgtext>
1013 <msgtext><literallayout> user # User customizations</literallayout></msgtext>
1019 <term>Effect if unset:</term>
1022 No actions are taken at all. Simple neutral proxying.
1030 Multiple <literal>actionsfile</literal> lines are OK and are in fact recommended!
1033 The default values include standard.action, which is used for internal
1034 purposes and should be loaded, default.action, which is the
1035 <quote>main</quote> actions file maintained by the developers, and
1036 <filename>user.action</filename>, where you can make your personal additions.
1039 There is no point in using <application>Privoxy</application> without an actions file.
1046 <sect4 id="filterfile"><title><anchor id="default.filter">filterfile</title>
1049 <term>Specifies:</term>
1052 The <link linkend="filter">filter</link> file to use
1057 <term>Type of value:</term>
1059 <para>File name, relative to <literal>confdir</literal></para>
1063 <term>Default value:</term>
1065 <para>default.filter (Unix) <emphasis>or</emphasis> default.filter.txt (Windows)</para>
1069 <term>Effect if unset:</term>
1072 No textual content filtering takes place, i.e. all
1073 <literal>+filter{<replaceable class="parameter">name</replaceable>}</literal>
1074 actions in the actions files are turned off
1082 The <quote>default.filter</quote> file contains content modification rules
1083 that use <quote>regular expressions</quote>. These rules permit powerful
1084 changes on the content of Web pages, e.g., you could disable your favorite
1085 JavaScript annoyances, re-write the actual displayed text, or just have some
1086 fun replacing <quote>Microsoft</quote> with <quote>MicroSuck</quote> wherever
1087 it appears on a Web page.
1094 <sect4 id="logfile"><title>logfile</title>
1098 <term>Specifies:</term>
1106 <term>Type of value:</term>
1108 <para>File name, relative to <literal>logdir</literal></para>
1112 <term>Default value:</term>
1114 <para>logfile (Unix) <emphasis>or</emphasis> privoxy.log (Windows)</para>
1118 <term>Effect if unset:</term>
1121 No log file is used, all log messages go to the console (<literal>stderr</literal>).
1129 The windows version will additionally log to the console.
1132 The logfile is where all logging and error messages are written. The level
1133 of detail and number of messages are set with the <literal>debug</literal>
1134 option (see below). The logfile can be useful for tracking down a problem with
1135 <application>Privoxy</application> (e.g., it's not blocking an ad you
1136 think it should block) but in most cases you probably will never look at it.
1139 Your logfile will grow indefinitely, and you will probably want to
1140 periodically remove it. On Unix systems, you can do this with a cron job
1141 (see <quote>man cron</quote>). For Red Hat, a <command>logrotate</command>
1142 script has been included.
1145 On SuSE Linux systems, you can place a line like <quote>/var/log/privoxy.*
1146 +1024k 644 nobody.nogroup</quote> in <filename>/etc/logfiles</filename>, with
1147 the effect that cron.daily will automatically archive, gzip, and empty the
1148 log, when it exceeds 1M size.
1155 <sect4 id="jarfile"><title>jarfile</title>
1159 <term>Specifies:</term>
1162 The file to store intercepted cookies in
1167 <term>Type of value:</term>
1169 <para>File name, relative to <literal>logdir</literal></para>
1173 <term>Default value:</term>
1175 <para>jarfile (Unix) <emphasis>or</emphasis> privoxy.jar (Windows)</para>
1179 <term>Effect if unset:</term>
1182 Intercepted cookies are not stored at all.
1190 The jarfile may grow to ridiculous sizes over time.
1197 <sect4 id="trustfile"><title>trustfile</title>
1201 <term>Specifies:</term>
1204 The trust file to use
1209 <term>Type of value:</term>
1211 <para>File name, relative to <literal>confdir</literal></para>
1215 <term>Default value:</term>
1217 <para><emphasis>Unset (commented out)</emphasis>. When activated: trust (Unix) <emphasis>or</emphasis> trust.txt (Windows)</para>
1221 <term>Effect if unset:</term>
1224 The whole trust mechanism is turned off.
1232 The trust mechanism is an experimental feature for building white-lists and should
1233 be used with care. It is <emphasis>NOT</emphasis> recommended for the casual user.
1236 If you specify a trust file, <application>Privoxy</application> will only allow
1237 access to sites that are named in the trustfile.
1238 You can also mark sites as trusted referrers (with <literal>+</literal>), with
1239 the effect that access to untrusted sites will be granted, if a link from a
1240 trusted referrer was used.
1241 The link target will then be added to the <quote>trustfile</quote>.
1242 Possible applications include limiting Internet access for children.
1245 If you use <literal>+</literal> operator in the trust file, it may grow considerably over time.
1254 <!-- ~ End section ~ -->
1258 <!-- ~~~~~ New section ~~~~~ -->
1260 <sect3 id="local-set-up">
1261 <title>Local Set-up Documentation</title>
1264 If you intend to operate <application>Privoxy</application> for more users
1265 that just yourself, it might be a good idea to let them know how to reach
1266 you, what you block and why you do that, your policies etc.
1269 <sect4 id="trust-info-url"><title>trust-info-url</title>
1273 <term>Specifies:</term>
1276 A URL to be displayed in the error page that users will see if access to an untrusted page is denied.
1281 <term>Type of value:</term>
1287 <term>Default value:</term>
1289 <para>Two example URL are provided</para>
1293 <term>Effect if unset:</term>
1296 No links are displayed on the "untrusted" error page.
1304 The value of this option only matters if the experimental trust mechanism has been
1305 activated. (See <literal>trustfile</literal> above.)
1308 If you use the trust mechanism, it is a good idea to write up some on-line
1309 documentation about your trust policy and to specify the URL(s) here.
1310 Use multiple times for multiple URLs.
1313 The URL(s) should be added to the trustfile as well, so users don't end up
1314 locked out from the information on why they were locked out in the first place!
1321 <sect4 id="admin-address"><title>admin-address</title>
1325 <term>Specifies:</term>
1328 An email address to reach the proxy administrator.
1333 <term>Type of value:</term>
1335 <para>Email address</para>
1339 <term>Default value:</term>
1341 <para><emphasis>Unset</emphasis></para>
1345 <term>Effect if unset:</term>
1348 No email address is displayed on error pages and the CGI user interface.
1356 If both <literal>admin-address</literal> and <literal>proxy-info-url</literal>
1357 are unset, the whole "Local Privoxy Support" box on all generated pages will
1365 <sect4 id="proxy-info-url"><title>proxy-info-url</title>
1369 <term>Specifies:</term>
1372 A URL to documentation about the local <application>Privoxy</application> setup,
1373 configuration or policies.
1378 <term>Type of value:</term>
1384 <term>Default value:</term>
1386 <para><emphasis>Unset</emphasis></para>
1390 <term>Effect if unset:</term>
1393 No link to local documentation is displayed on error pages and the CGI user interface.
1401 If both <literal>admin-address</literal> and <literal>proxy-info-url</literal>
1402 are unset, the whole "Local Privoxy Support" box on all generated pages will
1406 This URL shouldn't be blocked ;-)
1414 <!-- ~ End section ~ -->
1416 <!-- ~~~~~ New section ~~~~~ -->
1418 <sect3 id="debugging">
1419 <title>Debugging</title>
1422 These options are mainly useful when tracing a problem.
1423 Note that you might also want to invoke
1424 <application>Privoxy</application> with the <literal>--no-daemon</literal>
1425 command line option when debugging.
1428 <sect4 id="debug"><title>debug</title>
1432 <term>Specifies:</term>
1435 Key values that determine what information gets logged.
1440 <term>Type of value:</term>
1442 <para>Integer values</para>
1446 <term>Default value:</term>
1448 <para>12289 (i.e.: URLs plus informational and warning messages)</para>
1452 <term>Effect if unset:</term>
1455 Nothing gets logged.
1463 The available debug levels are:
1467 debug 1 # show each GET/POST/CONNECT request
1468 debug 2 # show each connection status
1469 debug 4 # show I/O status
1470 debug 8 # show header parsing
1471 debug 16 # log all data into the logfile
1472 debug 32 # debug force feature
1473 debug 64 # debug regular expression filter
1474 debug 128 # debug fast redirects
1475 debug 256 # debug GIF de-animation
1476 debug 512 # Common Log Format
1477 debug 1024 # debug kill pop-ups
1478 debug 4096 # Startup banner and warnings.
1479 debug 8192 # Non-fatal errors
1483 To select multiple debug levels, you can either add them or use
1484 multiple <literal>debug</literal> lines.
1487 A debug level of 1 is informative because it will show you each request
1488 as it happens. <emphasis>1, 4096 and 8192 are highly recommended</emphasis>
1489 so that you will notice when things go wrong. The other levels are probably
1490 only of interest if you are hunting down a specific problem. They can produce
1491 a hell of an output (especially 16).
1495 The reporting of <emphasis>fatal</emphasis> errors (i.e. ones which crash
1496 <application>Privoxy</application>) is always on and cannot be disabled.
1499 If you want to use CLF (Common Log Format), you should set <quote>debug
1500 512</quote> <emphasis>ONLY</emphasis> and not enable anything else.
1507 <sect4 id="single-threaded"><title>single-threaded</title>
1511 <term>Specifies:</term>
1514 Whether to run only one server thread
1519 <term>Type of value:</term>
1521 <para><emphasis>None</emphasis></para>
1525 <term>Default value:</term>
1527 <para><emphasis>Unset</emphasis></para>
1531 <term>Effect if unset:</term>
1534 Multi-threaded (or, where unavailable: forked) operation, i.e. the ability to
1535 serve multiple requests simultaneously.
1543 This option is only there for debug purposes and you should never
1544 need to use it. <emphasis>It will drastically reduce performance.</emphasis>
1553 <!-- ~~~~~ New section ~~~~~ -->
1555 <sect3 id="access-control">
1556 <title>Access Control and Security</title>
1559 This section of the config file controls the security-relevant aspects
1560 of <application>Privoxy</application>'s configuration.
1563 <sect4 id="listen-address"><title>listen-address</title>
1567 <term>Specifies:</term>
1570 The IP address and TCP port on which <application>Privoxy</application> will
1571 listen for client requests.
1576 <term>Type of value:</term>
1578 <para>[<replaceable class="parameter">IP-Address</replaceable>]:<replaceable class="parameter">Port</replaceable></para>
1582 <term>Default value:</term>
1584 <para>localhost:8118</para>
1588 <term>Effect if unset:</term>
1591 Bind to localhost (127.0.0.1), port 8118. This is suitable and recommended for
1592 home users who run <application>Privoxy</application> on the same machine as
1601 You will need to configure your browser(s) to this proxy address and port.
1604 If you already have another service running on port 8118, or if you want to
1605 serve requests from other machines (e.g. on your local network) as well, you
1606 will need to override the default.
1609 If you leave out the IP address, <application>Privoxy</application> will
1610 bind to all interfaces (addresses) on your machine and may become reachable
1611 from the Internet. In that case, consider using access control lists (ACL's)
1612 (see <quote>ACLs</quote> below), or a firewall.
1617 <term>Example:</term>
1620 Suppose you are running <application>Privoxy</application> on
1621 a machine which has the address 192.168.0.1 on your local private network
1622 (192.168.0.0) and has another outside connection with a different address.
1623 You want it to serve requests from inside only:
1627 listen-address 192.168.0.1:8118
1635 <sect4 id="toggle"><title>toggle</title>
1639 <term>Specifies:</term>
1642 Initial state of "toggle" status
1647 <term>Type of value:</term>
1653 <term>Default value:</term>
1659 <term>Effect if unset:</term>
1662 Act as if toggled on
1670 If set to 0, <application>Privoxy</application> will start in
1671 <quote>toggled off</quote> mode, i.e. behave like a normal, content-neutral
1672 proxy. See <literal>enable-remote-toggle</literal>
1673 below. This is not really useful anymore, since toggling is much easier
1674 via <ulink url="http://config.privoxy.org/toggle">the web
1675 interface</ulink> then via editing the <filename>conf</filename> file.
1678 The windows version will only display the toggle icon in the system tray
1679 if this option is present.
1687 <sect4 id="enable-remote-toggle"><title>enable-remote-toggle</title>
1690 <term>Specifies:</term>
1693 Whether or not the <ulink url="http://config.privoxy.org/toggle">web-based toggle
1694 feature</ulink> may be used
1699 <term>Type of value:</term>
1705 <term>Default value:</term>
1711 <term>Effect if unset:</term>
1714 The web-based toggle feature is disabled.
1722 When toggled off, <application>Privoxy</application> acts like a normal,
1723 content-neutral proxy, i.e. it acts as if none of the actions applied to
1727 For the time being, access to the toggle feature can <emphasis>not</emphasis> be
1728 controlled separately by <quote>ACLs</quote> or HTTP authentication,
1729 so that everybody who can access <application>Privoxy</application> (see
1730 <quote>ACLs</quote> and <literal>listen-address</literal> above) can
1731 toggle it for all users. So this option is <emphasis>not recommended</emphasis>
1732 for multi-user environments with untrusted users.
1735 Note that you must have compiled <application>Privoxy</application> with
1736 support for this feature, otherwise this option has no effect.
1744 <sect4 id="enable-edit-actions"><title>enable-edit-actions</title>
1747 <term>Specifies:</term>
1750 Whether or not the <ulink url="http://config.privoxy.org/show-status">web-based actions
1751 file editor</ulink> may be used
1756 <term>Type of value:</term>
1762 <term>Default value:</term>
1768 <term>Effect if unset:</term>
1771 The web-based actions file editor is disabled.
1779 For the time being, access to the editor can <emphasis>not</emphasis> be
1780 controlled separately by <quote>ACLs</quote> or HTTP authentication,
1781 so that everybody who can access <application>Privoxy</application> (see
1782 <quote>ACLs</quote> and <literal>listen-address</literal> above) can
1783 modify its configuration for all users. So this option is <emphasis>not
1784 recommended</emphasis> for multi-user environments with untrusted users.
1787 Note that you must have compiled <application>Privoxy</application> with
1788 support for this feature, otherwise this option has no effect.
1795 <sect4 id="acls"><title>
1796 <anchor id="permit-acces">
1797 <anchor id="deny-acces">
1798 ACLs: permit-access and deny-access</title>
1802 <term>Specifies:</term>
1805 Who can access what.
1810 <term>Type of value:</term>
1813 <replaceable class="parameter">src_addr</replaceable>[/<replaceable class="parameter">src_masklen</replaceable>]
1814 [<replaceable class="parameter">dst_addr</replaceable>[/<replaceable class="parameter">dst_masklen</replaceable>]]
1817 Where <replaceable class="parameter">src_addr</replaceable> and
1818 <replaceable class="parameter">dst_addr</replaceable> are IP addresses in dotted decimal notation or valid
1819 DNS names, and <replaceable class="parameter">src_masklen</replaceable> and
1820 <replaceable class="parameter">dst_masklen</replaceable> are subnet masks in CIDR notation, i.e. integer
1821 values from 2 to 30 representing the length (in bits) of the network address. The masks and the whole
1822 destination part are optional.
1827 <term>Default value:</term>
1829 <para><emphasis>Unset</emphasis></para>
1833 <term>Effect if unset:</term>
1836 Don't restrict access further than implied by <literal>listen-address</literal>
1844 Access controls are included at the request of ISPs and systems
1845 administrators, and <emphasis>are not usually needed by individual users</emphasis>.
1846 For a typical home user, it will normally suffice to ensure that
1847 <application>Privoxy</application> only listens on the localhost or internal (home)
1848 network address by means of the <literal>listen-address</literal> option.
1851 Please see the warnings in the FAQ that this proxy is not intended to be a substitute
1852 for a firewall or to encourage anyone to defer addressing basic security
1856 Multiple ACL lines are OK.
1857 If any ACLs are specified, then the <application>Privoxy</application>
1858 talks only to IP addresses that match at least one <literal>permit-access</literal> line
1859 and don't match any subsequent <literal>deny-access</literal> line. In other words, the
1860 last match wins, with the default being <literal>deny-access</literal>.
1863 If <application>Privoxy</application> is using a forwarder (see <literal>forward</literal> below)
1864 for a particular destination URL, the <replaceable class="parameter">dst_addr</replaceable>
1865 that is examined is the address of the forwarder and <emphasis>NOT</emphasis> the address
1866 of the ultimate target. This is necessary because it may be impossible for the local
1867 <application>Privoxy</application> to determine the IP address of the
1868 ultimate target (that's often what gateways are used for).
1871 You should prefer using IP addresses over DNS names, because the address lookups take
1872 time. All DNS names must resolve! You can <emphasis>not</emphasis> use domain patterns
1873 like <quote>*.org</quote> or partial domain names. If a DNS name resolves to multiple
1874 IP addresses, only the first one is used.
1877 Denying access to particular sites by ACL may have undesired side effects
1878 if the site in question is hosted on a machine which also hosts other sites.
1883 <term>Examples:</term>
1886 Explicitly define the default behavior if no ACL and
1887 <literal>listen-address</literal> are set: <quote>localhost</quote>
1888 is OK. The absence of a <replaceable class="parameter">dst_addr</replaceable> implies that
1889 <emphasis>all</emphasis> destination addresses are OK:
1893 permit-access localhost
1897 Allow any host on the same class C subnet as www.privoxy.org access to
1898 nothing but www.example.com:
1902 permit-access www.privoxy.org/24 www.example.com/32
1906 Allow access from any host on the 26-bit subnet 192.168.45.64 to anywhere,
1907 with the exception that 192.168.45.73 may not access www.dirty-stuff.example.com:
1911 permit-access 192.168.45.64/26
1912 deny-access 192.168.45.73 www.dirty-stuff.example.com
1920 <sect4 id="buffer-limit"><title>buffer-limit</title>
1924 <term>Specifies:</term>
1927 Maximum size of the buffer for content filtering.
1932 <term>Type of value:</term>
1934 <para>Size in Kbytes</para>
1938 <term>Default value:</term>
1944 <term>Effect if unset:</term>
1947 Use a 4MB (4096 KB) limit.
1955 For content filtering, i.e. the <literal>+filter</literal> and
1956 <literal>+deanimate-gif</literal> actions, it is necessary that
1957 <application>Privoxy</application> buffers the entire document body.
1958 This can be potentially dangerous, since a server could just keep sending
1959 data indefinitely and wait for your RAM to exhaust -- with nasty consequences.
1963 When a document buffer size reaches the <literal>buffer-limit</literal>, it is
1964 flushed to the client unfiltered and no further attempt to
1965 filter the rest of the document is made. Remember that there may be multiple threads
1966 running, which might require up to <literal>buffer-limit</literal> Kbytes
1967 <emphasis>each</emphasis>, unless you have enabled <quote>single-threaded</quote>
1977 <!-- ~ End section ~ -->
1980 <!-- ~~~~~ New section ~~~~~ -->
1982 <sect3 id="forwarding">
1983 <title>Forwarding</title>
1986 This feature allows routing of HTTP requests through a chain of
1988 It can be used to better protect privacy and confidentiality when
1989 accessing specific domains by routing requests to those domains
1990 through an anonymous public proxy (see e.g. <ulink
1991 url="http://www.multiproxy.org/anon_list.htm">http://www.multiproxy.org/anon_list.htm</ulink>)
1992 Or to use a caching proxy to speed up browsing. Or chaining to a parent
1993 proxy may be necessary because the machine that <application>Privoxy</application>
1994 runs on has no direct Internet access.
1998 Also specified here are SOCKS proxies. <application>Privoxy</application>
1999 supports the SOCKS 4 and SOCKS 4A protocols.
2002 <sect4 id="forward"><title>forward</title>
2005 <term>Specifies:</term>
2008 To which parent HTTP proxy specific requests should be routed.
2013 <term>Type of value:</term>
2016 <replaceable class="parameter">target_domain</replaceable>[:<replaceable class="parameter">port</replaceable>]
2017 <replaceable class="parameter">http_parent</replaceable>[/<replaceable class="parameter">port</replaceable>]
2020 Where <replaceable class="parameter">target_domain</replaceable> is a domain name pattern (see the
2021 chapter on domain matching in the <filename>default.action</filename> file),
2022 <replaceable class="parameter">http_parent</replaceable> is the address of the parent HTTP proxy
2023 as an IP addresses in dotted decimal notation or as a valid DNS name (or <quote>.</quote> to denote
2024 <quote>no forwarding</quote>, and the optional
2025 <replaceable class="parameter">port</replaceable> parameters are TCP ports, i.e. integer
2026 values from 1 to 64535
2031 <term>Default value:</term>
2033 <para><emphasis>Unset</emphasis></para>
2037 <term>Effect if unset:</term>
2040 Don't use parent HTTP proxies.
2048 If <replaceable class="parameter">http_parent</replaceable> is <quote>.</quote>, then requests are not
2049 forwarded to another HTTP proxy but are made directly to the web servers.
2052 Multiple lines are OK, they are checked in sequence, and the last match wins.
2057 <term>Examples:</term>
2060 Everything goes to an example anonymizing proxy, except SSL on port 443 (which it doesn't handle):
2064 forward .* anon-proxy.example.org:8080
2069 Everything goes to our example ISP's caching proxy, except for requests
2070 to that ISP's sites:
2074 forward .*. caching-proxy.example-isp.net:8000
2075 forward .example-isp.net .
2083 <sect4 id="socks"><title>
2084 <anchor id="forward-socks4">
2085 <anchor id="forward-socks4a">
2086 forward-socks4 and forward-socks4a</title>
2090 <term>Specifies:</term>
2093 Through which SOCKS proxy (and to which parent HTTP proxy) specific requests should be routed.
2098 <term>Type of value:</term>
2101 <replaceable class="parameter">target_domain</replaceable>[:<replaceable class="parameter">port</replaceable>]
2102 <replaceable class="parameter">socks_proxy</replaceable>[/<replaceable class="parameter">port</replaceable>]
2103 <replaceable class="parameter">http_parent</replaceable>[/<replaceable class="parameter">port</replaceable>]
2106 Where <replaceable class="parameter">target_domain</replaceable> is a domain name pattern (see the
2107 chapter on domain matching in the <filename>default.action</filename> file),
2108 <replaceable class="parameter">http_parent</replaceable> and <replaceable class="parameter">socks_proxy</replaceable>
2109 are IP addresses in dotted decimal notation or valid DNS names (<replaceable class="parameter">http_parent</replaceable>
2110 may be <quote>.</quote> to denote <quote>no HTTP forwarding</quote>), and the optional
2111 <replaceable class="parameter">port</replaceable> parameters are TCP ports, i.e. integer values from 1 to 64535
2116 <term>Default value:</term>
2118 <para><emphasis>Unset</emphasis></para>
2122 <term>Effect if unset:</term>
2125 Don't use SOCKS proxies.
2133 Multiple lines are OK, they are checked in sequence, and the last match wins.
2136 The difference between <literal>forward-socks4</literal> and <literal>forward-socks4a</literal>
2137 is that in the SOCKS 4A protocol, the DNS resolution of the target hostname happens on the SOCKS
2138 server, while in SOCKS 4 it happens locally.
2141 If <replaceable class="parameter">http_parent</replaceable> is <quote>.</quote>, then requests are not
2142 forwarded to another HTTP proxy but are made (HTTP-wise) directly to the web servers, albeit through
2148 <term>Examples:</term>
2151 From the company example.com, direct connections are made to all
2152 <quote>internal</quote> domains, but everything outbound goes through
2153 their ISP's proxy by way of example.com's corporate SOCKS 4A gateway to
2158 forward-socks4a .*. socks-gw.example.com:1080 www-cache.example-isp.net:8080
2159 forward .example.com .
2163 A rule that uses a SOCKS 4 gateway for all destinations but no HTTP parent looks like this:
2167 forward-socks4 .*. socks-gw.example.com:1080 .
2175 <sect4 id="advanced-forwarding-examples"><title>Advanced Forwarding Examples</title>
2178 If you have links to multiple ISPs that provide various special content
2179 only to their subscribers, you can configure multiple <application>Privoxies</application>
2180 which have connections to the respective ISPs to act as forwarders to each other, so that
2181 <emphasis>your</emphasis> users can see the internal content of all ISPs.
2185 Assume that host-a has a PPP connection to isp-a.net. And host-b has a PPP connection to
2186 isp-b.net. Both run <application>Privoxy</application>. Their forwarding
2187 configuration can look like this:
2197 forward .isp-b.net host-b:8118
2208 forward .isp-a.net host-a:8118
2213 Now, your users can set their browser's proxy to use either
2214 host-a or host-b and be able to browse the internal content
2215 of both isp-a and isp-b.
2219 If you intend to chain <application>Privoxy</application> and
2220 <application>squid</application> locally, then chain as
2221 <literal>browser -> squid -> privoxy</literal> is the recommended way.
2225 Assuming that <application>Privoxy</application> and <application>squid</application>
2226 run on the same box, your squid configuration could then look like this:
2231 # Define Privoxy as parent proxy (without ICP)
2232 cache_peer 127.0.0.1 parent 8118 7 no-query
2234 # Define ACL for protocol FTP
2237 # Do not forward FTP requests to Privoxy
2238 always_direct allow ftp
2240 # Forward all the rest to Privoxy
2241 never_direct allow all</screen>
2245 You would then need to change your browser's proxy settings to <application>squid</application>'s address and port.
2246 Squid normally uses port 3128. If unsure consult <literal>http_port</literal> in <filename>squid.conf</filename>.
2253 <!-- ~ End section ~ -->
2256 <!-- ~~~~~ New section ~~~~~ -->
2258 <sect3 id="windows-gui">
2259 <title>Windows GUI Options</title>
2261 <application>Privoxy</application> has a number of options specific to the
2262 Windows GUI interface:
2265 <anchor id="activity-animation">
2267 If <quote>activity-animation</quote> is set to 1, the
2268 <application>Privoxy</application> icon will animate when
2269 <quote>Privoxy</quote> is active. To turn off, set to 0.
2276 <emphasis>activity-animation 1</emphasis>
2282 <anchor id="log-messages">
2284 If <quote>log-messages</quote> is set to 1,
2285 <application>Privoxy</application> will log messages to the console
2293 <emphasis>log-messages 1</emphasis>
2299 <anchor id="log-buffer-size">
2301 If <quote>log-buffer-size</quote> is set to 1, the size of the log buffer,
2302 i.e. the amount of memory used for the log messages displayed in the
2303 console window, will be limited to <quote>log-max-lines</quote> (see below).
2307 Warning: Setting this to 0 will result in the buffer to grow infinitely and
2308 eat up all your memory!
2315 <emphasis>log-buffer-size 1</emphasis>
2321 <anchor id="log-max-lines">
2323 <application>log-max-lines</application> is the maximum number of lines held
2324 in the log buffer. See above.
2331 <emphasis>log-max-lines 200</emphasis>
2337 <anchor id="log-highlight-messages">
2339 If <quote>log-highlight-messages</quote> is set to 1,
2340 <application>Privoxy</application> will highlight portions of the log
2341 messages with a bold-faced font:
2348 <emphasis>log-highlight-messages 1</emphasis>
2354 <anchor id="log-font-name">
2356 The font used in the console window:
2363 <emphasis>log-font-name Comic Sans MS</emphasis>
2369 <anchor id="log-font-size">
2371 Font size used in the console window:
2378 <emphasis>log-font-size 8</emphasis>
2384 <anchor id="show-on-task-bar">
2386 <quote>show-on-task-bar</quote> controls whether or not
2387 <application>Privoxy</application> will appear as a button on the Task bar
2395 <emphasis>show-on-task-bar 0</emphasis>
2401 <anchor id="close-button-minimizes">
2403 If <quote>close-button-minimizes</quote> is set to 1, the Windows close
2404 button will minimize <application>Privoxy</application> instead of closing
2405 the program (close with the exit option on the File menu).
2412 <emphasis>close-button-minimizes 1</emphasis>
2418 <anchor id="hide-console">
2420 The <quote>hide-console</quote> option is specific to the MS-Win console
2421 version of <application>Privoxy</application>. If this option is used,
2422 <application>Privoxy</application> will disconnect from and hide the
2439 <!-- ~ End section ~ -->
2442 <!-- ~~~~~ New section ~~~~~ -->
2443 <sect2 id="actions-file"><title>Actions Files</title>
2446 The actions files are used to define what actions
2447 <application>Privoxy</application> takes for which URLs, and thus determines
2448 how ad images, cookies and various other aspects of HTTP content and
2449 transactions are handled, and on which sites (or even parts thereof). There
2450 are three such files included with <application>Privoxy</application>,
2451 with slightly different purposes. <filename>default.action</filename> sets
2452 the default policies. <filename>standard.action</filename> is used by
2453 <application>Privoxy</application> and the web based editor to set
2454 pre-defined values (and normally should not be edited). Local exceptions
2455 are best done in <filename>user.action</filename>. The content of these
2456 can all be viewed and edited from <ulink
2457 url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>.
2461 Anything you want can blocked, including ads, banners, or just some obnoxious
2462 URL that you would rather not see is done here. Cookies can be accepted or rejected, or
2463 accepted only during the current browser session (i.e. not written to disk),
2464 content can be modified, JavaScripts tamed, user-tracking fooled, and much more.
2465 See below for a complete list of available actions.
2469 An actions file typically has sections. Near the top, <quote>aliases</quote> are
2470 optionally defined (discussed <ulink
2471 url="configuration.html#ALIASES">below</ulink>), then the default set of rules
2472 which will apply universally to all sites and pages. And then below that,
2473 exceptions to the defined universal policies.
2476 <!-- ~~~~~ New section ~~~~~ -->
2478 <title>Finding the Right Mix</title>
2480 Note that some <link linkend="actions">actions</link> like cookie suppression
2481 or script disabling may render some sites unusable, which rely on these
2482 techniques to work properly. Finding the right mix of actions is not easy and
2483 certainly a matter of personal taste. In general, it can be said that the more
2484 <quote>aggressive</quote> your default settings (in the top section of the
2485 actions file) are, the more exceptions for <quote>trusted</quote> sites you
2486 will have to make later. If, for example, you want to kill popup windows per
2487 default, you'll have to make exceptions from that rule for sites that you
2488 regularly use and that require popups for actually useful content, like maybe
2489 your bank, favorite shop, or newspaper.
2493 We have tried to provide you with reasonable rules to start from in the
2494 distribution actions files. But there is no general rule of thumb on these
2495 things. There just are too many variables, and sites are constantly changing.
2496 Sooner or later you will want to change the rules (and read this chapter again :).
2500 <!-- ~~~~~ New section ~~~~~ -->
2502 <title>How to Edit</title>
2504 The easiest way to edit the <quote>actions</quote> files is with a browser by
2505 using our browser-based editor, which can be reached from <ulink
2506 url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>.
2510 If you prefer plain text editing to GUIs, you can of course also directly edit the
2517 <title>How Actions are Applied to URLs</title>
2519 Actions files are divided into sections. There are special sections,
2520 like the <quote><link linkend="aliases">alias</link></quote> sections which will be discussed later. For now
2521 let's concentrate on regular sections: They have a heading line (often split
2522 up to multiple lines for readability) which consist of a list of actions,
2523 separated by whitespace and enclosed in curly braces. Below that, there
2524 is a list of URL patterns, each on a separate line.
2528 To determine which actions apply to a request, the URL of the request is
2529 compared to all patterns in this file. Every time it matches, the list of
2530 applicable actions for the URL is incrementally updated, using the heading
2531 of the section in which the pattern is located. If multiple matches for
2532 the same URL set the same action differently, the last match wins. If not,
2533 the effects are aggregated (e.g. a URL might match both the
2534 <ulink url="configuration.html#HANDLE-AS-IMAGE"><quote>+handle-as-image</quote></ulink>
2535 and <ulink url="configuration.html#BLOCK"><quote>+block</quote></ulink> actions).
2540 You can trace this process by visiting <ulink
2541 url="http://config.privoxy.org/show-url-info">http://config.privoxy.org/show-url-info</ulink>.
2545 More detail on this is provided in the Appendix, <link linkend="ACTIONSANAT">
2546 Anatomy of an Action</link>.
2550 <!-- ~~~~~ New section ~~~~~ -->
2552 <title>Patterns</title>
2554 Generally, a pattern has the form <literal><domain>/<path></literal>,
2555 where both the <literal><domain></literal> and <literal><path></literal>
2556 are optional. (This is why the pattern <literal>/</literal> matches all URLs).
2561 <term><literal>www.example.com/</literal></term>
2564 is a domain-only pattern and will match any request to <literal>www.example.com</literal>,
2565 regardless of which document on that server is requested.
2570 <term><literal>www.example.com</literal></term>
2573 means exactly the same. For domain-only patterns, the trailing <literal>/</literal> may
2579 <term><literal>www.example.com/index.html</literal></term>
2582 matches only the single document <literal>/index.html</literal>
2583 on <literal>www.example.com</literal>.
2588 <term><literal>/index.html</literal></term>
2591 matches the document <literal>/index.html</literal>, regardless of the domain,
2592 i.e. on <emphasis>any</emphasis> web server.
2597 <term><literal>index.html</literal></term>
2600 matches nothing, since it would be interpreted as a domain name and
2601 there is no top-level domain called <literal>.html</literal>.
2607 <sect4><title>The Domain Pattern</title>
2610 The matching of the domain part offers some flexible options: if the
2611 domain starts or ends with a dot, it becomes unanchored at that end.
2617 <term><literal>.example.com</literal></term>
2620 matches any domain that <emphasis>ENDS</emphasis> in
2621 <literal>.example.com</literal>
2626 <term><literal>www.</literal></term>
2629 matches any domain that <emphasis>STARTS</emphasis> with
2630 <literal>www.</literal>
2635 <term><literal>.example.</literal></term>
2638 matches any domain that <emphasis>CONTAINS</emphasis> <literal>.example.</literal>
2639 (Correctly speaking: It matches any FQDN that contains <literal>example</literal> as a domain.)
2646 Additionally, there are wild-cards that you can use in the domain names
2647 themselves. They work pretty similar to shell wild-cards: <quote>*</quote>
2648 stands for zero or more arbitrary characters, <quote>?</quote> stands for
2649 any single character, you can define character classes in square
2650 brackets and all of that can be freely mixed:
2655 <term><literal>ad*.example.com</literal></term>
2658 matches <quote>adserver.example.com</quote>,
2659 <quote>ads.example.com</quote>, etc but not <quote>sfads.example.com</quote>
2664 <term><literal>*ad*.example.com</literal></term>
2667 matches all of the above, and then some.
2672 <term><literal>.?pix.com</literal></term>
2675 matches <literal>www.ipix.com</literal>,
2676 <literal>pictures.epix.com</literal>, <literal>a.b.c.d.e.upix.com</literal> etc.
2681 <term><literal>www[1-9a-ez].example.c*</literal></term>
2684 matches <literal>www1.example.com</literal>,
2685 <literal>www4.example.cc</literal>, <literal>wwwd.example.cy</literal>,
2686 <literal>wwwz.example.com</literal> etc., but <emphasis>not</emphasis>
2687 <literal>wwww.example.com</literal>.
2695 <sect4><title>The Path Pattern</title>
2698 <application>Privoxy</application> uses Perl compatible regular expressions
2699 (through the <ulink url="http://www.pcre.org/">PCRE</ulink> library) for
2704 There is an <link linkend="regex">Appendix</link> with a brief quick-start into regular
2705 expressions, and full (very technical) documentation on PCRE regex syntax is available on-line
2706 at <ulink url="http://www.pcre.org/man.txt">http://www.pcre.org/man.txt</ulink>.
2707 You might also find the Perl man page on regular expressions (<literal>man perlre</literal>)
2708 useful, which is available on-line at <ulink
2709 url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>.
2713 Note that the path pattern is automatically left-anchored at the <quote>/</quote>,
2714 i.e. it matches as if it would start with a <quote>^</quote> (regular expression speak
2715 for the beginning of a line).
2719 Please also note that matching in the path is case
2720 <emphasis>INSENSITIVE</emphasis> by default, but you can switch to case
2721 sensitive at any point in the pattern by using the
2722 <quote>(?-i)</quote> switch:
2723 <literal>www.example.com/(?-i)PaTtErN.*</literal> will match only
2724 documents whose path starts with <literal>PaTtErN</literal> in
2725 <emphasis>exactly</emphasis> this capitalization.
2731 <!-- ~ End section ~ -->
2734 <!-- ~~~~~ New section ~~~~~ -->
2736 <sect3 id="actions">
2737 <title>Actions</title>
2739 All actions are disabled by default, until they are explicitly enabled
2740 somewhere in an actions file. Actions are turned on if preceded with a
2741 <quote>+</quote>, and turned off if preceded with a <quote>-</quote>. So a
2742 <quote>+action</quote> means <quote>do that action</quote>, e.g.
2743 <quote>+block</quote> means please <quote>block the following URL
2748 Actions are invoked by enclosing the action name in curly braces (e.g.
2749 {+some_action}), followed by a list of URLs (or patterns that match URLs) to
2750 which the action applies. There are three classes of actions:
2758 Boolean, i.e the action can only be <quote>on</quote> or
2759 <quote>off</quote>. Examples:
2765 <emphasis>{+name}</emphasis> # enable this action
2766 <emphasis>{-name}</emphasis> # disable this action
2776 Parameterized, e.g. <quote>+/-hide-user-agent{ Mozilla 1.0 }</quote>,
2777 where some value is required in order to enable this type of action.
2784 <emphasis>{+name{param}}</emphasis> # enable action and set parameter to <quote>param</quote>
2785 <emphasis>{-name}</emphasis> # disable action (<quote>parameter</quote>) can be omitted
2794 <!-- oes, or someone, check this. Re-worded 04/20/02 HB. -->
2795 Multi-value, e.g. <quote>{+/-add-header{Name: value}}</quote> or
2796 <quote>{+/-send-wafer{name=value}}</quote>), where some value needs to be defined
2797 in addition to simply enabling the action. Examples:
2803 <emphasis>{+name{param=value}}</emphasis> # enable action and set <quote>param</quote> to <quote>value</quote>
2804 <emphasis>{-name{param=value}}</emphasis> # remove the parameter <quote>param</quote> completely
2805 <emphasis>{-name}</emphasis> # disable this action totally and remove <application>param</application> too
2816 If nothing is specified in any actions file, no <quote>actions</quote> are
2817 taken. So in this case <application>Privoxy</application> would just be a
2818 normal, non-blocking, non-anonymizing proxy. You must specifically enable the
2819 privacy and blocking features you need (although the provided default actions
2820 files will give a good starting point).
2824 Later defined actions always over-ride earlier ones. So exceptions
2825 to any rules you make, should come in the latter part of the file. For
2826 multi-valued actions, the actions are applied in the order they are
2827 specified. Actions files are processed in the order they are defined
2828 in <filename>config</filename> (the default installation has three
2829 actions files). It also quite possible for any given URL pattern to
2830 match more than one action!
2833 <!-- start actions listing -->
2835 The list of valid <application>Privoxy</application> <quote>actions</quote> are:
2839 <!-- ********************************************************** -->
2840 <!-- Please note the below defined actions use id's that are -->
2841 <!-- probably linked from other places, so please don't change. -->
2843 <!-- ********************************************************** -->
2846 <!-- ~~~~~ New section ~~~~~ -->
2848 <sect4 id="add-header">
2849 <title><emphasis>+add-header{Name: value}</emphasis></title>
2854 <!-- boolean, parameterized, Multi-value -->
2856 <para>Multi-value.</para>
2861 <term>Typical uses:</term>
2864 Send a user defined HTTP header to the web server.
2870 <term>Possible values:</term>
2873 Any value is possible. Validity of the defined HTTP headers is not checked.
2879 <term>Example usage:</term>
2882 <emphasis>{+add-header{X-User-Tracking: sucks}}</emphasis>
2883 <emphasis>.example.com</emphasis>
2892 This action may be specified multiple times, in order to define multiple
2893 headers. This is rarely needed for the typical user. If you don't know what
2894 <quote>HTTP headers</quote> are, you definitely don't need to worry about this
2903 <!-- ~~~~~ New section ~~~~~ -->
2905 <title><emphasis>+block</emphasis></title>
2910 <!-- boolean, parameterized, Multi-value -->
2912 <para>Boolean.</para>
2917 <term>Typical uses:</term>
2920 Used to block a URL from reaching your browser. The URL may be
2921 anything, but is typically used to block ads or other obnoxious
2928 <term>Possible values:</term>
2935 <term>Example usage:</term>
2938 <emphasis>{+block}</emphasis>
2939 <emphasis>.banners.example.com</emphasis>
2940 <emphasis>.ads.r.us</emphasis>
2949 If a URL matches one of the blocked patterns, <application>Privoxy</application>
2950 will intercept the URL and display its special <quote>BLOCKED</quote> page
2951 instead. If there is sufficient space, a large red banner will appear with
2952 a friendly message about why the page was blocked, and a way to go there
2953 anyway. If there is insufficient space a smaller blocked page will appear
2954 without the red banner.
2955 <ulink url="http://ads.bannerserver.example.com/nasty-ads/sponsor.html">Click here</ulink>
2956 to view the default blocked HTML page (<application>Privoxy</application> must be running
2957 for this to work as intended!).
2961 A very important exception is if the URL <emphasis>matches both</emphasis>
2962 <quote>+block</quote> and <ulink
2963 url="configuration.html#HANDLE-AS-IMAGE"><quote>+handle-as-image</quote></ulink>,
2964 then it will be handled by
2965 <ulink url="configuration.html#SET-IMAGE-BLOCKER"><quote>+set-image-blocker</quote></ulink>
2966 (see below). It is important to understand this process, in order
2967 to understand how <application>Privoxy</application> is able to deal with
2968 ads and other objectionable content.
2971 The <ulink url="configuration.html#FILTER"><quote>+filter</quote></ulink>
2972 action can also perform some of the
2973 same functionality as <quote>+block</quote>, but by virtue of very
2974 different programming techniques, and is most often used for different
2984 <!-- ~~~~~ New section ~~~~~ -->
2985 <sect4 id="deanimate-gifs">
2986 <title><emphasis>+deanimate-gifs</emphasis></title>
2991 <!-- boolean, parameterized, Multi-value -->
2993 <para>Parameterized.</para>
2998 <term>Typical uses:</term>
3001 To stop those annoying, distracting animated GIF images.
3007 <term>Possible values:</term>
3010 <quote>last</quote> or <quote>first</quote>
3016 <term>Example usage:</term>
3019 <emphasis>{+deanimate-gifs{last}}</emphasis>
3020 <emphasis>.example.com</emphasis>
3029 De-animate all animated GIF images, i.e. reduce them to their last frame.
3030 This will also shrink the images considerably (in bytes, not pixels!). If
3031 the option <quote>first</quote> is given, the first frame of the animation
3032 is used as the replacement. If <quote>last</quote> is given, the last
3033 frame of the animation is used instead, which probably makes more sense for
3034 most banner animations, but also has the risk of not showing the entire
3035 last frame (if it is only a delta to an earlier frame).
3043 <!-- ~~~~~ New section ~~~~~ -->
3044 <sect4 id="downgrade-http-version">
3045 <title><emphasis>+downgrade-http-version</emphasis></title>
3050 <!-- boolean, parameterized, Multi-value -->
3052 <para>Boolean.</para>
3057 <term>Typical uses:</term>
3060 <quote>+downgrade-http-version</quote> will downgrade HTTP/1.1 client requests to
3061 HTTP/1.0 and downgrade the responses as well.
3067 <term>Possible values:</term>
3076 <term>Example usage:</term>
3079 <emphasis>{+downgrade-http-version}</emphasis>
3080 <emphasis>.example.com</emphasis>
3089 Use this action for servers that use HTTP/1.1 protocol features that
3090 <application>Privoxy</application> doesn't handle well yet. HTTP/1.1 is
3091 only partially implemented. Default is not to downgrade requests. This is
3092 an infrequently needed action, and is used to help with rare problem sites only.
3100 <!-- ~~~~~ New section ~~~~~ -->
3101 <sect4 id="fast-redirects">
3102 <title><emphasis>+fast-redirects</emphasis></title>
3107 <!-- boolean, parameterized, Multi-value -->
3109 <para>Boolean.</para>
3114 <term>Typical uses:</term>
3117 The <quote>+fast-redirects</quote> action enables interception of
3118 <quote>redirect</quote> requests from one server to another, which
3119 are used to track users.<application>Privoxy</application> can cut off
3120 all but the last valid URL in a redirect request and send a local redirect
3121 back to your browser without contacting the intermediate site(s).
3127 <term>Possible values:</term>
3136 <term>Example usage:</term>
3139 <emphasis>{+fast-redirects}</emphasis>
3140 <emphasis>.example.com</emphasis>
3149 Many sites, like yahoo.com, don't just link to other sites. Instead, they
3150 will link to some script on their own server, giving the destination as a
3151 parameter, which will then redirect you to the final target. URLs
3152 resulting from this scheme typically look like:
3153 <emphasis>http://some.place/some_script?http://some.where-else</emphasis>.
3156 Sometimes, there are even multiple consecutive redirects encoded in the
3157 URL. These redirections via scripts make your web browsing more traceable,
3158 since the server from which you follow such a link can see where you go
3159 to. Apart from that, valuable bandwidth and time is wasted, while your
3160 browser ask the server for one redirect after the other. Plus, it feeds
3164 This is a normally <quote>on</quote> feature, and often requires exceptions
3165 for sites that are sensitive to defeating this mechanism.
3174 <!-- ~~~~~ New section ~~~~~ -->
3176 <title><emphasis>+filter</emphasis></title>
3181 <!-- boolean, parameterized, Multi-value -->
3183 <para>Parameterized.</para>
3188 <term>Typical uses:</term>
3191 Apply page filtering as defined by named sections of the
3192 <filename>default.filter</filename> file to the specified site(s).
3193 <quote>Filtering</quote> can be any modification of the raw
3194 page content, including re-writing or deletion of content.
3200 <term>Possible values:</term>
3203 <quote>+filter</quote> must include the name of one of the section identifiers
3204 from <filename>default.filter</filename> (or whatever
3205 <emphasis>filterfile</emphasis> is specified in <filename>config</filename>).
3211 <term>Example usage (from the current <filename>default.filter</filename>):</term>
3215 <emphasis>+filter{html-annoyances}</emphasis>: Get rid of particularly annoying HTML abuse.
3220 <emphasis>+filter{js-annoyances}</emphasis>: Get rid of particularly annoying JavaScript abuse
3225 <emphasis>+filter{content-cookies}</emphasis>: Kill cookies that come in the HTML or JS content
3230 <emphasis>+filter{popups}</emphasis>: Kill all popups in JS and HTML
3235 <emphasis>+filter{frameset-borders}</emphasis>: Give frames a border and make them resizable
3240 <emphasis>+filter{webbugs}</emphasis>: Squish WebBugs (1x1 invisible GIFs used for user tracking)
3245 <emphasis>+filter{refresh-tags}</emphasis>: Kill automatic refresh tags (for dial-on-demand setups)
3250 <emphasis>+filter{fun}</emphasis>: Text replacements for subversive browsing fun!
3255 <emphasis>+filter{nimda}</emphasis>: Remove Nimda (virus) code.
3260 <emphasis>+filter{banners-by-size}</emphasis>: Kill banners by size (<emphasis>very</emphasis> efficient!)
3265 <emphasis>+filter{shockwave-flash}</emphasis>: Kill embedded Shockwave Flash objects
3270 <emphasis>+filter{crude-parental}</emphasis>: Kill all web pages that contain the words "sex" or "warez"
3280 This is potentially a very powerful feature! And requires a knowledge
3281 of regular expressions if you want to <quote>roll your own</quote>.
3282 Filtering operates on a line by line basis throughout the entire page.
3285 Filtering requires buffering the page content, which may appear to
3286 slow down page rendering since nothing is displayed until all content has
3287 passed the filters. (It does not really take longer, but seems that way
3288 since the page is not incrementally displayed.) This effect will be more
3289 noticeable on slower connections.
3292 Filtering can achieve some of the effects as the
3293 <ulink url="configuration.html#BLOCK"><quote>+block</quote></ulink>
3294 action, i.e. it can be used to block ads and banners. In the overall
3295 scheme of things, filtering is one of the first things <quote>Privoxy</quote>
3296 does with a web page. So other most other actions are applied to the
3297 already <quote>filtered</quote> page.
3306 <!-- ~~~~~ New section ~~~~~ -->
3307 <sect4 id="hide-forwarded-for-headers">
3308 <title><emphasis>+hide-forwarded-for-headers</emphasis></title>
3313 <!-- Boolean, Parameterized, Multi-value -->
3315 <para>Boolean.</para>
3320 <term>Typical uses:</term>
3323 Block any existing X-Forwarded-for HTTP header, and do not add a new one.
3329 <term>Possible values:</term>
3338 <term>Example usage:</term>
3341 <emphasis>{+hide-forwarded-for-headers}</emphasis>
3342 <emphasis>.example.com</emphasis>
3351 It is fairly safe to leave this on. It does not seem to break many sites.
3360 <!-- ~~~~~ New section ~~~~~ -->
3361 <sect4 id="hide-from-header">
3362 <title><emphasis>+hide-from-header</emphasis></title>
3367 <!-- Boolean, Parameterized, Multi-value -->
3369 <para>Parameterized.</para>
3374 <term>Typical uses:</term>
3377 To block the browser from sending your email address in a <quote>From:</quote>
3384 <term>Possible values:</term>
3387 Keyword: <quote>block</quote>, or any user defined value.
3393 <term>Example usage:</term>
3396 <emphasis>{+hide-from-header{block}}</emphasis>
3397 <emphasis>.example.com</emphasis>
3406 The keyword <quote>block</quote> will completely remove the header
3407 (not to be confused with the <ulink
3408 url="configuration.html#BLOCK"><quote>+block</quote></ulink> action).
3409 Alternately, you can specify any value you prefer to send to the web
3419 <!-- ~~~~~ New section ~~~~~ -->
3420 <sect4 id="hide-referer">
3421 <title><emphasis><anchor id="hide-referrer">+hide-referer</emphasis></title>
3427 <!-- Boolean, Parameterized, Multi-value -->
3429 <para>Parameterized.</para>
3434 <term>Typical uses:</term>
3437 Don't send the <quote>Referer:</quote> (sic) HTTP header to the web site.
3438 Or, alternately send a forged header instead.
3444 <term>Possible values:</term>
3447 Prevent the header from being sent with the keyword, <quote>block</quote>.
3448 Or, <quote>forge</quote> a URL to one from the same server as the request.
3449 Or, set to user defined value of your choice.
3455 <term>Example usage:</term>
3458 <emphasis>{+hide-referer{forge}}</emphasis>
3459 <emphasis>.example.com</emphasis>
3468 <quote>forge</quote> is the preferred option here, since some servers will
3469 not send images back otherwise.
3472 <quote>+hide-referrer</quote> is an alternate spelling of
3473 <quote>+hide-referer</quote>. It has the exact same parameters, and can be freely
3474 mixed with, <quote>+hide-referer</quote>. (<quote>referrer</quote> is the
3475 correct English spelling, however the HTTP specification has a bug - it
3476 requires it to be spelled as <quote>referer</quote>.)
3485 <!-- ~~~~~ New section ~~~~~ -->
3486 <sect4 id="hide-user-agent">
3487 <title><emphasis>+hide-user-agent</emphasis></title>
3492 <!-- Boolean, Parameterized, Multi-value -->
3494 <para>Parameterized.</para>
3499 <term>Typical uses:</term>
3502 To change the <quote>User-Agent:</quote> header so web servers can't tell
3503 your browser type. Who's business is it anyway?
3509 <term>Possible values:</term>
3512 Any user defined string.
3518 <term>Example usage:</term>
3521 <emphasis>{+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}}</emphasis>
3522 <emphasis>.msn.com</emphasis>
3531 Warning! This breaks many web sites that depend on this in order
3532 to determine how the target browser will respond to various
3533 requests. Use with caution.
3541 <!-- ~~~~~ New section ~~~~~ -->
3542 <sect4 id="handle-as-image">
3543 <title><emphasis>+handle-as-image</emphasis></title>
3548 <!-- Boolean, Parameterized, Multi-value -->
3550 <para>Boolean.</para>
3555 <term>Typical uses:</term>
3558 To define what <application>Privoxy</application> should treat
3559 automatically as an image, and is an important ingredient of how
3566 <term>Possible values:</term>
3575 <term>Example usage:</term>
3578 <emphasis>{+handle-as-image}</emphasis>
3579 <emphasis>/.*\.(gif|jpg|jpeg|png|bmp|ico)</emphasis>
3588 This only has meaning if the URL (or pattern) also is
3589 <quote>+block</quote>ed, in which case a user definable image can
3590 be sent rather than a HTML page. This is integral to the whole concept of
3591 ad blocking: the URL must match <emphasis>both</emphasis> a <ulink
3592 url="configuration.html#BLOCK"><quote>+block</quote></ulink> rule,
3593 <emphasis>and</emphasis> <quote>+handle-as-image</quote>.
3595 url="configuration.html#SET-IMAGE-BLOCKER"><quote>+set-image-blocker</quote></ulink>
3596 below for control over what will actually be displayed by the browser.)
3599 There is little reason to change the default definition for this action.
3608 <!-- ~~~~~ New section ~~~~~ -->
3609 <sect4 id="set-image-blocker">
3610 <title><emphasis>+set-image-blocker</emphasis></title>
3615 <!-- Boolean, Parameterized, Multi-value -->
3617 <para>Parameterized.</para>
3622 <term>Typical uses:</term>
3625 Decide what to do with URLs that end up tagged with <emphasis>both</emphasis>
3626 <ulink url="configuration.html#BLOCK"><quote>+block</quote></ulink>
3628 url="configuration.html#HANDLE-AS-IMAGE"><quote>+handle-as-image</quote></ulink>,
3629 e.g an advertisement.
3635 <term>Possible values:</term>
3638 There are four available options: <quote>-set-image-blocker</quote> will send a HTML
3639 <quote>blocked</quote> page, usually resulting in a <quote>broken
3641 <quote>+set-image-blocker{<emphasis>blank</emphasis>}</quote> will send a
3642 1x1 transparent GIF image.
3643 <quote>+set-image-blocker{<emphasis>pattern</emphasis>}</quote> will send a
3644 checkerboard type pattern (the default). And finally,
3645 <quote>+set-image-blocker{<emphasis>http://xyz.com</emphasis>}</quote> will
3646 send a HTTP temporary redirect to the specified image. This has the
3647 advantage of the icon being being cached by the browser, which will speed
3654 <term>Example usage:</term>
3657 <emphasis>{+set-image-blocker{blank}}</emphasis>
3658 <emphasis>.example.com</emphasis>
3667 If you want <emphasis>invisible</emphasis> ads, they need to meet
3668 criteria as matching both <emphasis>images</emphasis> and <emphasis>blocked</emphasis>
3669 actions. And then, <quote>image-blocker</quote> should be set to
3670 <quote>blank</quote> for invisibility. Note you cannot treat HTML pages as
3671 images in most cases. For instance, frames require an HTML page to
3672 display. So a frame that is an ad, typically cannot be treated as an image.
3673 Forcing an <quote>image</quote> in this situation just will not work
3682 <!-- ~~~~~ New section ~~~~~ -->
3683 <sect4 id="limit-connect">
3684 <title><emphasis>+limit-connect</emphasis></title>
3689 <!-- Boolean, Parameterized, Multi-value -->
3691 <para>Parameterized.</para>
3696 <term>Typical uses:</term>
3699 By default, <application>Privoxy</application> only allows HTTP CONNECT
3700 requests to port 443 (the standard, secure HTTPS port). Use
3701 <quote>+limit-connect</quote> to disable this altogether, or to allow
3708 <term>Possible values:</term>
3711 Any valid port number, or port number range.
3717 <term>Example usages:</term>
3719 <!-- I had trouble getting the spacing to look right in my browser -->
3720 <!-- I probably have the wrong font setup, bollocks. -->
3721 <!-- Apparently the emphasis tag uses a proportional font no matter what -->
3723 <emphasis>+limit-connect{443}</emphasis> # This is the default and need not be specified.
3724 <emphasis>+limit-connect{80,443}</emphasis> # Ports 80 and 443 are OK.
3725 <emphasis>+limit-connect{-3, 7, 20-100, 500-}</emphasis> # Port less than 3, 7, 20 to 100 and above 500 are OK.
3734 The CONNECT methods exists in HTTP to allow access to secure websites
3735 (https:// URLs) through proxies. It works very simply: the proxy connects
3736 to the server on the specified port, and then short-circuits its
3737 connections to the client <emphasis>and</emphasis> to the remote proxy.
3738 This can be a big security hole, since CONNECT-enabled proxies can be
3739 abused as TCP relays very easily.
3742 If you want to allow CONNECT for more ports than this, or want to forbid
3743 CONNECT altogether, you can specify a comma separated list of ports and
3744 port ranges (the latter using dashes, with the minimum defaulting to 0 and
3748 If you don't know what any of this means, there probably is no reason to
3757 <!-- ~~~~~ New section ~~~~~ -->
3758 <sect4 id="prevent-compression">
3759 <title><emphasis>+prevent-compression</emphasis></title>
3764 <!-- Boolean, Parameterized, Multi-value -->
3766 <para>Boolean.</para>
3771 <term>Typical uses:</term>
3774 Prevent the specified websites from compressing HTTP data.
3780 <term>Possible values:</term>
3789 <term>Example usage:</term>
3792 <emphasis>{+prevent-compression}</emphasis>
3793 <emphasis>.example.com</emphasis>
3802 Some websites do this, which can be a problem for
3803 <application>Privoxy</application>, since
3804 <ulink url="configuration.html#FILTER"><quote>+filter</quote></ulink>,
3805 <ulink url="configuration.html#KILL-POPUPS"><quote>+kill-popups</quote></ulink>
3807 url="configuration.html#GIF-DEANIMATE"><quote>+gif-deanimate</quote></ulink>
3808 will not work on compressed data. This will slow down connections to those
3809 websites, though. Default typically is to turn
3810 <quote>prevent-compression</quote> on.
3818 <!-- ~~~~~ New section ~~~~~ -->
3819 <sect4 id="session-cookies-only">
3820 <title><emphasis>+session-cookies-only</emphasis></title>
3825 <!-- Boolean, Parameterized, Multi-value -->
3827 <para>Boolean.</para>
3832 <term>Typical uses:</term>
3835 Allow cookies for the current browser session <emphasis>only</emphasis>.
3841 <term>Possible values:</term>
3850 <term>Example usage (disabling):</term>
3853 <emphasis>{-session-cookies-only}</emphasis>
3854 <emphasis>.example.com</emphasis>
3863 If websites set cookies, <quote>+session-cookies-only</quote> will make sure
3864 they are erased when you exit and restart your web browser. This makes
3865 profiling cookies useless, but won't break sites which require cookies so
3866 that you can log in for transactions. This is generally turned on for all
3867 sites, and is the recommended setting.
3870 <quote>+prevent-*-cookies</quote> actions should be turned off as well (see
3871 below), for <quote>+session-cookies-only</quote> to work. Or, else no cookies
3872 will get through at all. For, <quote>persistent</quote> cookies that survive
3873 across browser sessions, see below as well.
3882 <!-- ~~~~~ New section ~~~~~ -->
3883 <sect4 id="prevent-reading-cookies">
3884 <title><emphasis>+prevent-reading-cookies</emphasis></title>
3889 <!-- Boolean, Parameterized, Multi-value -->
3891 <para>Boolean.</para>
3896 <term>Typical uses:</term>
3899 Explicitly prevent the web server from reading any cookies on your
3906 <term>Possible values:</term>
3915 <term>Example usage:</term>
3918 <emphasis>{+prevent-reading-cookies}</emphasis>
3919 <emphasis>.example.com</emphasis>
3928 Often used in conjunction with <quote>+prevent-setting-cookies</quote> to
3929 disable cookies completely. Note that
3930 <ulink url="configuration.html#SESSION-COOKIES-ONLY"><quote>+session-cookies-only</quote></ulink>
3931 requires these to both be disabled (or else it never gets any cookies to cache).
3934 For <quote>persistent</quote> cookies to work (i.e. they survive across browser
3935 sessions and reboots), all three cookie settings should be <quote>off</quote>
3936 for the specified sites.
3945 <!-- ~~~~~ New section ~~~~~ -->
3946 <sect4 id="prevent-setting-cookies">
3947 <title><emphasis>+prevent-setting-cookies</emphasis></title>
3952 <!-- Boolean, Parameterized, Multi-value -->
3954 <para>Boolean.</para>
3959 <term>Typical uses:</term>
3962 Explicitly block the web server from storing cookies on your
3969 <term>Possible values:</term>
3978 <term>Example usage:</term>
3981 <emphasis>{+prevent-setting-cookies}</emphasis>
3982 <emphasis>.example.com</emphasis>
3991 Often used in conjunction with <quote>+prevent-reading-cookies</quote> to
3992 disable cookies completely (see above).
4001 <!-- ~~~~~ Nvarlistentryew section ~~~~~ -->
4002 <sect4 id="kill-popup">
4003 <title><emphasis>+kill-popups<anchor id="kill-popups"></emphasis></title>
4007 <!-- Boolean, Parameterized, Multi-value -->
4009 <para>Boolean.</para>
4014 <term>Typical uses:</term>
4017 Stop those annoying JavaScript pop-up windows!
4023 <term>Possible values:</term>
4032 <term>Example usage:</term>
4035 <emphasis>{+kill-popups}</emphasis>
4036 <emphasis>.example.com</emphasis>
4045 <quote>+kill-popups</quote> uses a built in filter to disable pop-ups
4046 that use the <literal>window.open()</literal> function, etc. This is
4047 one of the first actions processed by <application>Privoxy</application>
4048 as it contacts the remote web server. This action is not always 100% reliable,
4049 and is supplemented by <quote>+filter{<emphasis>popups</emphasis>}</quote>.
4053 An alternate spelling is <quote>+kill-popup</quote>, which is
4064 <!-- ~~~~~ New section ~~~~~ -->
4065 <sect4 id="send-vanilla-wafer">
4066 <title><emphasis>+send-vanilla-wafer</emphasis></title>
4071 <!-- Boolean, Parameterized, Multi-value -->
4073 <para>Boolean.</para>
4078 <term>Typical uses:</term>
4081 Sends a cookie for every site stating that you do not accept any copyright
4082 on cookies sent to you, and asking them not to track you.
4088 <term>Possible values:</term>
4097 <term>Example usage:</term>
4100 <emphasis>{+send-vanilla-wafer}</emphasis>
4101 <emphasis>.example.com</emphasis>
4110 This action only applies if you are using a <filename>jarfile</filename>
4111 for saving cookies. Of course, this is a (relatively) unique header and
4112 could conceivably be used to track you.
4121 <!-- ~~~~~ New section ~~~~~ -->
4122 <sect4 id="send-wafer">
4123 <title><emphasis>+send-wafer</emphasis></title>
4128 <!-- Boolean, Parameterized, Multi-value -->
4130 <para>Multi-value.</para>
4135 <term>Typical uses:</term>
4138 This allows you to send an arbitrary, user definable cookie.
4144 <term>Possible values:</term>
4147 User specified cookie name and corresponding value.
4153 <term>Example usage:</term>
4156 <emphasis>{+send-wafer{name=value}}</emphasis>
4157 <emphasis>.example.com</emphasis>
4166 This can be specified multiple times in order to add as many cookies as you
4176 <!-- ~~~~~ New section ~~~~~ -->
4177 <sect4 id="act-examples" renderas="sect3">
4178 <title>Actions Examples</title>
4180 Note that the meaning of any of the above examples is reversed by preceding
4181 the action with a <quote>-</quote>, in place of the <quote>+</quote>. Also,
4182 that some actions are turned on in the default section of the actions file,
4183 and require little to no additional configuration. These are just <quote>on</quote>.
4184 But, other actions that are turned on the default section <emphasis>do
4185 typically require</emphasis> exceptions to be listed in the lower sections of
4186 actions file. E.g. by default no URLs are <quote>blocked</quote> (i.e. in
4187 the default definitions of <filename>default.action</filename>). We need
4188 exceptions to this in order to enable ad blocking.
4196 Turn off cookies by default, then allow a few through for specified sites
4197 (showing an excerpt from the <quote>default</quote> section of an actions
4206 # Allow cookies to and from the server, but
4207 # for this browser session ONLY
4209 # other actions normally listed here...
4210 -prevent-setting-cookies \
4211 -prevent-reading-cookies \
4212 +session-cookies-only \
4216 # Exceptions to the above, sites that benefit from persistent cookies
4217 # that are saved from one browser session to the next.
4218 { -session-cookies-only }
4231 Now turn off <quote>fast redirects</quote>, and then we allow two exceptions:
4238 # Turn them off (excerpt only)!
4240 # other actions normally listed here...
4245 # Reverse it for these two sites, which don't work right without it.
4247 www.ukc.ac.uk/cgi-bin/wac\.cgi\?
4255 Turn on page filtering according to rules in the defined sections
4256 of <filename>default.filter</filename>, and make one exception for
4264 # Run everything through the filter file, using only certain
4265 # specified sections:
4267 # other actions normally listed here...
4268 +filter{html-annoyances} +filter{js-annoyances} +filter{kill-popups}\
4269 +filter{webbugs} +filter{nimda} +filter{banners-by-size}
4273 # Then disable filtering of code from all sourceforge domains!
4282 Now some URLs that we want <quote>blocked</quote> (normally generates
4283 the <quote>blocked</quote> banner). Typically, the <quote>block</quote>
4284 action is off by default in the upper section of an actions file, then enabled
4285 against certain URLs and patterns in the lower part of the file. Many of these use <link
4286 linkend="regex">regular expressions</link> that will expand to match multiple
4299 /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
4300 /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
4302 /.*/(ng)?adclient\.cgi
4303 /.*/(plain|live|rotate)[-_.]?ads?/
4312 Note that many of these actions have the potential to cause a page to
4313 misbehave, possibly even not to display at all. There are many ways
4314 a site designer may choose to design his site, and what HTTP header
4315 content, and other criteria, he may depend on. There is no way to have hard
4316 and fast rules for all sites. See the <link
4317 linkend="ACTIONSANAT">Appendix</link> for a brief example on troubleshooting
4324 <!-- ~ End section ~ -->
4327 <!-- ~~~~~ New section ~~~~~ -->
4328 <sect3 id="aliases">
4329 <title>Aliases</title>
4331 Custom <quote>actions</quote>, known to <application>Privoxy</application>
4332 as <quote>aliases</quote>, can be defined by combining other <quote>actions</quote>.
4333 These can in turn be invoked just like the built-in <quote>actions</quote>.
4334 Currently, an alias can contain any character except space, tab, <quote>=</quote>,
4335 <quote>{</quote> or <quote>}</quote>. But please use only <quote>a</quote>-
4336 <quote>z</quote>, <quote>0</quote>-<quote>9</quote>, <quote>+</quote>, and
4337 <quote>-</quote>. Alias names are not case sensitive, and
4338 <emphasis>must be defined before other actions</emphasis> in the
4339 actions file! And there can only be one set of <quote>aliases</quote>
4340 defined per file. Each actions file may have its own aliases, but they are
4341 only visible within that file.
4345 Now let's define a few aliases:
4352 # Useful custom aliases we can use later. These must come first!
4354 +prevent-cookies = +prevent-setting-cookies +prevent-reading-cookies
4355 -prevent-cookies = -prevent-setting-cookies -prevent-reading-cookies
4356 fragile = -block -prevent-cookies -filter -fast-redirects -hide-referer -kill-popups
4357 shop = -prevent-cookies -filter -fast-redirects
4358 +imageblock = +block +handle-as-image
4360 # Aliases defined from other aliases, for people who don't like to type
4362 c0 = +prevent-cookies
4363 c1 = -prevent-cookies
4364 #... etc. Customize to your heart's content.
4371 Some examples using our <quote>shop</quote> and <quote>fragile</quote>
4372 aliases from above. These would appear in the lower sections of an
4373 actions file as exceptions to the default actions (as defined in the
4381 # These sites are very complex and require
4382 # minimal interference.
4384 .office.microsoft.com
4385 .windowsupdate.microsoft.com
4388 # Shopping sites - but we still want to block ads.
4391 .worldpay.com # for quietpc.com
4394 # These shops require pop-ups also
4404 The <quote>shop</quote> and <quote>fragile</quote> aliases are often used for
4405 <quote>problem</quote> sites that require most actions to be disabled
4406 in order to function properly.
4413 <!-- ~ End section ~ -->
4416 <!-- ~~~~~ New section ~~~~~ -->
4417 <sect2 id="filter-file">
4418 <title>The Filter File</title>
4420 Any web page can be dynamically modified with the filter file. This
4421 modification can be removal, or re-writing, of any web page content,
4422 including tags and non-visible content. The default filter file is
4423 <filename>default.filter</filename>, located in the config directory.
4427 This is potentially a very powerful feature, and requires knowledge of both
4428 <quote>regular expression</quote> and HTML in order create custom
4429 filters. But, there are a number of useful filters included with
4430 <application>Privoxy</application> for many common situations.
4434 The included example file is divided into sections. Each section begins
4435 with the <literal>FILTER</literal> keyword, followed by the identifier
4436 for that section, e.g. <quote>FILTER: webbugs</quote>. Each section performs
4437 a similar type of filtering, such as <quote>html-annoyances</quote>.
4441 This file uses regular expressions to alter or remove any string in the
4442 target page. The expressions can only operate on one line at a time. Some
4443 examples from the included default <filename>default.filter</filename>:
4447 Stop web pages from displaying annoying messages in the status bar by
4448 deleting such references:
4455 FILTER: html-annoyances
4457 # New browser windows should be resizeable and have a location and status
4460 s/resizable="?(no|0)"?/resizable=1/ig s/noresize/yesresize/ig
4461 s/location="?(no|0)"?/location=1/ig s/status="?(no|0)"?/status=1/ig
4462 s/scrolling="?(no|0|Auto)"?/scrolling=1/ig
4463 s/menubar="?(no|0)"?/menubar=1/ig
4465 # The <BLINK> tag was a crime!