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 license SYSTEM "license.sgml">
12 <!entity p-authors SYSTEM "p-authors.sgml">
13 <!entity config SYSTEM "p-config.sgml">
14 <!entity p-version "3.0.20">
15 <!entity p-status "UNRELEASED">
16 <!entity % p-authors-formal "INCLUDE"> <!-- include additional text, etc -->
17 <!entity % p-not-stable "INCLUDE">
18 <!entity % p-stable "IGNORE">
19 <!entity % p-text "IGNORE"> <!-- define we are not a text only doc -->
20 <!entity % p-doc "INCLUDE"> <!-- and we are a formal doc -->
21 <!entity % p-readme "IGNORE">
22 <!entity % user-man "IGNORE">
23 <!entity % config-file "IGNORE">
24 <!entity % p-supp-userman "IGNORE"> <!-- Omit some from supported.sgml -->
25 <!entity my-copy "©"> <!-- kludge for docbook2man -->
26 <!entity % draft "IGNORE"> <!-- WIP stuff -->
27 <!entity % seealso-extra "INCLUDE"> <!-- extra stuff from seealso.sgml -->
28 <!entity my-app "<application>Privoxy</application>">
31 File : $Source: /cvsroot/ijbswa/current/doc/source/user-manual.sgml,v $
34 This file belongs into
35 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
37 $Id: user-manual.sgml,v 2.153 2012/11/09 10:49:59 fabiankeil Exp $
39 Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/
42 ========================================================================
43 NOTE: Please read developer-manual/documentation.html before touching
44 anything in this, or other Privoxy documentation.
45 ========================================================================
52 <title>Privoxy &p-version; User Manual</title>
56 <!-- Completely the wrong markup, but very little is allowed -->
57 <!-- in this part of an article. FIXME -->
58 <link linkend="copyright">Copyright</link> &my-copy; 2001-2011 by
59 <ulink url="http://www.privoxy.org/">Privoxy Developers</ulink>
63 <pubdate>$Id: user-manual.sgml,v 2.153 2012/11/09 10:49:59 fabiankeil Exp $</pubdate>
67 Note: the following should generate a separate page, and a live link to it,
68 all nicely done. But it doesn't for some mysterious reason. Please leave
69 commented unless it can be fixed proper. For the time being, the
70 copyright/license declarations will be in their own sgml.
83 This is here to keep vim syntax file from breaking :/
84 If I knew enough to fix it, I would.
85 PLEASE DO NOT REMOVE! HB: hal@foobox.net
91 The <citetitle>Privoxy User Manual</citetitle> gives users information on how to
92 install, configure and use <ulink
93 url="http://www.privoxy.org/">Privoxy</ulink>.
96 <!-- Include privoxy.sgml boilerplate: -->
98 <!-- end privoxy.sgml -->
101 You can find the latest version of the <citetitle>Privoxy User Manual</citetitle> at <ulink
102 url="http://www.privoxy.org/user-manual/">http://www.privoxy.org/user-manual/</ulink>.
103 Please see the <link linkend="contact">Contact section</link> on how to
104 contact the developers.
108 <!-- Feel free to send a note to the developers at <email>ijbswa-developers@lists.sourceforge.net</email>. -->
114 <!-- ~~~~~ New section ~~~~~ -->
115 <sect1 label="1" id="introduction"><title>Introduction</title>
117 This documentation is included with the current &p-status; version of
118 <application>Privoxy</application>, v.&p-version;<![%p-not-stable;[,
119 and is mostly complete at this point. The most up to date reference for the
120 time being is still the comments in the source files and in the individual
121 configuration files. Development of a new version is currently nearing
122 completion, and includes significant changes and enhancements over
126 <!-- include only in non-stable versions -->
129 Since this is a &p-status; version, not all new features are well tested. This
130 documentation may be slightly out of sync as a result (especially with
131 CVS sources). And there <emphasis>may be</emphasis> bugs, though hopefully
136 <!-- ~~~~~ New section ~~~~~ -->
137 <sect2 id="features"><title>Features</title>
139 In addition to the core
140 features of ad blocking and
141 <ulink url="http://en.wikipedia.org/wiki/Browser_cookie">cookie</ulink> management,
142 <application>Privoxy</application> provides many supplemental
143 features<![%p-not-stable;[, some of them currently under development]]>,
144 that give the end-user more control, more privacy and more freedom:
146 <!-- Include newfeatures.sgml boilerplate here: -->
148 <!-- end boilerplate -->
153 <!-- ~ End section ~ -->
156 <!-- ~~~~~ New section ~~~~~ -->
157 <sect1 id="installation"><title>Installation</title>
160 <application>Privoxy</application> is available both in convenient pre-compiled
161 packages for a wide range of operating systems, and as raw source code.
162 For most users, we recommend using the packages, which can be downloaded from our
163 <ulink url="http://sourceforge.net/projects/ijbswa/">Privoxy Project
169 On some platforms, the installer may remove previously installed versions, if
170 found. (See below for your platform). In any case <emphasis>be sure to backup
171 your old configuration if it is valuable to you.</emphasis> See the <link
172 linkend="upgradersnote">note to upgraders</link> section below.
175 <!-- ~~~~~ New section ~~~~~ -->
176 <sect2 id="installation-packages"><title>Binary Packages</title>
178 How to install the binary packages depends on your operating system:
181 <!-- XXX: The installation sections should be sorted -->
183 <!-- ~~~~~ New section ~~~~~ -->
184 <sect3 id="installation-pack-rpm"><title>Red Hat and Fedora RPMs</title>
187 RPMs can be installed with <literal>rpm -Uvh privoxy-&p-version;-1.rpm</literal>,
188 and will use <filename>/etc/privoxy</filename> for the location
189 of configuration files.
193 Note that on Red Hat, <application>Privoxy</application> will
194 <emphasis>not</emphasis> be automatically started on system boot. You will
195 need to enable that using <command>chkconfig</command>,
196 <command>ntsysv</command>, or similar methods.
200 If you have problems with failed dependencies, try rebuilding the SRC RPM:
201 <literal>rpm --rebuild privoxy-&p-version;-1.src.rpm</literal>. This
202 will use your locally installed libraries and RPM version.
206 Also note that if you have a <application>Junkbuster</application> RPM installed
207 on your system, you need to remove it first, because the packages conflict.
208 Otherwise, RPM will try to remove <application>Junkbuster</application>
209 automatically if found, before installing <application>Privoxy</application>.
213 <!-- ~~~~~ New section ~~~~~ -->
214 <sect3 id="installation-deb"><title>Debian and Ubuntu</title>
216 DEBs can be installed with <literal>apt-get install privoxy</literal>,
217 and will use <filename>/etc/privoxy</filename> for the location of
222 <!-- ~~~~~ New section ~~~~~ -->
223 <sect3 id="installation-pack-win"><title>Windows</title>
226 Just double-click the installer, which will guide you through
227 the installation process. You will find the configuration files
228 in the same directory as you installed <application>Privoxy</application> in.
231 Version 3.0.5 beta introduced full <application>Windows</application> service
232 functionality. On Windows only, the <application>Privoxy</application>
233 program has two new command line arguments to install and uninstall
234 <application>Privoxy</application> as a <emphasis>service</emphasis>.
238 <term>Arguments:</term>
241 <replaceable class="parameter">--install</replaceable>[:<replaceable class="parameter">service_name</replaceable>]
244 <replaceable class="parameter">--uninstall</replaceable>[:<replaceable class="parameter">service_name</replaceable>]
250 After invoking <application>Privoxy</application> with
251 <command>--install</command>, you will need to bring up the
252 <application>Windows</application> service console to assign the user you
253 want <application>Privoxy</application> to run under, and whether or not you
254 want it to run whenever the system starts. You can start the
255 <application>Windows</application> services console with the following
256 command: <command>services.msc</command>. If you do not take the manual step
257 of modifying <application>Privoxy's</application> service settings, it will
258 not start. Note too that you will need to give Privoxy a user account that
259 actually exists, or it will not be permitted to
260 write to its log and configuration files.
265 <!-- ~~~~~ New section ~~~~~ -->
266 <sect3 id="installation-pack-bintgz"><title>Solaris <!--, NetBSD, HP-UX--></title>
269 Create a new directory, <literal>cd</literal> to it, then unzip and
270 untar the archive. For the most part, you'll have to figure out where
271 things go. <!-- FIXME, more info needed? -->
275 <!-- ~~~~~ New section ~~~~~ -->
276 <sect3 id="installation-os2"><title>OS/2</title>
279 First, make sure that no previous installations of
280 <application>Junkbuster</application> and / or
281 <application>Privoxy</application> are left on your
282 system. Check that no <application>Junkbuster</application>
283 or <application>Privoxy</application> objects are in
289 Then, just double-click the WarpIN self-installing archive, which will
290 guide you through the installation process. A shadow of the
291 <application>Privoxy</application> executable will be placed in your
292 startup folder so it will start automatically whenever OS/2 starts.
296 The directory you choose to install <application>Privoxy</application>
297 into will contain all of the configuration files.
301 <!-- ~~~~~ New section ~~~~~ -->
302 <sect3 id="installation-mac"><title>Mac OS X</title>
304 Installation instructions for the OS X platform depend upon whether
305 you downloaded a ready-built installation package (.pkg or .mpkg) or have
306 downloaded the source code.
308 <sect3 renderas="sect4" id="OS-X-install-from-package">
309 <title>Installation from ready-built package</title>
311 The downloaded file will either be a .pkg (for OS X 10.5 upwards) or a bzipped
312 .mpkg file (for OS X 10.4). The former can be double-clicked as is and the
313 installation will start; double-clicking the latter will unzip the .mpkg file
314 which can then be double-clicked to commence the installation.
317 The privoxy service will automatically start after a successful installation
318 (and thereafter every time your computer starts up) however you will need to
319 configure your web browser(s) to use it. To do so, configure them to use a
320 proxy for HTTP and HTTPS at the address 127.0.0.1:8118.
323 To prevent the privoxy service from automatically starting when your computer
324 starts up, remove or rename the file <literal>/Library/LaunchDaemons/org.ijbswa.privoxy.plist</literal>
325 (on OS X 10.5 and higher) or the folder named
326 <literal>/Library/StartupItems/Privoxy</literal> (on OS X 10.4 'Tiger').
329 To manually start or stop the privoxy service, use the scripts startPrivoxy.sh
330 and stopPrivoxy.sh supplied in /Applications/Privoxy. They must be run from an
331 administrator account, using sudo.
334 To uninstall, run /Applications/Privoxy/uninstall.command as sudo from an
335 administrator account.
337 <sect3 renderas="sect4" id="OS-X-install-from-source">
338 <title>Installation from source</title>
340 To build and install the Privoxy source code on OS X you will need to obtain
341 the macsetup module from the Privoxy Sourceforge CVS repository (refer to
342 Sourceforge help for details of how to set up a CVS client to have read-only
343 access to the repository). This module contains scripts that leverage the usual
344 open-source tools (available as part of Apple's free of charge Xcode
345 distribution or via the usual open-source software package managers for OS X
346 (MacPorts, Homebrew, Fink etc.) to build and then install the privoxy binary
347 and associated files. The macsetup module's README file contains complete
348 instructions for its use.
351 The privoxy service will automatically start after a successful installation
352 (and thereafter every time your computer starts up) however you will need to
353 configure your web browser(s) to use it. To do so, configure them to use a
354 proxy for HTTP and HTTPS at the address 127.0.0.1:8118.
357 To prevent the privoxy service from automatically starting when your computer
358 starts up, remove or rename the file <literal>/Library/LaunchDaemons/org.ijbswa.privoxy.plist</literal>
359 (on OS X 10.5 and higher) or the folder named
360 <literal>/Library/StartupItems/Privoxy</literal> (on OS X 10.4 'Tiger').
363 To manually start or stop the privoxy service, use the Privoxy Utility
364 for Mac OS X (also part of the macsetup module). This application can start
365 and stop the privoxy service and display its log and configuration files.
368 To uninstall, run the macsetup module's uninstall.sh as sudo from an
369 administrator account.
373 <!-- ~~~~~ New section ~~~~~ -->
374 <sect3 id="installation-amiga"><title>AmigaOS</title>
376 Copy and then unpack the <filename>lha</filename> archive to a suitable location.
377 All necessary files will be installed into <application>Privoxy</application>
378 directory, including all configuration and log files. To uninstall, just
379 remove this directory.
383 <!-- ~~~~~ New section ~~~~~ -->
384 <sect3 id="installation-tbz"><title>FreeBSD</title>
387 Privoxy is part of FreeBSD's Ports Collection, you can build and install
388 it with <literal>cd /usr/ports/www/privoxy; make install clean</literal>.
391 If you don't use the ports, you can fetch and install
392 the package with <literal>pkg_add -r privoxy</literal>.
395 The port skeleton and the package can also be downloaded from the
396 <ulink url="https://sourceforge.net/project/showfiles.php?group_id=11118">File Release
397 Page</ulink>, but there's no reason to use them unless you're interested in the
398 beta releases which are only available there.
402 <!-- ~~~~~ New section ~~~~~ -->
403 <sect3 id="installattion-gentoo"><title>Gentoo</title>
405 Gentoo source packages (Ebuilds) for <application>Privoxy</application> are
406 contained in the Gentoo Portage Tree (they are not on the download page,
407 but there is a Gentoo section, where you can see when a new
408 <application>Privoxy</application> Version is added to the Portage Tree).
411 Before installing <application>Privoxy</application> under Gentoo just do
412 first <literal>emerge --sync</literal> to get the latest changes from the
413 Portage tree. With <literal>emerge privoxy</literal> you install the latest
417 Configuration files are in <filename>/etc/privoxy</filename>, the
418 documentation is in <filename>/usr/share/doc/privoxy-&p-version;</filename>
419 and the Log directory is in <filename>/var/log/privoxy</filename>.
425 <!-- ~~~~~ New section ~~~~~ -->
426 <sect2 id="installation-source"><title>Building from Source</title>
429 The most convenient way to obtain the <application>Privoxy</application> sources
430 is to download the source tarball from our
431 <ulink url="http://sourceforge.net/project/showfiles.php?group_id=11118&package_id=10571">project download
436 If you like to live on the bleeding edge and are not afraid of using
437 possibly unstable development versions, you can check out the up-to-the-minute
438 version directly from <ulink url="http://sourceforge.net/cvs/?group_id=11118">the
439 CVS repository</ulink>.
441 deprecated...out of business.
442 or simply download <ulink
443 url="http://cvs.sourceforge.net/cvstarballs/ijbswa-cvsroot.tar.bz2">the nightly CVS
448 <!-- include buildsource.sgml boilerplate: -->
450 <!-- end boilerplate -->
453 <!-- ~~~~~ New section ~~~~~ -->
454 <sect2 id="installation-keepupdated"><title>Keeping your Installation Up-to-Date</title>
456 As user feedback comes in and development continues, we will make updated versions
457 of both the main <link linkend="actions-file">actions file</link> (as a <ulink
458 url="http://sourceforge.net/project/showfiles.php?group_id=11118&release_id=103670">separate
459 package</ulink>) and the software itself (including the actions file) available for
464 If you wish to receive an email notification whenever we release updates of
465 <application>Privoxy</application> or the actions file, <ulink
466 url="http://lists.sourceforge.net/lists/listinfo/ijbswa-announce/">subscribe
467 to our announce mailing list</ulink>, ijbswa-announce@lists.sourceforge.net.
471 In order not to lose your personal changes and adjustments when updating
472 to the latest <literal>default.action</literal> file we <emphasis>strongly
473 recommend</emphasis> that you use <literal>user.action</literal> and
474 <literal>user.filter</literal> for your local
475 customizations of <application>Privoxy</application>. See the <link
476 linkend="actions-file">Chapter on actions files</link> for details.
484 <!-- ~ End section ~ -->
486 <!-- ~~~~~ New section ~~~~~ -->
487 <sect1 id="whatsnew">
488 <title>What's New in this Release</title>
490 <application>Privoxy 3.0.19</application> is a stable release.
491 The changes since 3.0.18 stable are:
502 Prevent a segmentation fault when de-chunking buffered content.
503 It could be triggered by malicious web servers if Privoxy was
504 configured to filter the content and running on a platform
505 where SIZE_T_MAX isn't larger than UINT_MAX, which probably
506 includes most 32-bit systems. On those platforms, all Privoxy
507 versions before 3.0.19 appear to be affected.
508 To be on the safe side, this bug should be presumed to allow
509 code execution as proving that it doesn't seems unrealistic.
514 Do not expect a response from the SOCKS4/4A server until it
515 got something to respond to. This regression was introduced
516 in 3.0.18 and prevented the SOCKS4/4A negotiation from working.
517 Reported by qqqqqw in #3459781.
525 General improvements:
529 Fix an off-by-one in an error message about connect failures.
534 Use a GNUMakefile variable for the webserver root directory and
535 update the path. Sourceforge changed it which broke various
541 Update the CODE_STATUS description.
551 The following changes were made between 3.0.17 and 3.0.18:
562 If a generated redirect URL contains characters RFC 3986 doesn't
563 permit, they are (re)encoded. Not doing this makes Privoxy versions
564 from 3.0.5 to 3.0.17 susceptible to HTTP response splitting (CWE-113)
565 attacks if the +fast-redirects{check-decoded-url} action is used.
570 Fix a logic bug that could cause Privoxy to reuse a server
571 socket after it got tainted by a server-header-tagger-induced
572 block that was triggered before the whole server response had
573 been read. If keep-alive was enabled and the request following
574 the blocked one was to the same host and using the same forwarding
575 settings, Privoxy would send it on the tainted server socket.
576 While the server would simply treat it as a pipelined request,
577 Privoxy would later on fail to properly parse the server's
578 response as it would try to parse the unread data from the
579 first response as server headers for the second one.
580 Regression introduced in 3.0.17.
585 When implying keep-alive in client_connection(), remember that
586 the client didn't. Fixes a regression introduced in 3.0.13 that
587 would cause Privoxy to wait for additional client requests after
588 receiving a HTTP/1.1 request with "Connection: close" set
589 and connection sharing enabled.
590 With clients which terminates the client connection after detecting
591 that the whole body has been received it doesn't really matter,
592 but with clients that don't the connection would be kept open until
598 Fix a subtle race condition between prepare_csp_for_next_request()
599 and sweep(). A thread preparing itself for the next client request
600 could briefly appear to be inactive.
601 If all other threads were already using more recent files,
602 the thread could get its files swept away under its feet.
603 So far this has only been reproduced while stress testing in
604 valgrind while touching action files in a loop. It's unlikely
605 to have caused any actual problems in the real world.
610 Disable filters if SDCH compression is used unless filtering is forced.
611 If SDCH was combined with a supported compression algorithm, Privoxy
612 previously could try to decompress it and ditch the Content-Encoding
613 header even though the SDCH compression wasn't dealt with.
614 Reported by zebul666 in #3225863.
619 Make a copy of the --user value and only mess with that when splitting
620 user and group. On some operating systems modifying the value directly
621 is reflected in the output of ps and friends and can be misleading.
622 Reported by zepard in #3292710.
627 If forwarded-connect-retries is set, only retry if Privoxy is actually
628 forwarding the request. Previously direct connections would be retried
634 Fixed a small memory leak when retrying connections with IPv6
640 Remove an incorrect assertion in compile_dynamic_pcrs_job_list()
641 It could be triggered by a pcrs job with an invalid pcre
642 pattern (for example one that contains a lone quantifier).
647 If the --user argument user[.group] contains a dot, always bail out
648 if no group has been specified. Previously the intended, but undocumented
649 (and apparently untested), behaviour was to try interpreting the whole
650 argument as user name, but the detection was flawed and checked for '0'
651 instead of '\0', thus merely preventing group names beginning with a zero.
656 In html_code_map[], use a numeric character reference instead of '
657 which wasn't standardized before XHTML 1.0.
662 Fix an invalid free when compiled with FEATURE_GRACEFUL_TERMINATION
663 and shut down through http://config.privoxy.org/die
668 In get_actions(), fix the "temporary" backwards compatibility hack
669 to accept block actions without reason.
670 It also covered other actions that should be rejected as invalid.
671 Reported by Billy Crook.
679 General improvements:
683 Privoxy can (re)compress buffered content before delivering
684 it to the client. Disabled by default as most users wouldn't
690 The +fast-redirects{check-decoded-url} action checks URL
691 segments separately. If there are other parameters behind
692 the redirect URL, this makes it unnecessary to cut them off
693 by additionally using a +redirect{} pcrs command.
694 Initial patch submitted by Jamie Zawinski in #3429848.
699 When loading action sections, verify that the referenced filters
700 exist. Currently missing filters only result in an error message,
701 but eventually the severity will be upgraded to fatal.
706 Allow to bind to multiple separate addresses.
707 Patch set submitted by Petr Pisar in #3354485.
712 Set socket_error to errno if connecting fails in rfc2553_connect_to().
713 Previously rejected direct connections could be incorrectly reported
714 as DNS issues if Privoxy was compiled with IPv6 support.
719 Adjust url_code_map[] so spaces are replaced with %20 instead of '+'
720 While '+' can be used by client's submitting form data, this is not
721 actually what Privoxy is using the lookups for. This is more of a
722 cosmetic issue and doesn't fix any known problems.
727 When compiled without FEATURE_FAST_REDIRECTS, do not silently
728 ignore +fast-redirect{} directives
733 Added a workaround for GNU libc's strptime() reporting negative
734 year values when the parsed year is only specified with two digits.
735 On affected systems cookies with such a date would not be turned
736 into session cookies by the +session-cookies-only action.
737 Reported by Vaeinoe in #3403560
742 Fixed bind failures with certain GNU libc versions if no non-loopback
743 IP address has been configured on the system. This is mainly an issue
744 if the system is using DHCP and Privoxy is started before the network
745 is completely configured.
746 Reported by Raphael Marichez in #3349356.
747 Additional insight from Petr Pisar.
752 Privoxy log messages now use the ISO 8601 date format %Y-%m-%d.
753 It's only slightly longer than the old format, but contains
754 the full date including the year and allows sorting by date
755 (when grepping in multiple log files) without hassle.
760 In get_last_url(), do not bother trying to decode URLs that do
761 not contain at least one '%' sign. It reduces the log noise and
762 a number of unnecessary memory allocations.
767 In case of SOCKS5 failures, dump the socks response in the log message.
772 Simplify the signal setup in main().
777 Streamline socks5_connect() slightly.
782 In socks5_connect(), require a complete socks response from the server.
783 Previously Privoxy didn't care how much data the server response
784 contained as long as the first two bytes contained the expected
785 values. While at it, shrink the buffer size so Privoxy can't read
786 more than a whole socks response.
791 In chat(), do not bother to generate a client request in case of
792 direct CONNECT requests. It will not be used anyway.
797 Reduce server_last_modified()'s stack size.
802 Shorten get_http_time() by using strftime().
807 Constify the known_http_methods pointers in unknown_method().
812 Constify the time_formats pointers in parse_header_time().
817 Constify the formerly_valid_actions pointers in action_used_to_be_valid().
822 Introduce a GNUMakefile MAN_PAGE variable that defaults to privoxy.1.
823 The Debian package uses section 8 for the man page and this
824 should simplify the patch.
829 Deduplicate the INADDR_NONE definition for Solaris by moving it to jbsockets.h
834 In block_url(), ditch the obsolete workaround for ancient Netscape versions
835 that supposedly couldn't properly deal with status code 403.
840 Remove a useless NULL pointer check in load_trustfile().
845 Remove two useless NULL pointer checks in load_one_re_filterfile().
850 Change url_code_map[] from an array of pointers to an array of arrays
851 It removes an unnecessary layer of indirection and on 64bit system reduces
852 the size of the binary a bit.
857 Fix various typos. Fixes taken from Debian's 29_typos.dpatch by Roland Rosenfeld.
862 Add a dok-tidy GNUMakefile target to clean up the messy HTML
863 generated by the other dok targets.
868 GNUisms in the GNUMakefile have been removed.
873 Change the HTTP version in static responses to 1.1
878 Synced config.sub and config.guess with upstream
879 2011-11-11/386c7218162c145f5f9e1ff7f558a3fbb66c37c5.
884 Add a dedicated function to parse the values of toggles. Reduces duplicated
885 code in load_config() and provides better error handling. Invalid or missing
886 toggle values are now a fatal error instead of being silently ignored.
891 Terminate HTML lines in static error messages with \n instead of \r\n.
896 Simplify cgi_error_unknown() a bit.
901 In LogPutString(), don't bother looking at pszText when not
902 actually logging anything.
907 Change ssplit()'s fourth parameter from int to size_t.
908 Fixes a clang complaint.
913 Add a warning that the statistics currently can't be trusted.
914 Mention Privoxy-Log-Parser's --statistics option as
915 an alternative for the time being.
920 In rfc2553_connect_to(), start setting cgi->error_message on error.
925 Change the expected status code returned for http://p.p/die depending
926 on whether or not FEATURE_GRACEFUL_TERMINATION is available.
931 In cgi_die(), mark the client connection for closing.
932 If the client will fetch the style sheet through another connection
933 it gets the main thread out of the accept() state and should thus
934 trigger the actual shutdown.
939 Add a proper CGI message for cgi_die().
944 Don't enforce a logical line length limit in read_config_line().
949 Slightly refactor server_last_modified() to remove useless gmtime*() calls.
954 In get_content_type(), also recognize '.jpeg' as JPEG extension.
959 Add '.png' to the list of recognized file extensions in get_content_type().
964 In block_url(), consistently use the block reason "Request blocked by Privoxy"
965 In two places the reason was "Request for blocked URL" which hides the
966 fact that the request got blocked by Privoxy and isn't necessarily
967 correct as the block may be due to tags.
972 In listen_loop(), reload the configuration files after accepting
973 a new connection instead of before.
974 Previously the first connection that arrived after a configuration
975 change would still be handled with the old configuration.
980 In chat()'s receive-data loop, skip a client socket check if
981 the socket will be written to right away anyway. This can
982 increase the transfer speed for unfiltered content on fast
988 The socket timeout is used for SOCKS negotiations as well which
989 previously couldn't timeout.
994 Don't keep the client connection alive if any configuration file
995 changed since the time the connection came in. This is closer to
996 Privoxy's behaviour before keep-alive support for client connection
997 has been added and also less confusing in general.
1002 Treat all Content-Type header values containing the pattern
1003 'script' as a sign of text. Reported by pribog in #3134970.
1011 Action file improvements:
1015 Moved the site-specific block pattern section below the one for the
1016 generic patterns so for requests that are matched in both, the block
1017 reason for the domain is shown which is usually more useful than showing
1018 the one for the generic pattern.
1023 Remove -prevent-compression from the fragile alias. It's no longer
1024 used anywhere by default and isn't known to break stuff anyway.
1029 Add a (disabled) section to block various Facebook tracking URLs.
1030 Reported by Dan Stahlke in #3421764.
1035 Add a (disabled) section to rewrite and redirect click-tracking
1036 URLs used on news.google.com.
1037 Reported by Dan Stahlke in #3421755.
1042 Unblock linuxcounter.net/.
1043 Reported by Dan Stahlke in #3422612.
1048 Block 'www91.intel.com/' which is used by Omniture.
1049 Reported by Adam Piggott in #3167370.
1054 Disable the handle-as-empty-doc-returns-ok option and mark it as deprecated.
1055 Reminded by tceverling in #2790091.
1060 Add ".ivwbox.de/" to the "Cross-site user tracking" section.
1061 Reported by Nettozahler in #3172525.
1066 Unblock and fast-redirect ".awin1.com/.*=http://".
1067 Reported by Adam Piggott in #3170921.
1072 Block "b.collective-media.net/".
1077 Widen the Debian popcon exception to "qa.debian.org/popcon".
1078 Seen in Debian's 05_default_action.dpatch by Roland Rosenfeld.
1083 Block ".gemius.pl/" which only seems to be used for user tracking.
1084 Reported by johnd16 in #3002731. Additional input from Lee and movax.
1089 Disable banners-by-size filters for '.thinkgeek.com/'.
1090 The filter only seems to catch pictures of the inventory.
1095 Block requests for 'go.idmnet.bbelements.com/please/showit/'.
1096 Reported by kacperdominik in #3372959.
1101 Unblock adainitiative.org/.
1106 Add a fast-redirects exception for '.googleusercontent.com/.*=cache'.
1111 Add a fast-redirects exception for webcache.googleusercontent.com/.
1116 Unblock http://adassier.wordpress.com/ and http://adassier.files.wordpress.com/.
1124 Filter file improvements:
1128 Let the yahoo filter hide '.ads'.
1133 Let the msn filter hide overlay ads for Facebook 'likes' in search
1134 results and elements with the id 's_notf_div'. They only seem to be
1135 used to advertise site 'enhancements'.
1140 Let the js-events filter additionally disarm setInterval().
1141 Suggested by dg1727 in #3423775.
1149 Documentation improvements:
1153 Clarify the effect of compiling Privoxy with zlib support.
1154 Suggested by dg1727 in #3423782.
1159 Point out that the SourceForge messaging system works like a black
1160 hole and should thus not be used to contact individual developers.
1165 Mention some of the problems one can experience when not explicitly
1166 configuring an IP addresses as listen address.
1171 Explicitly mention that hostnames can be used instead of IP addresses
1172 for the listen-address, that only the first address returned will be
1173 used and what happens if the address is invalid.
1174 Requested by Calestyo in #3302213.
1182 Log message improvements:
1186 If only the server connection is kept alive, do not pretend to
1187 wait for a new client request.
1192 Remove a superfluous log message in forget_connection().
1197 In chat(), properly report missing server responses as such
1198 instead of calling them empty.
1203 In forwarded_connect(), fix a log message nobody should ever see.
1208 Fix a log message in socks5_connect(), a failed write operation
1209 was logged as failed read operation.
1214 Let load_one_actions_file() properly complain about a missing
1215 '{' at the beginning of the file.
1216 Simply stating that a line is invalid isn't particularly helpful.
1221 Do not claim to listen on a socket until Privoxy actually does.
1222 Patch submitted by Petr Pisar #3354485
1227 Prevent a duplicated LOG_LEVEL_CLF message when sending out
1228 the "no-server-data" response.
1233 Also log the client socket when dropping a connection.
1238 Include the destination host in the 'Request ... marked for
1239 blocking. limit-connect{...} doesn't allow CONNECT ...' message
1240 Patch submitted by Saperski in #3296250.
1245 Prevent a duplicated log message if none of the resolved IP
1246 addresses were reachable.
1251 In connect_to(), do not pretend to retry if forwarded-connect-retries
1257 When a specified user or group can't be found, put the name in
1258 single-quotes when logging it.
1263 In rfc2553_connect_to(), explain getnameinfo() errors better.
1268 Remove a useless log message in chat().
1273 When retrying to connect, also log the maximum number of connection
1279 Rephrase a log message in compile_dynamic_pcrs_job_list().
1280 Divide the error code and its meaning with a colon. Call the pcrs
1281 job dynamic and not the filter. Filters may contain dynamic and
1282 non-dynamic pcrs jobs at the same time. Only mention the name of
1283 the filter or tagger, but don't claim it's a filter when it could
1289 In a fatal error message in load_one_actions_file(), cover both
1290 URL and TAG patterns.
1295 In pcrs_strerror(), properly report unknown positive error code
1296 values as such. Previously they were handled like 0 (no error).
1301 In compile_dynamic_pcrs_job_list(), also log the actual error code as
1302 pcrs_strerror() doesn't handle all errors reported by pcre.
1307 Don't bother trying to continue chatting if the client didn't ask for it.
1308 Reduces log noise a bit.
1313 Make two fatal error message in load_one_actions_file() more descriptive.
1318 In cgi_send_user_manual(), log when rejecting a file name due to '/' or '..'.
1323 In load_file(), log a message if opening a file failed.
1324 The CGI error message alone isn't too helpful.
1329 In connection_destination_matches(), improve two log messages
1330 to help understand why the destinations don't match.
1335 Rephrase a log message in serve(). Client request arrival
1336 should be differentiated from closed client connections now.
1341 In serve(), log if a client connection isn't reused due to a
1342 configuration file change.
1347 Let mark_server_socket_tainted() always mark the server socket tainted,
1348 just don't talk about it in cases where it has no effect. It doesn't change
1349 Privoxy's behaviour, but makes understanding the log file easier.
1361 Added a --disable-ipv6-support switch for platforms where support
1362 is detected but doesn't actually work.
1367 Do not check for the existence of strerror() and memmove() twice
1372 Remove a useless test for setpgrp(2). Privoxy doesn't need it and
1373 it can cause problems when cross-compiling.
1378 Rename the --disable-acl-files switch to --disable-acl-support.
1379 Since about 2001, ACL directives are specified in the standard
1385 Update the URL of the 'Removing outdated PCRE version after the
1386 next stable release' posting. The old URL stopped working after
1387 one of SF's recent site "optimizations". Reported by Han Liu.
1395 Privoxy-Regression-Test:
1399 Added --shuffle-tests option to increase the chances of detection race conditions.
1404 Added a --local-test-file option that allows to use Privoxy-Regression-Test without Privoxy.
1409 Added tests for missing socks4 and socks4a forwarders.
1414 The --privoxy-address option now works with IPv6 addresses containing brackets, too.
1419 Perform limited sanity checks for parameters that are supposed to have numerical values.
1424 Added a --sleep-time option to specify a number of seconds to
1425 sleep between tests, defaults to 0.
1430 Disable the range-requests tagger for tests that break if it's enabled.
1435 Log messages use the ISO 8601 date format %Y-%m-%d.
1440 Fix spelling in two error messages.
1445 In the --help output, include a list of supported tests and their default levels.
1450 Adjust the tests to properly deal with FEATURE_TOGGLE being disabled.
1462 Perform limited sanity checks for command line parameters that
1463 are supposed to have numerical values.
1468 Implement a --unbreak-lines-only option to try to revert MUA breakage.
1473 Accept and highlight: Added header: Content-Encoding: deflate
1478 Accept and highlight: Compressed content from 29258 to 8630 bytes.
1483 Accept and highlight: Client request arrived in time on socket 21.
1488 Highlight: Didn't receive data in time: a.fsdn.com:443
1493 Accept log messages with ISO 8601 time stamps, too.
1505 Bump generated Firefox version to 8.0.
1510 Only randomize the release date if the new --randomize-release-date
1511 option is enabled. Firefox versions after 4 use a fixed date string
1522 <!-- ~~~~~ New section ~~~~~ -->
1524 <sect2 id="upgradersnote">
1525 <title>Note to Upgraders</title>
1528 A quick list of things to be aware of before upgrading from earlier
1529 versions of <application>Privoxy</application>:
1537 The recommended way to upgrade &my-app; is to backup your old
1538 configuration files, install the new ones, verify that &my-app;
1539 is working correctly and finally merge back your changes using
1540 <application>diff</application> and maybe <application>patch</application>.
1543 There are a number of new features in each &my-app; release and
1544 most of them have to be explicitly enabled in the configuration
1545 files. Old configuration files obviously don't do that and due
1546 to syntax changes using old configuration files with a new
1547 &my-app; isn't always possible anyway.
1552 Note that some installers remove earlier versions completely,
1553 including configuration files, therefore you should really save
1554 any important configuration files!
1559 On the other hand, other installers don't overwrite existing configuration
1560 files, thinking you will want to do that yourself.
1565 <filename>standard.action</filename> has been merged into
1566 the <filename>default.action</filename> file.
1571 In the default configuration only fatal errors are logged now.
1572 You can change that in the <link linkend="DEBUG">debug section</link>
1573 of the configuration file. You may also want to enable more verbose
1574 logging until you verified that the new &my-app; version is working
1581 Three other config file settings are now off by default:
1582 <link linkend="enable-remote-toggle">enable-remote-toggle</link>,
1583 <link linkend="enable-remote-http-toggle">enable-remote-http-toggle</link>,
1584 and <link linkend="enable-edit-actions">enable-edit-actions</link>.
1585 If you use or want these, you will need to explicitly enable them, and
1586 be aware of the security issues involved.
1593 What constitutes a <quote>default</quote> configuration has changed,
1594 and you may want to review which actions are <quote>on</quote> by
1595 default. This is primarily a matter of emphasis, but some features
1596 you may have been used to, may now be <quote>off</quote> by default.
1597 There are also a number of new actions and filters you may want to
1598 consider, most of which are not fully incorporated into the default
1599 settings as yet (see above).
1606 The default actions setting is now <literal>Cautious</literal>. Previous
1607 releases had a default setting of <literal>Medium</literal>. Experienced
1608 users may want to adjust this, as it is fairly conservative by &my-app;
1609 standards and past practices. See <ulink
1610 url="http://config.privoxy.org/edit-actions-list?f=default">
1611 http://config.privoxy.org/edit-actions-list?f=default</ulink>. New users
1612 should try the default settings for a while before turning up the volume.
1618 The default setting has filtering turned <emphasis>off</emphasis>, which
1619 subsequently means that compression is <emphasis>on</emphasis>. Remember
1620 that filtering does not work on compressed pages, so if you use, or want to
1621 use, filtering, you will need to force compression off. Example:
1625 { +<link linkend="filter">filter</link>{google} +<link linkend="prevent-compression">prevent-compression</link> }
1629 Or if you use a number of filters, or filter many sites, you may just want
1630 to turn off compression for all sites in
1631 <filename>default.action</filename> (or
1632 <filename>user.action</filename>).
1639 Also, <link linkend="SESSION-COOKIES-ONLY">session-cookies-only</link> is
1640 off by default now. If you've liked this feature in the past, you may want
1641 to turn it back on in <filename>user.action</filename> now.
1648 Some installers may not automatically start
1649 <application>Privoxy</application> after installation.
1660 <!-- ~~~~~ New section ~~~~~ -->
1661 <sect1 id="quickstart"><title>Quickstart to Using Privoxy</title>
1667 Install <application>Privoxy</application>. See the <link
1668 linkend="installation">Installation Section</link> below for platform specific
1675 Advanced users and those who want to offer <application>Privoxy</application>
1676 service to more than just their local machine should check the <link
1677 linkend="config">main config file</link>, especially the <link
1678 linkend="access-control">security-relevant</link> options. These are
1685 Start <application>Privoxy</application>, if the installation program has
1686 not done this already (may vary according to platform). See the section
1687 <link linkend="startup">Starting <application>Privoxy</application></link>.
1693 Set your browser to use <application>Privoxy</application> as HTTP and
1694 HTTPS (SSL) <ulink url="http://en.wikipedia.org/wiki/Proxy_server">proxy</ulink>
1695 by setting the proxy configuration for address of
1696 <literal>127.0.0.1</literal> and port <literal>8118</literal>.
1697 <emphasis>DO NOT</emphasis> activate proxying for <literal>FTP</literal> or
1698 any protocols besides HTTP and HTTPS (SSL) unless you intend to prevent your
1699 browser from using these protocols.
1705 Flush your browser's disk and memory caches, to remove any cached ad images.
1706 If using <application>Privoxy</application> to manage
1707 <ulink url="http://en.wikipedia.org/wiki/Browser_cookie">cookies</ulink>,
1708 you should remove any currently stored cookies too.
1714 A default installation should provide a reasonable starting point for
1715 most. There will undoubtedly be occasions where you will want to adjust the
1716 configuration, but that can be dealt with as the need arises. Little
1717 to no initial configuration is required in most cases, you may want
1719 <ulink url="config.html#ENABLE-EDIT-ACTIONS">web-based action editor</ulink> though.
1720 Be sure to read the warnings first.
1723 See the <link linkend="configuration">Configuration section</link> for more
1724 configuration options, and how to customize your installation.
1725 You might also want to look at the <link
1726 linkend="quickstart-ad-blocking">next section</link> for a quick
1727 introduction to how <application>Privoxy</application> blocks ads and
1734 If you experience ads that slip through, innocent images that are
1735 blocked, or otherwise feel the need to fine-tune
1736 <application>Privoxy's</application> behavior, take a look at the <link
1737 linkend="actions-file">actions files</link>. As a quick start, you might
1738 find the <link linkend="act-examples">richly commented examples</link>
1739 helpful. You can also view and edit the actions files through the <ulink
1740 url="http://config.privoxy.org">web-based user interface</ulink>. The
1741 Appendix <quote><link linkend="actionsanat">Troubleshooting: Anatomy of an
1742 Action</link></quote> has hints on how to understand and debug actions that
1743 <quote>misbehave</quote>.
1748 Did anyone test these lately?
1752 For easy access to &my-app;'s most important controls, drag the provided
1753 <link linkend="bookmarklets">Bookmarklets</link> into your browser's
1761 Please see the section <link linkend="contact">Contacting the
1762 Developers</link> on how to report bugs, problems with websites or to get
1769 Now enjoy surfing with enhanced control, comfort and privacy!
1777 <!-- ~~~~~ New section ~~~~~ -->
1779 <sect2 id="quickstart-ad-blocking">
1780 <title>Quickstart to Ad Blocking</title>
1782 NOTE: This section is deliberately redundant for those that don't
1783 want to read the whole thing (which is getting lengthy).
1786 Ad blocking is but one of <application>Privoxy's</application>
1787 array of features. Many of these features are for the technically minded advanced
1788 user. But, ad and banner blocking is surely common ground for everybody.
1791 This section will provide a quick summary of ad blocking so
1792 you can get up to speed quickly without having to read the more extensive
1793 information provided below, though this is highly recommended.
1796 First a bit of a warning ... blocking ads is much like blocking SPAM: the
1797 more aggressive you are about it, the more likely you are to block
1798 things that were not intended. And the more likely that some things
1799 may not work as intended. So there is a trade off here. If you want
1800 extreme ad free browsing, be prepared to deal with more
1801 <quote>problem</quote> sites, and to spend more time adjusting the
1802 configuration to solve these unintended consequences. In short, there is
1803 not an easy way to eliminate <emphasis>all</emphasis> ads. Either take
1804 the easy way and settle for <emphasis>most</emphasis> ads blocked with the
1805 default configuration, or jump in and tweak it for your personal surfing
1806 habits and preferences.
1809 Secondly, a brief explanation of <application>Privoxy's </application>
1810 <quote>actions</quote>. <quote>Actions</quote> in this context, are
1811 the directives we use to tell <application>Privoxy</application> to perform
1812 some task relating to HTTP transactions (i.e. web browsing). We tell
1813 <application>Privoxy</application> to take some <quote>action</quote>. Each
1814 action has a unique name and function. While there are many potential
1815 <application>actions</application> in <application>Privoxy's</application>
1816 arsenal, only a few are used for ad blocking. <link
1817 linkend="actions">Actions</link>, and <link linkend="actions-file">action
1818 configuration files</link>, are explained in depth below.
1821 Actions are specified in <application>Privoxy's</application> configuration,
1822 followed by one or more URLs to which the action should apply. URLs
1823 can actually be URL type <link linkend="af-patterns">patterns</link> that use
1824 wildcards so they can apply potentially to a range of similar URLs. The
1825 actions, together with the URL patterns are called a section.
1828 When you connect to a website, the full URL will either match one or more
1829 of the sections as defined in <application>Privoxy's</application> configuration,
1830 or not. If so, then <application>Privoxy</application> will perform the
1831 respective actions. If not, then nothing special happens. Furthermore, web
1832 pages may contain embedded, secondary URLs that your web browser will
1833 use to load additional components of the page, as it parses the
1834 original page's HTML content. An ad image for instance, is just an URL
1835 embedded in the page somewhere. The image itself may be on the same server,
1836 or a server somewhere else on the Internet. Complex web pages will have many
1837 such embedded URLs. &my-app; can deal with each URL individually, so, for
1838 instance, the main page text is not touched, but images from such-and-such
1843 The most important actions for basic ad blocking are: <literal><link
1844 linkend="block">block</link></literal>, <literal><link
1845 linkend="handle-as-image">handle-as-image</link></literal>,
1847 linkend="handle-as-empty-document">handle-as-empty-document</link></literal>,and
1848 <literal><link linkend="set-image-blocker">set-image-blocker</link></literal>:
1856 <literal><link linkend="block">block</link></literal> - this is perhaps
1857 the single most used action, and is particularly important for ad blocking.
1858 This action stops any contact between your browser and any URL patterns
1859 that match this action's configuration. It can be used for blocking ads,
1860 but also anything that is determined to be unwanted. By itself, it simply
1861 stops any communication with the remote server and sends
1862 <application>Privoxy</application>'s own built-in BLOCKED page instead to
1863 let you now what has happened (with some exceptions, see below).
1869 <literal><link linkend="handle-as-image">handle-as-image</link></literal> -
1870 tells <application>Privoxy</application> to treat this URL as an image.
1871 <application>Privoxy</application>'s default configuration already does this
1872 for all common image types (e.g. GIF), but there are many situations where this
1873 is not so easy to determine. So we'll force it in these cases. This is particularly
1874 important for ad blocking, since only if we know that it's an image of
1875 some kind, can we replace it with an image of our choosing, instead of the
1876 <application>Privoxy</application> BLOCKED page (which would only result in
1877 a <quote>broken image</quote> icon). There are some limitations to this
1878 though. For instance, you can't just brute-force an image substitution for
1879 an entire HTML page in most situations.
1885 <literal><link linkend="handle-as-empty-document">handle-as-empty-document</link></literal> -
1886 sends an empty document instead of <application>Privoxy's</application>
1887 normal BLOCKED HTML page. This is useful for file types that are neither
1888 HTML nor images, such as blocking JavaScript files.
1895 linkend="set-image-blocker">set-image-blocker</link></literal> - tells
1896 <application>Privoxy</application> what to display in place of an ad image that
1897 has hit a block rule. For this to come into play, the URL must match a
1898 <literal><link linkend="block">block</link></literal> action somewhere in the
1899 configuration, <emphasis>and</emphasis>, it must also match an
1900 <literal><link linkend="handle-as-image">handle-as-image</link></literal> action.
1903 The configuration options on what to display instead of the ad are:
1907 <emphasis>pattern</emphasis> - a checkerboard pattern, so that an ad
1908 replacement is obvious. This is the default.
1913 <emphasis>blank</emphasis> - A very small empty GIF image is displayed.
1914 This is the so-called <quote>invisible</quote> configuration option.
1919 <emphasis>http://<URL></emphasis> - A redirect to any image anywhere
1920 of the user's choosing (advanced usage).
1929 Advanced users will eventually want to explore &my-app;
1930 <literal><link linkend="filter">filters</link></literal> as well. Filters
1931 are very different from <literal><link
1932 linkend="block">blocks</link></literal>.
1933 A <quote>block</quote> blocks a site, page, or unwanted contented. Filters
1934 are a way of filtering or modifying what is actually on the page. An example
1935 filter usage: a text replacement of <quote>no-no</quote> for
1936 <quote>nasty-word</quote>. That is a very simple example. This process can be
1937 used for ad blocking, but it is more in the realm of advanced usage and has
1938 some pitfalls to be wary off.
1942 The quickest way to adjust any of these settings is with your browser through
1943 the special <application>Privoxy</application> editor at <ulink
1944 url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>
1945 (shortcut: <ulink url="http://p.p/">http://p.p/show-status</ulink>). This
1946 is an internal page, and does not require Internet access.
1950 Note that as of <application>Privoxy</application> 3.0.7 beta the
1951 action editor is disabled by default. Check the
1952 <ulink url="config.html#ENABLE-EDIT-ACTIONS">enable-edit-actions
1953 section in the configuration file</ulink> to learn why and in which
1954 cases it's safe to enable again.
1958 If you decided to enable the action editor, select the appropriate
1959 <quote>actions</quote> file, and click
1960 <quote><guibutton>Edit</guibutton></quote>. It is best to put personal or
1961 local preferences in <filename>user.action</filename> since this is not
1962 meant to be overwritten during upgrades, and will over-ride the settings in
1963 other files. Here you can insert new <quote>actions</quote>, and URLs for ad
1964 blocking or other purposes, and make other adjustments to the configuration.
1965 <application>Privoxy</application> will detect these changes automatically.
1969 A quick and simple step by step example:
1977 Right click on the ad image to be blocked, then select
1978 <quote><guimenuitem>Copy Link Location</guimenuitem></quote> from the
1986 url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>
1991 Find <filename>user.action</filename> in the top section, and click
1992 on <quote><guibutton>Edit</guibutton></quote>:
1995 <!-- image of editor and actions files selections -->
1997 <figure pgwide="0" float="0"><title>Actions Files in Use</title>
2000 <imagedata fileref="files-in-use.jpg" format="jpg">
2003 <phrase>[ Screenshot of Actions Files in Use ]</phrase>
2012 You should have a section with only
2013 <literal><link linkend="block">block</link></literal> listed under
2014 <quote>Actions:</quote>.
2015 If not, click a <quote><guibutton>Insert new section below</guibutton></quote>
2016 button, and in the new section that just appeared, click the
2017 <guibutton>Edit</guibutton> button right under the word <quote>Actions:</quote>.
2018 This will bring up a list of all actions. Find
2019 <literal><link linkend="block">block</link></literal> near the top, and click
2020 in the <quote>Enabled</quote> column, then <quote><guibutton>Submit</guibutton></quote>
2021 just below the list.
2026 Now, in the <literal><link linkend="block">block</link></literal> actions section,
2027 click the <quote><guibutton>Add</guibutton></quote> button, and paste the URL the
2028 browser got from <quote><guimenuitem>Copy Link Location</guimenuitem></quote>.
2029 Remove the <literal>http://</literal> at the beginning of the URL. Then, click
2030 <quote><guibutton>Submit</guibutton></quote> (or
2031 <quote><guibutton>OK</guibutton></quote> if in a pop-up window).
2036 Now go back to the original page, and press <keycap>SHIFT-Reload</keycap>
2037 (or flush all browser caches). The image should be gone now.
2045 This is a very crude and simple example. There might be good reasons to use a
2046 wildcard pattern match to include potentially similar images from the same
2047 site. For a more extensive explanation of <quote>patterns</quote>, and
2048 the entire actions concept, see <link linkend="actions-file">the Actions
2053 For advanced users who want to hand edit their config files, you might want
2054 to now go to the <link linkend="act-examples">Actions Files Tutorial</link>.
2055 The ideas explained therein also apply to the web-based editor.
2058 There are also various
2059 <link linkend="filter">filters</link> that can be used for ad blocking
2060 (filters are a special subset of actions). These
2061 fall into the <quote>advanced</quote> usage category, and are explained in
2062 depth in later sections.
2069 <!-- ~ End section ~ -->
2072 <!-- ~~~~~ New section ~~~~~ -->
2073 <sect1 id="startup">
2074 <title>Starting Privoxy</title>
2076 Before launching <application>Privoxy</application> for the first time, you
2077 will want to configure your browser(s) to use
2078 <application>Privoxy</application> as a HTTP and HTTPS (SSL)
2079 <ulink url="http://en.wikipedia.org/wiki/Proxy_server">proxy</ulink>. The default is
2080 127.0.0.1 (or localhost) for the proxy address, and port 8118 (earlier versions
2081 used port 8000). This is the one configuration step <emphasis>that must be done
2085 Please note that <application>Privoxy</application> can only proxy HTTP and
2086 HTTPS traffic. It will not work with FTP or other protocols.
2089 <!-- image of Mozilla Proxy configuration -->
2091 <figure pgwide="0" float="0"><title>Proxy Configuration Showing
2092 Mozilla/Netscape HTTP and HTTPS (SSL) Settings</title>
2095 <imagedata fileref="proxy_setup.jpg" format="jpg">
2098 <phrase>[ Screenshot of Mozilla Proxy Configuration ]</phrase>
2106 With <application>Firefox</application>, this is typically set under:
2110 <guibutton>Tools</guibutton> -> <guibutton>Options</guibutton> -> <guibutton>Advanced</guibutton> -> <guibutton>Network</guibutton> -><guibutton>Connection</guibutton> -> <guibutton>Settings</guibutton>
2115 Or optionally on some platforms:
2119 <guibutton>Edit</guibutton> -> <guibutton>Preferences</guibutton> -> <guibutton>General</guibutton> -> <guibutton>Connection Settings</guibutton> -> <guibutton>Manual Proxy Configuration</guibutton>
2125 With <application>Netscape</application> (and
2126 <application>Mozilla</application>), this can be set under:
2131 <!-- Mix ascii and gui art, something for everybody -->
2132 <!-- spacing on this is tricky -->
2133 <guibutton>Edit</guibutton> -> <guibutton>Preferences</guibutton> -> <guibutton>Advanced</guibutton> -> <guibutton>Proxies</guibutton> -> <guibutton>HTTP Proxy</guibutton>
2138 For <application>Internet Explorer v.5-7</application>:
2142 <guibutton>Tools</guibutton> -> <guibutton>Internet Options</guibutton> -> <guibutton>Connections</guibutton> -> <guibutton>LAN Settings</guibutton>
2146 Then, check <quote>Use Proxy</quote> and fill in the appropriate info
2147 (Address: 127.0.0.1, Port: 8118). Include HTTPS (SSL), if you want HTTPS
2148 proxy support too (sometimes labeled <quote>Secure</quote>). Make sure any
2149 checkboxes like <quote>Use the same proxy server for all protocols</quote> is
2150 <emphasis>UNCHECKED</emphasis>. You want only HTTP and HTTPS (SSL)!
2153 <!-- image of IE Proxy configuration -->
2155 <figure pgwide="0" float="0"><title>Proxy Configuration Showing
2156 Internet Explorer HTTP and HTTPS (Secure) Settings</title>
2159 <imagedata fileref="proxy2.jpg" format="jpg">
2162 <phrase>[ Screenshot of IE Proxy Configuration ]</phrase>
2170 After doing this, flush your browser's disk and memory caches to force a
2171 re-reading of all pages and to get rid of any ads that may be cached. Remove
2172 any <ulink url="http://en.wikipedia.org/wiki/Browser_cookie">cookies</ulink>,
2173 if you want <application>Privoxy</application> to manage that. You are now
2174 ready to start enjoying the benefits of using
2175 <application>Privoxy</application>!
2179 <application>Privoxy</application> itself is typically started by specifying the
2180 main configuration file to be used on the command line. If no configuration
2181 file is specified on the command line, <application>Privoxy</application>
2182 will look for a file named <filename>config</filename> in the current
2183 directory. Except on Win32 where it will try <filename>config.txt</filename>.
2186 <sect2 id="start-redhat">
2187 <title>Red Hat and Fedora</title>
2189 A default Red Hat installation may not start &my-app; upon boot. It will use
2190 the file <filename>/etc/privoxy/config</filename> as its main configuration
2195 # /etc/rc.d/init.d/privoxy start
2203 # service privoxy start
2208 <sect2 id="start-debian">
2209 <title>Debian</title>
2211 We use a script. Note that Debian typically starts &my-app; upon booting per
2212 default. It will use the file
2213 <filename>/etc/privoxy/config</filename> as its main configuration
2218 # /etc/init.d/privoxy start
2223 <sect2 id="start-windows">
2224 <title>Windows</title>
2226 Click on the &my-app; Icon to start <application>Privoxy</application>. If no configuration file is
2227 specified on the command line, <application>Privoxy</application> will look
2228 for a file named <filename>config.txt</filename>. Note that Windows will
2229 automatically start &my-app; when the system starts if you chose that option
2233 <application>Privoxy</application> can run with full Windows service functionality.
2234 On Windows only, the &my-app; program has two new command line arguments
2235 to install and uninstall &my-app; as a service. See the
2236 <link linkend="installation-pack-win">Windows Installation
2237 instructions</link> for details.
2241 <sect2 id="start-unices">
2242 <title>Solaris, NetBSD, FreeBSD, HP-UX and others</title>
2244 Example Unix startup command:
2248 # /usr/sbin/privoxy /etc/privoxy/config
2253 <sect2 id="start-os2">
2256 During installation, <application>Privoxy</application> is configured to
2257 start automatically when the system restarts. You can start it manually by
2258 double-clicking on the <application>Privoxy</application> icon in the
2259 <application>Privoxy</application> folder.
2263 <sect2 id="start-macosx">
2264 <title>Mac OS X</title>
2266 After downloading the privoxy software, unzip the downloaded file by
2267 double-clicking on the zip file icon. Then, double-click on the
2268 installer package icon and follow the installation process.
2271 The privoxy service will automatically start after a successful
2272 installation. In addition, the privoxy service will automatically
2273 start every time your computer starts up.
2276 To prevent the privoxy service from automatically starting when your
2277 computer starts up, remove or rename the folder named
2278 /Library/StartupItems/Privoxy.
2281 A simple application named Privoxy Utility has been created which
2282 enables administrators to easily start and stop the privoxy service.
2285 In addition, the Privoxy Utility presents a simple way for
2286 administrators to edit the various privoxy config files. A method
2287 to uninstall the software is also available.
2290 An administrator username and password must be supplied in order for
2291 the Privoxy Utility to perform any of the tasks.
2296 <sect2 id="start-amigaos">
2297 <title>AmigaOS</title>
2299 Start <application>Privoxy</application> (with RUN <>NIL:) in your
2300 <filename>startnet</filename> script (AmiTCP), in
2301 <filename>s:user-startup</filename> (RoadShow), as startup program in your
2302 startup script (Genesis), or as startup action (Miami and MiamiDx).
2303 <application>Privoxy</application> will automatically quit when you quit your
2304 TCP/IP stack (just ignore the harmless warning your TCP/IP stack may display that
2305 <application>Privoxy</application> is still running).
2309 <sect2 id="start-gentoo">
2310 <title>Gentoo</title>
2312 A script is again used. It will use the file <filename>/etc/privoxy/config
2313 </filename> as its main configuration file.
2317 /etc/init.d/privoxy start
2321 Note that <application>Privoxy</application> is not automatically started at
2322 boot time by default. You can change this with the <literal>rc-update</literal>
2327 rc-update add privoxy default
2335 See the section <link linkend="cmdoptions">Command line options</link> for
2339 must find a better place for this paragraph
2342 The included default configuration files should give a reasonable starting
2343 point. Most of the per site configuration is done in the
2344 <ulink url="actions-file.html"><quote>actions</quote></ulink> files. These are
2345 where various cookie actions are defined, ad and banner blocking, and other
2346 aspects of <application>Privoxy</application> configuration. There are several
2347 such files included, with varying levels of aggressiveness.
2351 You will probably want to keep an eye out for sites for which you may prefer
2352 persistent cookies, and add these to your actions configuration as needed. By
2353 default, most of these will be accepted only during the current browser
2354 session (aka <quote>session cookies</quote>), unless you add them to the
2355 configuration. If you want the browser to handle this instead, you will need
2356 to edit <filename>user.action</filename> (or through the web based interface)
2357 and disable this feature. If you use more than one browser, it would make
2358 more sense to let <application>Privoxy</application> handle this. In which
2359 case, the browser(s) should be set to accept all cookies.
2363 Another feature where you will probably want to define exceptions for trusted
2364 sites is the popup-killing (through <ulink
2365 url="actions-file.html#FILTER-POPUPS"><quote>+filter{popups}</quote></ulink>),
2366 because your favorite shopping, banking, or leisure site may need
2367 popups (explained below).
2371 <application>Privoxy</application> does not support all of the optional HTTP/1.1
2372 features yet. In the unlikely event that you experience inexplicable problems
2373 with browsers that use HTTP/1.1 per default
2374 (like <application>Mozilla</application> or recent versions of I.E.), you might
2375 try to force HTTP/1.0 compatibility. For Mozilla, look under <literal>Edit ->
2376 Preferences -> Debug -> Networking</literal>.
2377 Alternatively, set the <quote>+downgrade-http-version</quote> config option in
2378 <filename>default.action</filename> which will downgrade your browser's HTTP
2379 requests from HTTP/1.1 to HTTP/1.0 before processing them.
2383 After running <application>Privoxy</application> for a while, you can
2384 start to fine tune the configuration to suit your personal, or site,
2385 preferences and requirements. There are many, many aspects that can
2386 be customized. <quote>Actions</quote>
2387 can be adjusted by pointing your browser to
2388 <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
2389 (shortcut: <ulink url="http://p.p/">http://p.p/</ulink>),
2390 and then follow the link to <quote>View & Change the Current Configuration</quote>.
2391 (This is an internal page and does not require Internet access.)
2395 In fact, various aspects of <application>Privoxy</application>
2396 configuration can be viewed from this page, including
2397 current configuration parameters, source code version numbers,
2398 the browser's request headers, and <quote>actions</quote> that apply
2399 to a given URL. In addition to the actions file
2400 editor mentioned above, <application>Privoxy</application> can also
2401 be turned <quote>on</quote> and <quote>off</quote> (toggled) from this page.
2405 If you encounter problems, try loading the page without
2406 <application>Privoxy</application>. If that helps, enter the URL where
2407 you have the problems into <ulink url="http://p.p/show-url-info">the browser
2408 based rule tracing utility</ulink>. See which rules apply and why, and
2409 then try turning them off for that site one after the other, until the problem
2410 is gone. When you have found the culprit, you might want to turn the rest on
2415 If the above paragraph sounds gibberish to you, you might want to <link
2416 linkend="actions-file">read more about the actions concept</link>
2417 or even dive deep into the <link linkend="actionsanat">Appendix
2422 If you can't get rid of the problem at all, think you've found a bug in
2423 Privoxy, want to propose a new feature or smarter rules, please see the
2424 section <link linkend="contact"><quote>Contacting the
2425 Developers</quote></link> below.
2430 <!-- ~~~~~ New section ~~~~~ -->
2431 <sect2 id="cmdoptions">
2432 <title>Command Line Options</title>
2434 <application>Privoxy</application> may be invoked with the following
2435 command-line options:
2443 <emphasis>--config-test</emphasis>
2446 Exit after loading the configuration files before binding to
2447 the listen address. The exit code signals whether or not the
2448 configuration files have been successfully loaded.
2451 If the exit code is 1, at least one of the configuration files
2452 is invalid, if it is 0, all the configuration files have been
2453 successfully loaded (but may still contain errors that can
2454 currently only be detected at run time).
2457 This option doesn't affect the log setting, combination with
2458 <emphasis>--no-daemon</emphasis> is recommended if a configured
2459 log file shouldn't be used.
2464 <emphasis>--version</emphasis>
2467 Print version info and exit. Unix only.
2472 <emphasis>--help</emphasis>
2475 Print short usage info and exit. Unix only.
2480 <emphasis>--no-daemon</emphasis>
2483 Don't become a daemon, i.e. don't fork and become process group
2484 leader, and don't detach from controlling tty. Unix only.
2489 <emphasis>--pidfile FILE</emphasis>
2492 On startup, write the process ID to <emphasis>FILE</emphasis>. Delete the
2493 <emphasis>FILE</emphasis> on exit. Failure to create or delete the
2494 <emphasis>FILE</emphasis> is non-fatal. If no <emphasis>FILE</emphasis>
2495 option is given, no PID file will be used. Unix only.
2500 <emphasis>--user USER[.GROUP]</emphasis>
2503 After (optionally) writing the PID file, assume the user ID of
2504 <emphasis>USER</emphasis>, and if included the GID of GROUP. Exit if the
2505 privileges are not sufficient to do so. Unix only.
2510 <emphasis>--chroot</emphasis>
2513 Before changing to the user ID given in the <emphasis>--user</emphasis> option,
2514 chroot to that user's home directory, i.e. make the kernel pretend to the &my-app;
2515 process that the directory tree starts there. If set up carefully, this can limit
2516 the impact of possible vulnerabilities in &my-app; to the files contained in that hierarchy.
2522 <emphasis>--pre-chroot-nslookup hostname</emphasis>
2525 Specifies a hostname to look up before doing a chroot. On some systems, initializing the
2526 resolver library involves reading config files from /etc and/or loading additional shared
2527 libraries from /lib. On these systems, doing a hostname lookup before the chroot reduces
2528 the number of files that must be copied into the chroot tree.
2531 For fastest startup speed, a good value is a hostname that is not in /etc/hosts but that
2532 your local name server (listed in /etc/resolv.conf) can resolve without recursion
2533 (that is, without having to ask any other name servers). The hostname need not exist,
2534 but if it doesn't, an error message (which can be ignored) will be output.
2540 <emphasis>configfile</emphasis>
2543 If no <emphasis>configfile</emphasis> is included on the command line,
2544 <application>Privoxy</application> will look for a file named
2545 <quote>config</quote> in the current directory (except on Win32
2546 where it will look for <quote>config.txt</quote> instead). Specify
2547 full path to avoid confusion. If no config file is found,
2548 <application>Privoxy</application> will fail to start.
2556 On <application>MS Windows</application> only there are two additional
2557 command-line options to allow <application>Privoxy</application> to install and
2558 run as a <emphasis>service</emphasis>. See the
2559 <link linkend="installation-pack-win">Window Installation section</link>
2567 <!-- ~ End section ~ -->
2570 <!-- ~~~~~ New section ~~~~~ -->
2571 <sect1 id="configuration"><title>Privoxy Configuration</title>
2573 All <application>Privoxy</application> configuration is stored
2574 in text files. These files can be edited with a text editor.
2575 Many important aspects of <application>Privoxy</application> can
2576 also be controlled easily with a web browser.
2580 <!-- ~~~~~ New section ~~~~~ -->
2583 <title>Controlling Privoxy with Your Web Browser</title>
2585 <application>Privoxy</application>'s user interface can be reached through the special
2586 URL <ulink url="http://config.privoxy.org/">http://config.privoxy.org/</ulink>
2587 (shortcut: <ulink url="http://p.p/">http://p.p/</ulink>),
2588 which is a built-in page and works without Internet access.
2589 You will see the following section:
2593 <!-- Needs to be put in a table and colorized -->
2596 <bridgehead renderas="sect2"> Privoxy Menu</bridgehead>
2600 ▪ <ulink url="http://config.privoxy.org/show-status">View & change the current configuration</ulink>
2603 ▪ <ulink url="http://config.privoxy.org/show-version">View the source code version numbers</ulink>
2606 ▪ <ulink url="http://config.privoxy.org/show-request">View the request headers.</ulink>
2609 ▪ <ulink url="http://config.privoxy.org/show-url-info">Look up which actions apply to a URL and why</ulink>
2612 ▪ <ulink url="http://config.privoxy.org/toggle">Toggle Privoxy on or off</ulink>
2615 ▪ <ulink
2616 url="http://www.privoxy.org/&p-version;/user-manual/">Documentation</ulink>
2624 This should be self-explanatory. Note the first item leads to an editor for the
2625 <link linkend="actions-file">actions files</link>, which is where the ad, banner,
2626 cookie, and URL blocking magic is configured as well as other advanced features of
2627 <application>Privoxy</application>. This is an easy way to adjust various
2628 aspects of <application>Privoxy</application> configuration. The actions
2629 file, and other configuration files, are explained in detail below.
2633 <quote>Toggle Privoxy On or Off</quote> is handy for sites that might
2634 have problems with your current actions and filters. You can in fact use
2635 it as a test to see whether it is <application>Privoxy</application>
2636 causing the problem or not. <application>Privoxy</application> continues
2637 to run as a proxy in this case, but all manipulation is disabled, i.e.
2638 <application>Privoxy</application> acts like a normal forwarding proxy. There
2639 is even a toggle <link linkend="bookmarklets">Bookmarklet</link> offered, so
2640 that you can toggle <application>Privoxy</application> with one click from
2645 Note that several of the features described above are disabled by default
2646 in <application>Privoxy</application> 3.0.7 beta and later.
2648 <ulink url="config.html">configuration file</ulink> to learn why
2649 and in which cases it's safe to enable them again.
2654 <!-- ~ End section ~ -->
2659 <!-- ~~~~~ New section ~~~~~ -->
2661 <sect2 id="confoverview">
2662 <title>Configuration Files Overview</title>
2664 For Unix, *BSD and Linux, all configuration files are located in
2665 <filename>/etc/privoxy/</filename> by default. For MS Windows, OS/2, and
2666 AmigaOS these are all in the same directory as the
2667 <application>Privoxy</application> executable. <![%p-not-stable;[ The name
2668 and number of configuration files has changed from previous versions, and is
2669 subject to change as development progresses.]]>
2673 The installed defaults provide a reasonable starting point, though
2674 some settings may be aggressive by some standards. For the time being, the
2675 principle configuration files are:
2683 The <link linkend="config">main configuration file</link> is named <filename>config</filename>
2684 on Linux, Unix, BSD, OS/2, and AmigaOS and <filename>config.txt</filename>
2685 on Windows. This is a required file.
2691 <filename>match-all.action</filename> is used to define which <quote>actions</quote>
2692 relating to banner-blocking, images, pop-ups, content modification, cookie handling
2693 etc should be applied by default. It should be the first actions file loaded.
2696 <filename>default.action</filename> defines many exceptions (both positive and negative)
2697 from the default set of actions that's configured in <filename>match-all.action</filename>.
2698 It should be the second actions file loaded and shouldn't be edited by the user.
2701 Multiple actions files may be defined in <filename>config</filename>. These
2702 are processed in the order they are defined. Local customizations and locally
2703 preferred exceptions to the default policies as defined in
2704 <filename>match-all.action</filename> (which you will most probably want
2705 to define sooner or later) are best applied in <filename>user.action</filename>,
2706 where you can preserve them across upgrades. The file isn't installed by all
2707 installers, but you can easily create it yourself with a text editor.
2710 There is also a web based editor that can be accessed from
2712 url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>
2714 url="http://p.p/show-status">http://p.p/show-status</ulink>) for the
2715 various actions files.
2721 <quote>Filter files</quote> (the <link linkend="filter-file">filter
2722 file</link>) can be used to re-write the raw page content, including
2723 viewable text as well as embedded HTML and JavaScript, and whatever else
2724 lurks on any given web page. The filtering jobs are only pre-defined here;
2725 whether to apply them or not is up to the actions files.
2726 <filename>default.filter</filename> includes various filters made
2727 available for use by the developers. Some are much more intrusive than
2728 others, and all should be used with caution. You may define additional
2729 filter files in <filename>config</filename> as you can with
2730 actions files. We suggest <filename>user.filter</filename> for any
2731 locally defined filters or customizations.
2739 The syntax of the configuration and filter files may change between different
2740 Privoxy versions, unfortunately some enhancements cost backwards compatibility.
2741 <!-- Add link to documentation-->
2745 All files use the <quote><literal>#</literal></quote> character to denote a
2746 comment (the rest of the line will be ignored) and understand line continuation
2747 through placing a backslash ("<literal>\</literal>") as the very last character
2748 in a line. If the <literal>#</literal> is preceded by a backslash, it looses
2749 its special function. Placing a <literal>#</literal> in front of an otherwise
2750 valid configuration line to prevent it from being interpreted is called "commenting
2751 out" that line. Blank lines are ignored.
2755 The actions files and filter files
2756 can use Perl style <link linkend="regex">regular expressions</link> for
2757 maximum flexibility.
2761 After making any changes, there is no need to restart
2762 <application>Privoxy</application> in order for the changes to take
2763 effect. <application>Privoxy</application> detects such changes
2764 automatically. Note, however, that it may take one or two additional
2765 requests for the change to take effect. When changing the listening address
2766 of <application>Privoxy</application>, these <quote>wake up</quote> requests
2767 must obviously be sent to the <emphasis>old</emphasis> listening address.
2772 While under development, the configuration content is subject to change.
2773 The below documentation may not be accurate by the time you read this.
2774 Also, what constitutes a <quote>default</quote> setting, may change, so
2775 please check all your configuration files on important issues.
2781 <!-- ~ End section ~ -->
2784 <!-- ~~~~~~~~ New section Header ~~~~~~~~~ -->
2786 <!-- **************************************************** -->
2787 <!-- Include config.sgml here -->
2788 <!-- This is where the entire config file is detailed. -->
2790 <!-- end include -->
2793 <!-- ~ End section ~ -->
2797 <!-- ~~~~~~~~ New section Header ~~~~~~~~~ -->
2799 <sect1 id="actions-file"><title>Actions Files</title>
2803 XXX: similar descriptions are in the Configuration Files sections.
2804 We should only describe them at one place.
2807 The actions files are used to define what <emphasis>actions</emphasis>
2808 <application>Privoxy</application> takes for which URLs, and thus determines
2809 how ad images, cookies and various other aspects of HTTP content and
2810 transactions are handled, and on which sites (or even parts thereof).
2811 There are a number of such actions, with a wide range of functionality.
2812 Each action does something a little different.
2813 These actions give us a veritable arsenal of tools with which to exert
2814 our control, preferences and independence. Actions can be combined so that
2815 their effects are aggregated when applied against a given set of URLs.
2819 are three action files included with <application>Privoxy</application> with
2826 <filename>match-all.action</filename> - is used to define which
2827 <quote>actions</quote> relating to banner-blocking, images, pop-ups,
2828 content modification, cookie handling etc should be applied by default.
2829 It should be the first actions file loaded
2834 <filename>default.action</filename> - defines many exceptions (both
2835 positive and negative) from the default set of actions that's configured
2836 in <filename>match-all.action</filename>. It is a set of rules that should
2837 work reasonably well as-is for most users. This file is only supposed to
2838 be edited by the developers. It should be the second actions file loaded.
2843 <filename>user.action</filename> - is intended to be for local site
2844 preferences and exceptions. As an example, if your ISP or your bank
2845 has specific requirements, and need special handling, this kind of
2846 thing should go here. This file will not be upgraded.
2851 <guibutton>Edit</guibutton> <guibutton>Set to Cautious</guibutton> <guibutton>Set to Medium</guibutton> <guibutton>Set to Advanced</guibutton>
2854 These have increasing levels of aggressiveness <emphasis>and have no
2855 influence on your browsing unless you select them explicitly in the
2856 editor</emphasis>. A default installation should be pre-set to
2857 <literal>Cautious</literal>. New users should try this for a while before
2858 adjusting the settings to more aggressive levels. The more aggressive
2859 the settings, then the more likelihood there is of problems such as sites
2860 not working as they should.
2863 The <guibutton>Edit</guibutton> button allows you to turn each
2864 action on/off individually for fine-tuning. The <guibutton>Cautious</guibutton>
2865 button changes the actions list to low/safe settings which will activate
2866 ad blocking and a minimal set of &my-app;'s features, and subsequently
2867 there will be less of a chance for accidental problems. The
2868 <guibutton>Medium</guibutton> button sets the list to a medium level of
2869 other features and a low level set of privacy features. The
2870 <guibutton>Advanced</guibutton> button sets the list to a high level of
2871 ad blocking and medium level of privacy. See the chart below. The latter
2872 three buttons over-ride any changes via with the
2873 <guibutton>Edit</guibutton> button. More fine-tuning can be done in the
2874 lower sections of this internal page.
2877 While the actions file editor allows to enable these settings in all
2878 actions files, they are only supposed to be enabled in the first one
2879 to make sure you don't unintentionally overrule earlier rules.
2882 The default profiles, and their associated actions, as pre-defined in
2883 <filename>default.action</filename> are:
2886 <table frame=all><title>Default Configurations</title>
2887 <tgroup cols=4 align=left colsep=1 rowsep=1>
2888 <colspec colname=c1>
2889 <colspec colname=c2>
2890 <colspec colname=c3>
2891 <colspec colname=c4>
2894 <entry>Feature</entry>
2895 <entry>Cautious</entry>
2896 <entry>Medium</entry>
2897 <entry>Advanced</entry>
2902 <!-- <entry>f1</entry> -->
2903 <!-- <entry>f2</entry> -->
2904 <!-- <entry>f3</entry> -->
2905 <!-- <entry>f4</entry> -->
2911 <entry>Ad-blocking Aggressiveness</entry>
2912 <entry>medium</entry>
2918 <entry>Ad-filtering by size</entry>
2925 <entry>Ad-filtering by link</entry>
2931 <entry>Pop-up killing</entry>
2932 <entry>blocks only</entry>
2933 <entry>blocks only</entry>
2934 <entry>blocks only</entry>
2938 <entry>Privacy Features</entry>
2940 <entry>medium</entry>
2941 <entry>medium/high</entry>
2945 <entry>Cookie handling</entry>
2947 <entry>session-only</entry>
2952 <entry>Referer forging</entry>
2959 <entry>GIF de-animation</entry>
2966 <entry>Fast redirects</entry>
2973 <entry>HTML taming</entry>
2980 <entry>JavaScript taming</entry>
2987 <entry>Web-bug killing</entry>
2994 <entry>Image tag reordering</entry>
3010 The list of actions files to be used are defined in the main configuration
3011 file, and are processed in the order they are defined (e.g.
3012 <filename>default.action</filename> is typically processed before
3013 <filename>user.action</filename>). The content of these can all be viewed and
3015 url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>.
3016 The over-riding principle when applying actions, is that the last action that
3017 matches a given URL wins. The broadest, most general rules go first
3018 (defined in <filename>default.action</filename>),
3019 followed by any exceptions (typically also in
3020 <filename>default.action</filename>), which are then followed lastly by any
3021 local preferences (typically in <emphasis>user</emphasis><filename>.action</filename>).
3022 Generally, <filename>user.action</filename> has the last word.
3026 An actions file typically has multiple sections. If you want to use
3027 <quote>aliases</quote> in an actions file, you have to place the (optional)
3028 <link linkend="aliases">alias section</link> at the top of that file.
3029 Then comes the default set of rules which will apply universally to all
3030 sites and pages (be <emphasis>very careful</emphasis> with using such a
3031 universal set in <filename>user.action</filename> or any other actions file after
3032 <filename>default.action</filename>, because it will override the result
3033 from consulting any previous file). And then below that,
3034 exceptions to the defined universal policies. You can regard
3035 <filename>user.action</filename> as an appendix to <filename>default.action</filename>,
3036 with the advantage that it is a separate file, which makes preserving your
3037 personal settings across <application>Privoxy</application> upgrades easier.
3041 Actions can be used to block anything you want, including ads, banners, or
3042 just some obnoxious URL whose content you would rather not see. Cookies can be accepted
3043 or rejected, or accepted only during the current browser session (i.e. not
3044 written to disk), content can be modified, some JavaScripts tamed, user-tracking
3045 fooled, and much more. See below for a <link linkend="actions">complete list
3049 <!-- ~~~~~ New section ~~~~~ -->
3051 <title>Finding the Right Mix</title>
3053 Note that some <link linkend="actions">actions</link>, like cookie suppression
3054 or script disabling, may render some sites unusable that rely on these
3055 techniques to work properly. Finding the right mix of actions is not always easy and
3056 certainly a matter of personal taste. And, things can always change, requiring
3057 refinements in the configuration. In general, it can be said that the more
3058 <quote>aggressive</quote> your default settings (in the top section of the
3059 actions file) are, the more exceptions for <quote>trusted</quote> sites you
3060 will have to make later. If, for example, you want to crunch all cookies per
3061 default, you'll have to make exceptions from that rule for sites that you
3062 regularly use and that require cookies for actually useful purposes, like maybe
3063 your bank, favorite shop, or newspaper.
3067 We have tried to provide you with reasonable rules to start from in the
3068 distribution actions files. But there is no general rule of thumb on these
3069 things. There just are too many variables, and sites are constantly changing.
3070 Sooner or later you will want to change the rules (and read this chapter again :).
3074 <!-- ~~~~~ New section ~~~~~ -->
3076 <title>How to Edit</title>
3078 The easiest way to edit the actions files is with a browser by
3079 using our browser-based editor, which can be reached from <ulink
3080 url="http://config.privoxy.org/show-status">http://config.privoxy.org/show-status</ulink>.
3081 Note: the config file option <link
3082 linkend="enable-edit-actions">enable-edit-actions</link> must be enabled for
3083 this to work. The editor allows both fine-grained control over every single
3084 feature on a per-URL basis, and easy choosing from wholesale sets of defaults
3085 like <quote>Cautious</quote>, <quote>Medium</quote> or
3086 <quote>Advanced</quote>. Warning: the <quote>Advanced</quote> setting is more
3087 aggressive, and will be more likely to cause problems for some sites.
3088 Experienced users only!
3092 If you prefer plain text editing to GUIs, you can of course also directly edit the
3093 the actions files with your favorite text editor. Look at
3094 <filename>default.action</filename> which is richly commented with many
3100 <sect2 id="actions-apply">
3101 <title>How Actions are Applied to Requests</title>
3103 Actions files are divided into sections. There are special sections,
3104 like the <quote><link linkend="aliases">alias</link></quote> sections which will
3105 be discussed later. For now let's concentrate on regular sections: They have a
3106 heading line (often split up to multiple lines for readability) which consist
3107 of a list of actions, separated by whitespace and enclosed in curly braces.
3108 Below that, there is a list of URL and tag patterns, each on a separate line.
3112 To determine which actions apply to a request, the URL of the request is
3113 compared to all URL patterns in each <quote>action file</quote>.
3114 Every time it matches, the list of applicable actions for the request is
3115 incrementally updated, using the heading of the section in which the
3116 pattern is located. The same is done again for tags and tag patterns later on.
3120 If multiple applying sections set the same action differently,
3121 the last match wins. If not, the effects are aggregated.
3122 E.g. a URL might match a regular section with a heading line of <literal>{
3123 +<link linkend="handle-as-image">handle-as-image</link> }</literal>,
3124 then later another one with just <literal>{
3125 +<link linkend="block">block</link> }</literal>, resulting
3126 in <emphasis>both</emphasis> actions to apply. And there may well be
3127 cases where you will want to combine actions together. Such a section then
3133 { +<literal>handle-as-image</literal> +<literal>block{Banner ads.}</literal> }
3134 # Block these as if they were images. Send no block page.
3136 media.example.com/.*banners
3137 .example.com/images/ads/</screen>
3141 You can trace this process for URL patterns and any given URL by visiting <ulink
3142 url="http://config.privoxy.org/show-url-info">http://config.privoxy.org/show-url-info</ulink>.
3146 Examples and more detail on this is provided in the Appendix, <link linkend="ACTIONSANAT">
3147 Troubleshooting: Anatomy of an Action</link> section.
3151 <!-- ~~~~~ New section ~~~~~ -->
3152 <sect2 id="af-patterns">
3153 <title>Patterns</title>
3155 As mentioned, <application>Privoxy</application> uses <quote>patterns</quote>
3156 to determine what <emphasis>actions</emphasis> might apply to which sites and
3157 pages your browser attempts to access. These <quote>patterns</quote> use wild
3158 card type <emphasis>pattern</emphasis> matching to achieve a high degree of
3159 flexibility. This allows one expression to be expanded and potentially match
3160 against many similar patterns.
3164 Generally, an URL pattern has the form
3165 <literal><domain><port>/<path></literal>, where the
3166 <literal><domain></literal>, the <literal><port></literal>
3167 and the <literal><path></literal> are optional. (This is why the special
3168 <literal>/</literal> pattern matches all URLs). Note that the protocol
3169 portion of the URL pattern (e.g. <literal>http://</literal>) should
3170 <emphasis>not</emphasis> be included in the pattern. This is assumed already!
3173 The pattern matching syntax is different for the domain and path parts of
3174 the URL. The domain part uses a simple globbing type matching technique,
3175 while the path part uses more flexible
3176 <ulink url="http://en.wikipedia.org/wiki/Regular_expressions"><quote>Regular
3177 Expressions</quote></ulink> (POSIX 1003.2).
3180 The port part of a pattern is a decimal port number preceded by a colon
3181 (<literal>:</literal>). If the domain part contains a numerical IPv6 address,
3182 it has to be put into angle brackets
3183 (<literal><</literal>, <literal>></literal>).
3188 <term><literal>www.example.com/</literal></term>
3191 is a domain-only pattern and will match any request to <literal>www.example.com</literal>,
3192 regardless of which document on that server is requested. So ALL pages in
3193 this domain would be covered by the scope of this action. Note that a
3194 simple <literal>example.com</literal> is different and would NOT match.
3199 <term><literal>www.example.com</literal></term>
3202 means exactly the same. For domain-only patterns, the trailing <literal>/</literal> may
3208 <term><literal>www.example.com/index.html</literal></term>
3211 matches all the documents on <literal>www.example.com</literal>
3212 whose name starts with <literal>/index.html</literal>.
3217 <term><literal>www.example.com/index.html$</literal></term>
3220 matches only the single document <literal>/index.html</literal>
3221 on <literal>www.example.com</literal>.
3226 <term><literal>/index.html$</literal></term>
3229 matches the document <literal>/index.html</literal>, regardless of the domain,
3230 i.e. on <emphasis>any</emphasis> web server anywhere.
3235 <term><literal>/</literal></term>
3238 Matches any URL because there's no requirement for either the
3239 domain or the path to match anything.
3244 <term><literal>:8000/</literal></term>
3247 Matches any URL pointing to TCP port 8000.
3252 <term><literal><2001:db8::1>/</literal></term>
3255 Matches any URL with the host address <literal>2001:db8::1</literal>.
3256 (Note that the real URL uses plain brackets, not angle brackets.)
3261 <term><literal>index.html</literal></term>
3264 matches nothing, since it would be interpreted as a domain name and
3265 there is no top-level domain called <literal>.html</literal>. So its
3273 <!-- ~~~~~ New section ~~~~~ -->
3274 <sect3><title>The Domain Pattern</title>
3277 The matching of the domain part offers some flexible options: if the
3278 domain starts or ends with a dot, it becomes unanchored at that end.
3284 <term><literal>.example.com</literal></term>
3287 matches any domain with first-level domain <literal>com</literal>
3288 and second-level domain <literal>example</literal>.
3289 For example <literal>www.example.com</literal>,
3290 <literal>example.com</literal> and <literal>foo.bar.baz.example.com</literal>.
3291 Note that it wouldn't match if the second-level domain was <literal>another-example</literal>.
3296 <term><literal>www.</literal></term>
3299 matches any domain that <emphasis>STARTS</emphasis> with
3300 <literal>www.</literal> (It also matches the domain
3301 <literal>www</literal> but most of the time that doesn't matter.)
3306 <term><literal>.example.</literal></term>
3309 matches any domain that <emphasis>CONTAINS</emphasis> <literal>.example.</literal>.
3310 And, by the way, also included would be any files or documents that exist
3311 within that domain since no path limitations are specified. (Correctly
3312 speaking: It matches any FQDN that contains <literal>example</literal> as
3313 a domain.) This might be <literal>www.example.com</literal>,
3314 <literal>news.example.de</literal>, or
3315 <literal>www.example.net/cgi/testing.pl</literal> for instance. All these
3323 Additionally, there are wild-cards that you can use in the domain names
3324 themselves. These work similarly to shell globbing type wild-cards:
3325 <quote>*</quote> represents zero or more arbitrary characters (this is
3327 <ulink url="http://en.wikipedia.org/wiki/Regular_expressions"><quote>Regular
3328 Expression</quote></ulink> based syntax of <quote>.*</quote>),
3329 <quote>?</quote> represents any single character (this is equivalent to the
3330 regular expression syntax of a simple <quote>.</quote>), and you can define
3331 <quote>character classes</quote> in square brackets which is similar to
3332 the same regular expression technique. All of this can be freely mixed:
3337 <term><literal>ad*.example.com</literal></term>
3340 matches <quote>adserver.example.com</quote>,
3341 <quote>ads.example.com</quote>, etc but not <quote>sfads.example.com</quote>
3346 <term><literal>*ad*.example.com</literal></term>
3349 matches all of the above, and then some.
3354 <term><literal>.?pix.com</literal></term>
3357 matches <literal>www.ipix.com</literal>,
3358 <literal>pictures.epix.com</literal>, <literal>a.b.c.d.e.upix.com</literal> etc.
3363 <term><literal>www[1-9a-ez].example.c*</literal></term>
3366 matches <literal>www1.example.com</literal>,
3367 <literal>www4.example.cc</literal>, <literal>wwwd.example.cy</literal>,
3368 <literal>wwwz.example.com</literal> etc., but <emphasis>not</emphasis>
3369 <literal>wwww.example.com</literal>.
3376 While flexible, this is not the sophistication of full regular expression based syntax.
3381 <!-- ~ End section ~ -->
3384 <!-- ~~~~~ New section ~~~~~ -->
3385 <sect3><title>The Path Pattern</title>
3388 <application>Privoxy</application> uses <quote>modern</quote> POSIX 1003.2
3389 <ulink url="http://en.wikipedia.org/wiki/Regular_expressions"><quote>Regular
3390 Expressions</quote></ulink> for matching the path portion (after the slash),
3391 and is thus more flexible.
3395 There is an <link linkend="regex">Appendix</link> with a brief quick-start into regular
3396 expressions, you also might want to have a look at your operating system's documentation
3397 on regular expressions (try <literal>man re_format</literal>).
3401 Note that the path pattern is automatically left-anchored at the <quote>/</quote>,
3402 i.e. it matches as if it would start with a <quote>^</quote> (regular expression speak
3403 for the beginning of a line).
3407 Please also note that matching in the path is <emphasis>CASE INSENSITIVE</emphasis>
3408 by default, but you can switch to case sensitive at any point in the pattern by using the
3409 <quote>(?-i)</quote> switch: <literal>www.example.com/(?-i)PaTtErN.*</literal> will match
3410 only documents whose path starts with <literal>PaTtErN</literal> in
3411 <emphasis>exactly</emphasis> this capitalization.
3416 <term><literal>.example.com/.*</literal></term>
3419 Is equivalent to just <quote>.example.com</quote>, since any documents
3420 within that domain are matched with or without the <quote>.*</quote>
3421 regular expression. This is redundant
3426 <term><literal>.example.com/.*/index.html$</literal></term>
3429 Will match any page in the domain of <quote>example.com</quote> that is
3430 named <quote>index.html</quote>, and that is part of some path. For
3431 example, it matches <quote>www.example.com/testing/index.html</quote> but
3432 NOT <quote>www.example.com/index.html</quote> because the regular
3433 expression called for at least two <quote>/'s</quote>, thus the path
3434 requirement. It also would match
3435 <quote>www.example.com/testing/index_html</quote>, because of the
3436 special meta-character <quote>.</quote>.
3441 <term><literal>.example.com/(.*/)?index\.html$</literal></term>
3444 This regular expression is conditional so it will match any page
3445 named <quote>index.html</quote> regardless of path which in this case can
3446 have one or more <quote>/'s</quote>. And this one must contain exactly
3447 <quote>.html</quote> (but does not have to end with that!).
3452 <term><literal>.example.com/(.*/)(ads|banners?|junk)</literal></term>
3455 This regular expression will match any path of <quote>example.com</quote>
3456 that contains any of the words <quote>ads</quote>, <quote>banner</quote>,
3457 <quote>banners</quote> (because of the <quote>?</quote>) or <quote>junk</quote>.
3458 The path does not have to end in these words, just contain them.
3463 <term><literal>.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$</literal></term>
3466 This is very much the same as above, except now it must end in either
3467 <quote>.jpg</quote>, <quote>.jpeg</quote>, <quote>.gif</quote> or <quote>.png</quote>. So this
3468 one is limited to common image formats.
3475 There are many, many good examples to be found in <filename>default.action</filename>,
3476 and more tutorials below in <link linkend="regex">Appendix on regular expressions</link>.
3481 <!-- ~ End section ~ -->
3484 <!-- ~~~~~ New section ~~~~~ -->
3485 <sect3 id="tag-pattern"><title>The Tag Pattern</title>
3488 Tag patterns are used to change the applying actions based on the
3489 request's tags. Tags can be created with either the
3490 <link linkend="CLIENT-HEADER-TAGGER">client-header-tagger</link>
3491 or the <link linkend="SERVER-HEADER-TAGGER">server-header-tagger</link> action.
3495 Tag patterns have to start with <quote>TAG:</quote>, so &my-app;
3496 can tell them apart from URL patterns. Everything after the colon
3497 including white space, is interpreted as a regular expression with
3498 path pattern syntax, except that tag patterns aren't left-anchored
3499 automatically (&my-app; doesn't silently add a <quote>^</quote>,
3500 you have to do it yourself if you need it).
3504 To match all requests that are tagged with <quote>foo</quote>
3505 your pattern line should be <quote>TAG:^foo$</quote>,
3506 <quote>TAG:foo</quote> would work as well, but it would also
3507 match requests whose tags contain <quote>foo</quote> somewhere.
3508 <quote>TAG: foo</quote> wouldn't work as it requires white space.
3512 Sections can contain URL and tag patterns at the same time,
3513 but tag patterns are checked after the URL patterns and thus
3514 always overrule them, even if they are located before the URL patterns.
3518 Once a new tag is added, Privoxy checks right away if it's matched by one
3519 of the tag patterns and updates the action settings accordingly. As a result
3520 tags can be used to activate other tagger actions, as long as these other
3521 taggers look for headers that haven't already be parsed.
3525 For example you could tag client requests which use the
3526 <literal>POST</literal> method,
3527 then use this tag to activate another tagger that adds a tag if cookies
3528 are sent, and then use a block action based on the cookie tag. This allows
3529 the outcome of one action, to be input into a subsequent action. However if
3530 you'd reverse the position of the described taggers, and activated the
3531 method tagger based on the cookie tagger, no method tags would be created.
3532 The method tagger would look for the request line, but at the time
3533 the cookie tag is created, the request line has already been parsed.
3537 While this is a limitation you should be aware of, this kind of
3538 indirection is seldom needed anyway and even the example doesn't
3539 make too much sense.
3546 <!-- ~ End section ~ -->
3549 <!-- ~~~~~ New section ~~~~~ -->
3551 <sect2 id="actions">
3552 <title>Actions</title>
3554 All actions are disabled by default, until they are explicitly enabled
3555 somewhere in an actions file. Actions are turned on if preceded with a
3556 <quote>+</quote>, and turned off if preceded with a <quote>-</quote>. So a
3557 <literal>+action</literal> means <quote>do that action</quote>, e.g.
3558 <literal>+block</literal> means <quote>please block URLs that match the
3559 following patterns</quote>, and <literal>-block</literal> means <quote>don't
3560 block URLs that match the following patterns, even if <literal>+block</literal>
3561 previously applied.</quote>
3566 Again, actions are invoked by placing them on a line, enclosed in curly braces and
3567 separated by whitespace, like in
3568 <literal>{+some-action -some-other-action{some-parameter}}</literal>,
3569 followed by a list of URL patterns, one per line, to which they apply.
3570 Together, the actions line and the following pattern lines make up a section
3571 of the actions file.
3575 Actions fall into three categories:
3582 Boolean, i.e the action can only be <quote>enabled</quote> or
3583 <quote>disabled</quote>. Syntax:
3587 +<replaceable class="function">name</replaceable> # enable action <replaceable class="parameter">name</replaceable>
3588 -<replaceable class="function">name</replaceable> # disable action <replaceable class="parameter">name</replaceable></screen>
3591 Example: <literal>+handle-as-image</literal>
3598 Parameterized, where some value is required in order to enable this type of action.