13d088eae1ac364655824e7babcd70094ce576c1
[privoxy.git] / doc / text / user-manual.txt
1 Privoxy User Manual
2
3 By: Privoxy Developers
4
5 $Id: user-manual.sgml,v 1.92 2002/04/25 18:55:13 hal9 Exp $
6
7 The user manual gives users information on how to install, configure and use 
8 Privoxy.
9
10 Privoxy is a web proxy with advanced filtering capabilities for protecting
11 privacy, filtering web page content, managing cookies, controlling access, and
12 removing ads, banners, pop-ups and other obnoxious Internet junk. Privoxy has a
13 very flexible configuration and can be customized to suit individual needs and
14 tastes. Privoxy has application for both stand-alone systems and multi-user
15 networks.
16
17 Privoxy is based on Internet Junkbuster (tm).
18
19 You can find the latest version of the user manual at http://www.privoxy.org/
20 user-manual/. Please see the Contact section on how to contact the developers.
21
22 -------------------------------------------------------------------------------
23
24 Table of Contents
25  
26 1. Introduction
27    
28     1.1. New Features
29    
30 3. Installation
31    
32     3.1. Binary Packages
33        
34         3.1.1. Red Hat and SuSE RPMs
35         3.1.2. Debian
36         3.1.3. Windows
37         3.1.4. Solaris, NetBSD, FreeBSD, HP-UX
38         3.1.5. OS/2
39         3.1.6. Max OSX
40         3.1.7. AmigaOS
41        
42     3.2. Building from Source
43    
44 4. Quickstart to Using Privoxy
45    
46     4.1. Note to Upgraders
47     4.2. Starting Privoxy
48     4.3. Command Line Options
49    
50 5. Privoxy Configuration
51    
52     5.1. Controlling Privoxy with Your Web Browser
53     5.2. Configuration Files Overview
54     5.3. The Main Configuration File
55        
56         5.3.1. Configuration and Log File Locations
57         5.3.2. Local Set-up Documentation
58         5.3.3. Debugging
59         5.3.4. Access Control and Security
60         5.3.5. Forwarding
61         5.3.6. Windows GUI Options
62        
63     5.4. Actions Files
64        
65         5.4.1. Finding the Right Mix
66         5.4.2. How to Edit
67         5.4.3. How Actions are Applied to URLs
68         5.4.4. Patterns
69         5.4.5. Actions
70         5.4.6. Aliases
71        
72     5.5. The Filter File
73     5.6. Templates
74    
75 6. Contacting the Developers, Bug Reporting and Feature Requests
76    
77     6.1. Submitting Ads and "Action" Problems
78    
79 7. Copyright and History
80    
81     7.1. Copyright
82     7.2. History
83    
84 8. See Also
85 9. Appendix
86    
87     9.1. Regular Expressions
88     9.2. Privoxy's Internal Pages
89        
90         9.2.1. Bookmarklets
91        
92     9.3. Chain of Events
93     9.4. Anatomy of an Action
94    
95 -------------------------------------------------------------------------------
96
97 1. Introduction
98
99 This documentation is included with the current beta version of Privoxy,
100 v.2.9.14, and is mostly complete at this point. The most up to date reference
101 for the time being is still the comments in the source files and in the
102 individual configuration files. Development of version 3.0 is currently nearing
103 completion, and includes many significant changes and enhancements over earlier
104 versions. The target release date for stable v3.0 is "soon" ;-).
105
106 Since this is a beta version, not all new features are well tested. This
107 documentation may be slightly out of sync as a result (especially with CVS
108 sources). And there may be bugs, though hopefully not many!
109
110 -------------------------------------------------------------------------------
111
112 1.1. New Features
113
114 In addition to Internet Junkbuster's traditional features of ad and banner
115 blocking and cookie management, Privoxy provides new features, some of them
116 currently under development:
117
118   * Integrated browser based configuration and control utility at http://
119     config.privoxy.org/ (shortcut: http://p.p/). Browser-based tracing of rule
120     and filter effects. Remote toggling.
121    
122   * Blocking of annoying pop-up browser windows.
123    
124   * HTTP/1.1 compliant (but not all optional 1.1 features are supported).
125    
126   * Support for Perl Compatible Regular Expressions in the configuration files,
127     and generally a more sophisticated and flexible configuration syntax over
128     previous versions.
129    
130   * GIF de-animation.
131    
132   * Web page content filtering (removes banners based on size, invisible
133     "web-bugs", JavaScript and HTML annoyances, pop-ups, etc.)
134    
135   * Bypass many click-tracking scripts (avoids script redirection).
136    
137   * Multi-threaded (POSIX and native threads).
138    
139   * Auto-detection and re-reading of config file changes.
140    
141   * User-customizable HTML templates (e.g. 404 error page).
142    
143   * Improved cookie management features (e.g. session based cookies).
144    
145   * Improved signal handling, and a true daemon mode (Unix).
146    
147   * Builds from source on most UNIX-like systems. Packages available for: Linux
148     (RedHat, SuSE, or Debian), Windows, Sun Solaris, Mac OSX, OS/2, HP-UX 11,
149     NetBSD and AmigaOS.
150    
151   * Every feature now controllable on a per-site or per-location basis,
152     configuration more powerful and versatile over-all.
153    
154   * Many smaller new features added, limitations and bugs removed, and security
155     holes fixed.
156    
157 -------------------------------------------------------------------------------
158
159 3. Installation
160
161 Privoxy is available both in convenient pre-compiled packages for a wide range
162 of operating systems, and as raw source code. For most users, we recommend
163 using the packages, which can be downloaded from our Privoxy Project Page.
164
165 If you like to live on the bleeding edge and are not afraid of using possibly
166 unstable development versions, you can check out the up-to-the-minute version
167 directly from the CVS repository or simply download the nightly CVS tarball.
168
169 At present, Privoxy is known to run on Win32, Mac OSX, OS/2, AmigaOS, Linux
170 (RedHat, Suse, Debian), FreeBSD, NetBSD, BeOS, and many flavors of Unix.
171
172 -------------------------------------------------------------------------------
173
174 3.1. Binary Packages
175
176 Note: If you have a previous Junkbuster or Privoxy installation on your system,
177 you will need to remove it. Some platforms do this for you as part of their
178 installation procedure. (See below for your platform).
179
180 In any case be sure to backup your old configuration if it is valuable to you.
181 See the note to upgraders.
182
183 How to install the binary packages depends on your operating system:
184
185 -------------------------------------------------------------------------------
186
187 3.1.1. Red Hat and SuSE RPMs
188
189 RPMs can be installed with rpm -Uvh privoxy-2.9.14-1.rpm, and will use /etc/
190 privoxy for the location of configuration files.
191
192 Note that on Red Hat, Privoxy will not be automatically started on system boot.
193 You will need to enable that using chkconfig, ntsysv, or similar method.
194
195 If you have problems with failed dependencies, try rebuilding the SRC RPM: rpm
196 --rebuild privoxy-2.9.14-1.src.rpm;. This will use your locally installed
197 libraries and RPM version.
198
199 Also note that if you have a Junkbuster RPM installed on your system, you need
200 to remove it first, because the packages conflict. Otherwise, RPM will try to
201 remove Junkbuster automatically, before installing Privoxy.
202
203 -------------------------------------------------------------------------------
204
205 3.1.2. Debian
206
207 FIXME.
208
209 -------------------------------------------------------------------------------
210
211 3.1.3. Windows
212
213 Just double-click the installer, which will guide you through the installation
214 process.
215
216 -------------------------------------------------------------------------------
217
218 3.1.4. Solaris, NetBSD, FreeBSD, HP-UX
219
220 Create a new directory, cd to it, then unzip and untar the archive. For the
221 most part, you'll have to figure out where things go. FIXME.
222
223 -------------------------------------------------------------------------------
224
225 3.1.5. OS/2
226
227 First, make sure that no previous installations of Junkbuster and / or Privoxy
228 are left on your system. You can do this by
229
230 Then, just double-click the WarpIN self-installing archive, which will guide
231 you through the installation process. A shadow of the Privoxy executable will
232 be placed in your startup folder so it will start automatically whenever OS/2
233 starts.
234
235 The directory you choose to install Privoxy into will contain all of the
236 configuration files.
237
238 -------------------------------------------------------------------------------
239
240 3.1.6. Max OSX
241
242 Unzip the downloaded package (you can either double-click on the file in the
243 finder, or on the desktop if you downloaded it there). Then, double-click on
244 the package installer icon and follow the installation process. Privoxy will be
245 installed in the subdirectory /Applications/Privoxy.app. Privoxy will set
246 itself up to start automatically on system bring-up via /System/Library/
247 StartupItems/Privoxy.
248
249 -------------------------------------------------------------------------------
250
251 3.1.7. AmigaOS
252
253 Copy and then unpack the lha archive to a suitable location. All necessary
254 files will be installed into Privoxy directory, including all configuration and
255 log files. To uninstall, just remove this directory.
256
257 Start Privoxy (with RUN <>NIL:) in your startnet script (AmiTCP), in s:
258 user-startup (RoadShow), as startup program in your startup script (Genesis),
259 or as startup action (Miami and MiamiDx). Privoxy will automatically quit when
260 you quit your TCP/IP stack (just ignore the harmless warning your TCP/IP stack
261 may display that Privoxy is still running).
262
263 -------------------------------------------------------------------------------
264
265 3.2. Building from Source
266
267 To build Privoxy from source, autoheader, autoconf, GNU make (gmake), and, of
268 course, a C compiler are required.
269
270 When building from a source tarball (either release version or nightly CVS
271 tarball), first unpack the source:
272
273  tar xzvf privoxy-2.9.14-beta-src* [.tgz or .tar.gz]                           
274  cd privoxy-2.9.14-beta                                                        
275                                                                                
276
277 For retrieving the current CVS sources, you'll need CVS installed. Note that
278 sources from CVS are development quality, and may not be stable, or well
279 tested. To download CVS source:
280
281   cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login          
282   cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co current 
283   cd current                                                                         
284                                                                                      
285
286 This will create a directory named current/, which will contain the source
287 tree.
288
289 Then, in either case, to build from unpacked tarball or CVS source:
290
291  autoheader                                                                    
292  autoconf                                                                      
293  ./configure      # (--help to see options)                                    
294  make             # (the make from gnu, gmake for *BSD)                        
295  su                                                                            
296  make -n install  # (to see where all the files will go)                       
297  make install     # (to really install)                                        
298                                                                                
299
300 If you have gnu make, you can have the first four steps automatically done for
301 you by just typing:
302
303   make                                                                         
304                                                                                
305
306 in the freshly downloaded or unpacked source directory.
307
308 For more detailed instructions on how to build Redhat and SuSE RPMs, Windows
309 self-extracting installers, building on platforms with special requirements
310 etc, please consult the developer manual.
311
312 -------------------------------------------------------------------------------
313
314 4. Quickstart to Using Privoxy
315
316 4.1. Note to Upgraders
317
318 There are very significant changes from older versions of Junkbuster to the
319 current Privoxy. Configuration is substantially changed. Junkbuster 2.0.x and
320 earlier configuration files will not migrate. The functionality of the old
321 blockfile, cookiefile and imagelist, are now combined into the "actions files".
322 default.action, is the main actions file. Local exceptions should best be put
323 into user.action.
324
325 A "filter file" (typically default.filter) is new as of Privoxy 2.9.x, and
326 provides some of the new sophistication (explained below). config is much the
327 same as before.
328
329 If upgrading from a 2.0.x version, you will have to use the new config files,
330 and possibly adapt any personal rules from your older files. When porting
331 personal rules over from the old blockfile to the new actions files, please
332 note that even the pattern syntax has changed. If upgrading from 2.9.x
333 development versions, it is still recommended to use the new configuration
334 files.
335
336 A quick list of things to be aware of before upgrading:
337
338   * The default listening port is now 8118 due to a conflict with another
339     service (NAS).
340    
341   * Some installers may remove earlier versions completely. Save any important
342     configuration files!
343    
344   * Privoxy is controllable with a web browser at the special URL: http://
345     config.privoxy.org/ (Shortcut: http://p.p/). Many aspects of configuration
346     can be done here, including temporarily disabling Privoxy.
347    
348   * The primary configuration file for cookie management, ad and banner
349     blocking, and many other aspects of Privoxy configuration is in the
350     "actions" files. It is strongly recommended to become familiar with the new
351     actions concept below, before modifying these files. Locally defined rules
352     should go into user.action.
353    
354   * Some installers may not automatically start Privoxy after installation.
355    
356 -------------------------------------------------------------------------------
357
358 4.2. Starting Privoxy
359
360 Before launching Privoxy for the first time, you will want to configure your
361 browser(s) to use Privoxy as a HTTP and HTTPS proxy. The default is localhost
362 for the proxy address, and port 8118 (earlier versions used port 8000). This is
363 the one configuration step that must be done!
364
365 With Netscape (and Mozilla), this can be set under Edit -> Preferences ->
366 Advanced -> Proxies -> HTTP Proxy. For Internet Explorer: Tools -> Internet
367 Properties -> Connections -> LAN Setting. Then, check "Use Proxy" and fill in
368 the appropriate info (Address: localhost, Port: 8118). Include if HTTPS proxy
369 support too.
370
371 After doing this, flush your browser's disk and memory caches to force a
372 re-reading of all pages and to get rid of any ads that may be cached. You are
373 now ready to start enjoying the benefits of using Privoxy!
374
375 Privoxy is typically started by specifying the main configuration file to be
376 used on the command line. Example Unix startup command:
377
378                                                                                
379  # /usr/sbin/privoxy /etc/privoxy/config                                       
380                                                                                
381                                                                                
382
383 See below for other command line options.
384
385 An init script is provided for SuSE and Red Hat.
386
387 For for SuSE: rcprivoxy start
388
389 For Red Hat and Debian: /etc/rc.d/init.d/privoxy start
390
391 If no configuration file is specified on the command line, Privoxy will look
392 for a file named config in the current directory. Except on Win32 where it will
393 try config.txt. If no file is specified on the command line and no default
394 configuration file can be found, Privoxy will fail to start.
395
396 The included default configuration files should give a reasonable starting
397 point. Most of the per site configuration is done in the "actions" files. These
398 are where various cookie actions are defined, ad and banner blocking, and other
399 aspects of Privoxy configuration. There are several such files included, with
400 varying levels of aggressiveness.
401
402 You will probably want to keep an eye out for sites for which you may prefer
403 persistent cookies, and add these to your actions configuration as needed. By
404 default, most of these will be accepted only during the current browser session
405 (aka "session cookies"), unless you add them to the configuration. If you want
406 the browser to handle this instead, you will need to edit user.action (or
407 through the web based interface) and disable this feature. If you use more than
408 one browser, it would make more sense to let Privoxy handle this. In which
409 case, the browser(s) should be set to accept all cookies.
410
411 Another feature where you will probably want to define exceptions for trusted
412 sites is the popup-killing (through the +popup and +filter{popups} actions),
413 because your favorite shopping, banking, or leisure site may need popups
414 (explained below).
415
416 Privoxy is HTTP/1.1 compliant, but not all of the optional 1.1 features are as
417 yet supported. In the unlikely event that you experience inexplicable problems
418 with browsers that use HTTP/1.1 per default (like Mozilla or recent versions of
419 I.E.), you might try to force HTTP/1.0 compatibility. For Mozilla, look under
420 Edit -> Preferences -> Debug -> Networking. Alternatively, set the
421 "+downgrade-http-version" config option in default.action which will downgrade
422 your browser's HTTP requests from HTTP/1.1 to HTTP/1.0 before processing them.
423
424 After running Privoxy for a while, you can start to fine tune the configuration
425 to suit your personal, or site, preferences and requirements. There are many,
426 many aspects that can be customized. "Actions" can be adjusted by pointing your
427 browser to http://config.privoxy.org/ (shortcut: http://p.p/), and then follow
428 the link to "View & Change the Current Configuration". (This is an internal
429 page and does not require Internet access.)
430
431 In fact, various aspects of Privoxy configuration can be viewed from this page,
432 including current configuration parameters, source code version numbers, the
433 browser's request headers, and "actions" that apply to a given URL. In addition
434 to the actions file editor mentioned above, Privoxy can also be turned "on" and
435 "off" (toggled) from this page.
436
437 If you encounter problems, try loading the page without Privoxy. If that helps,
438 enter the URL where you have the problems into the browser based rule tracing
439 utility. See which rules apply and why, and then try turning them off for that
440 site one after the other, until the problem is gone. When you have found the
441 culprit, you might want to turn the rest on again.
442
443 If the above paragraph sounds gibberish to you, you might want to read more
444 about the actions concept or even dive deep into the Appendix on actions.
445
446 If you can't get rid of the problem at all, think you've found a bug in
447 Privoxy, want to propose a new feature or smarter rules, please see the section
448 "Contacting the Developers" below.
449
450 -------------------------------------------------------------------------------
451
452 4.3. Command Line Options
453
454 Privoxy may be invoked with the following command-line options:
455
456   * --version
457    
458     Print version info and exit. Unix only.
459    
460   * --help
461    
462     Print short usage info and exit. Unix only.
463    
464   * --no-daemon
465    
466     Don't become a daemon, i.e. don't fork and become process group leader, and
467     don't detach from controlling tty. Unix only.
468    
469   * --pidfile FILE
470    
471     On startup, write the process ID to FILE. Delete the FILE on exit. Failure
472     to create or delete the FILE is non-fatal. If no FILE option is given, no
473     PID file will be used. Unix only.
474    
475   * --user USER[.GROUP]
476    
477     After (optionally) writing the PID file, assume the user ID of USER, and if
478     included the GID of GROUP. Exit if the privileges are not sufficient to do
479     so. Unix only.
480    
481   * configfile
482    
483     If no configfile is included on the command line, Privoxy will look for a
484     file named "config" in the current directory (except on Win32 where it will
485     look for "config.txt" instead). Specify full path to avoid confusion. If no
486     config file is found, Privoxy will fail to start.
487    
488 -------------------------------------------------------------------------------
489
490 5. Privoxy Configuration
491
492 All Privoxy configuration is stored in text files. These files can be edited
493 with a text editor. Many important aspects of Privoxy can also be controlled
494 easily with a web browser.
495
496 -------------------------------------------------------------------------------
497
498 5.1. Controlling Privoxy with Your Web Browser
499
500 Privoxy's user interface can be reached through the special URL http://
501 config.privoxy.org/ (shortcut: http://p.p/), which is a built-in page and works
502 without Internet access. You will see the following section: 
503
504  Privoxy Menu                                                                  
505         ?  View & change the current configuration                             
506         ?  View the source code version numbers                                
507         ?  View the request headers.                                           
508         ?  Look up which actions apply to a URL and why                        
509         ?  Toggle Privoxy on or off                                            
510                                                                                
511
512 This should be self-explanatory. Note the first item leads to an editor for the
513 "actions list", which is where the ad, banner, cookie, and URL blocking magic
514 is configured as well as other advanced features of Privoxy. This is an easy
515 way to adjust various aspects of Privoxy configuration. The actions file, and
516 other configuration files, are explained in detail below.
517
518 "Toggle Privoxy On or Off" is handy for sites that might have problems with
519 your current actions and filters. You can in fact use it as a test to see
520 whether it is Privoxy causing the problem or not. Privoxy continues to run as a
521 proxy in this case, but all filtering is disabled. There is even a toggle 
522 Bookmarklet offered, so that you can toggle Privoxy with one click from your
523 browser.
524
525 -------------------------------------------------------------------------------
526
527 5.2. Configuration Files Overview
528
529 For Unix, *BSD and Linux, all configuration files are located in /etc/privoxy/
530 by default. For MS Windows, OS/2, and AmigaOS these are all in the same
531 directory as the Privoxy executable. The name and number of configuration files
532 has changed from previous versions, and is subject to change as development
533 progresses.
534
535 The installed defaults provide a reasonable starting point, though some
536 settings may be aggressive by some standards. For the time being, the principle
537 configuration files are:
538
539   * The main configuration file is named config on Linux, Unix, BSD, OS/2, and
540     AmigaOS and config.txt on Windows. This is a required file.
541    
542   * default.action (the main actions file) is used to define the default
543     settings for various "actions" relating to images, banners, pop-ups, access
544     restrictions, banners and cookies.
545    
546     Multiple actions files may be defined in config. These are processed in the
547     order they are defined. Local customizations and locally preferred
548     exceptions to the default policies as defined in default.action are
549     probably best applied in user.action, which should be preserved across
550     upgrades. standard.action is also included. This is mostly for Privoxy's
551     internal use.
552    
553     There is also a web based editor that can be accessed from http://
554     config.privoxy.org/show-status/ (Shortcut: http://p.p/show-status/) for the
555     various actions files.
556    
557   * default.filter (the filter file) can be used to re-write the raw page
558     content, including viewable text as well as embedded HTML and JavaScript,
559     and whatever else lurks on any given web page. The filtering jobs are only
560     pre-defined here; whether to apply them or not is up to the actions files.
561    
562 All files use the "#" character to denote a comment (the rest of the line will
563 be ignored) and understand line continuation through placing a backslash ("\")
564 as the very last character in a line. If the # is preceded by a backslash, it
565 looses its special function. Placing a # in front of an otherwise valid
566 configuration line to prevent it from being interpreted is called "commenting
567 out" that line.
568
569 The actions files and default.filter can use Perl style regular expressions for
570 maximum flexibility.
571
572 After making any changes, there is no need to restart Privoxy in order for the
573 changes to take effect. Privoxy detects such changes automatically. Note,
574 however, that it may take one or two additional requests for the change to take
575 effect. When changing the listening address of Privoxy, these "wake up"
576 requests must obviously be sent to the old listening address.
577
578 While under development, the configuration content is subject to change. The
579 below documentation may not be accurate by the time you read this. Also, what
580 constitutes a "default" setting, may change, so please check all your
581 configuration files on important issues.
582
583 -------------------------------------------------------------------------------
584
585 5.3. The Main Configuration File
586
587 Again, the main configuration file is named config on Linux/Unix/BSD and OS/2,
588 and config.txt on Windows. Configuration lines consist of an initial keyword
589 followed by a list of values, all separated by whitespace (any number of spaces
590 or tabs). For example:
591
592   confdir /etc/privoxy
593    
594
595 Assigns the value /etc/privoxy to the option confdir and thus indicates that
596 the configuration directory is named "/etc/privoxy/".
597
598 All options in the config file except for confdir and logdir are optional.
599 Watch out in the below description for what happens if you leave them unset.
600
601 The main config file controls all aspects of Privoxy's operation that are not
602 location dependent (i.e. they apply universally, no matter where you may be
603 surfing).
604
605 -------------------------------------------------------------------------------
606
607 5.3.1. Configuration and Log File Locations
608
609 Privoxy can (and normally does) use a number of other files for additional
610 configuration and logging. This section of the configuration file tells Privoxy
611 where to find those other files.
612
613 -------------------------------------------------------------------------------
614
615 5.3.1.1. confdir
616
617 Specifies:
618    
619     The directory where the other configuration files are located
620    
621 Type of value:
622    
623     Path name
624    
625 Default value:
626    
627     /etc/privoxy (Unix) or Privoxy installation dir (Windows)
628    
629 Effect if unset:
630    
631     Mandatory
632    
633 Notes:
634    
635     No trailing "/", please
636    
637     When development goes modular and multi-user, the blocker, filter, and
638     per-user config will be stored in subdirectories of "confdir". For now, the
639     configuration directory structure is flat, except for confdir/templates,
640     where the HTML templates for CGI output reside (e.g. Privoxy's 404 error
641     page).
642    
643 -------------------------------------------------------------------------------
644
645 5.3.1.2. logdir
646
647 Specifies:
648    
649     The directory where all logging takes place (i.e. where logfile and jarfile
650     are located)
651    
652 Type of value:
653    
654     Path name
655    
656 Default value:
657    
658     /var/log/privoxy (Unix) or Privoxy installation dir (Windows)
659    
660 Effect if unset:
661    
662     Mandatory
663    
664 Notes:
665    
666     No trailing "/", please
667    
668 -------------------------------------------------------------------------------
669
670 5.3.1.3. actionsfile
671
672 Specifies:
673    
674     The actions file(s) to use
675    
676 Type of value:
677    
678     File name, relative to confdir
679    
680 Default value:
681    
682       standard     # Internal purposes, recommended not editing
683                                                                
684       default      # Main actions file                         
685                                                                
686       user         # User customizations                       
687    
688 Effect if unset:
689    
690     No actions are taken at all. Simple neutral proxying.
691    
692 Notes:
693    
694     Multiple actionsfile lines are OK and are in fact recommended!
695    
696     The default values include standard.action, which is used for internal
697     purposes and should be loaded, default.action, which is the "main" actions
698     file maintained by the developers, and user.action, where you can make your
699     personal additions.
700    
701     There is no point in using Privoxy without an actions file.
702    
703 -------------------------------------------------------------------------------
704
705 5.3.1.4. filterfile
706
707 Specifies:
708    
709     The filter file to use
710    
711 Type of value:
712    
713     File name, relative to confdir
714    
715 Default value:
716    
717     default.filter (Unix) or default.filter.txt (Windows)
718    
719 Effect if unset:
720    
721     No textual content filtering takes place, i.e. all +filter{name} actions in
722     the actions files are turned off
723    
724 Notes:
725    
726     The "default.filter" file contains content modification rules that use
727     "regular expressions". These rules permit powerful changes on the content
728     of Web pages, e.g., you could disable your favorite JavaScript annoyances,
729     re-write the actual displayed text, or just have some fun replacing
730     "Microsoft" with "MicroSuck" wherever it appears on a Web page.
731    
732 -------------------------------------------------------------------------------
733
734 5.3.1.5. logfile
735
736 Specifies:
737    
738     The log file to use
739    
740 Type of value:
741    
742     File name, relative to logdir
743    
744 Default value:
745    
746     logfile (Unix) or privoxy.log (Windows)
747    
748 Effect if unset:
749    
750     No log file is used, all log messages go to the console (stderr).
751    
752 Notes:
753    
754     The windows version will additionally log to the console.
755    
756     The logfile is where all logging and error messages are written. The level
757     of detail and number of messages are set with the debug option (see below).
758     The logfile can be useful for tracking down a problem with Privoxy (e.g.,
759     it's not blocking an ad you think it should block) but in most cases you
760     probably will never look at it.
761    
762     Your logfile will grow indefinitely, and you will probably want to
763     periodically remove it. On Unix systems, you can do this with a cron job
764     (see "man cron"). For Red Hat, a logrotate script has been included.
765    
766     On SuSE Linux systems, you can place a line like "/var/log/privoxy.* +1024k
767     644 nobody.nogroup" in /etc/logfiles, with the effect that cron.daily will
768     automatically archive, gzip, and empty the log, when it exceeds 1M size.
769    
770 -------------------------------------------------------------------------------
771
772 5.3.1.6. jarfile
773
774 Specifies:
775    
776     The file to store intercepted cookies in
777    
778 Type of value:
779    
780     File name, relative to logdir
781    
782 Default value:
783    
784     jarfile (Unix) or privoxy.jar (Windows)
785    
786 Effect if unset:
787    
788     Intercepted cookies are not stored at all.
789    
790 Notes:
791    
792     The jarfile may grow to ridiculous sizes over time.
793    
794 -------------------------------------------------------------------------------
795
796 5.3.1.7. trustfile
797
798 Specifies:
799    
800     The trust file to use
801    
802 Type of value:
803    
804     File name, relative to confdir
805    
806 Default value:
807    
808     Unset (commented out). When activated: trust (Unix) or trust.txt (Windows)
809    
810 Effect if unset:
811    
812     The whole trust mechanism is turned off.
813    
814 Notes:
815    
816     The trust mechanism is an experimental feature for building white-lists and
817     should be used with care. It is NOT recommended for the casual user.
818    
819     If you specify a trust file, Privoxy will only allow access to sites that
820     are named in the trustfile. You can also mark sites as trusted referrers
821     (with +), with the effect that access to untrusted sites will be granted,
822     if a link from a trusted referrer was used. The link target will then be
823     added to the "trustfile". Possible applications include limiting Internet
824     access for children.
825    
826     If you use + operator in the trust file, it may grow considerably over
827     time.
828    
829 -------------------------------------------------------------------------------
830
831 5.3.2. Local Set-up Documentation
832
833 If you intend to operate Privoxy for more users that just yourself, it might be
834 a good idea to let them know how to reach you, what you block and why you do
835 that, your policies etc.
836
837 -------------------------------------------------------------------------------
838
839 5.3.2.1. trust-info-url
840
841 Specifies:
842    
843     A URL to be displayed in the error page that users will see if access to an
844     untrusted page is denied.
845    
846 Type of value:
847    
848     URL
849    
850 Default value:
851    
852     Two example URL are provided
853    
854 Effect if unset:
855    
856     No links are displayed on the "untrusted" error page.
857    
858 Notes:
859    
860     The value of this option only matters if the experimental trust mechanism
861     has been activated. (See trustfile above.)
862    
863     If you use the trust mechanism, it is a good idea to write up some on-line
864     documentation about your trust policy and to specify the URL(s) here. Use
865     multiple times for multiple URLs.
866    
867     The URL(s) should be added to the trustfile as well, so users don't end up
868     locked out from the information on why they were locked out in the first
869     place!
870    
871 -------------------------------------------------------------------------------
872
873 5.3.2.2. admin-address
874
875 Specifies:
876    
877     An email address to reach the proxy administrator.
878    
879 Type of value:
880    
881     Email address
882    
883 Default value:
884    
885     Unset
886    
887 Effect if unset:
888    
889     No email address is displayed on error pages and the CGI user interface.
890    
891 Notes:
892    
893     If both admin-address and proxy-info-url are unset, the whole "Local
894     Privoxy Support" box on all generated pages will not be shown.
895    
896 -------------------------------------------------------------------------------
897
898 5.3.2.3. proxy-info-url
899
900 Specifies:
901    
902     A URL to documentation about the local Privoxy setup, configuration or
903     policies.
904    
905 Type of value:
906    
907     URL
908    
909 Default value:
910    
911     Unset
912    
913 Effect if unset:
914    
915     No link to local documentation is displayed on error pages and the CGI user
916     interface.
917    
918 Notes:
919    
920     If both admin-address and proxy-info-url are unset, the whole "Local
921     Privoxy Support" box on all generated pages will not be shown.
922    
923     This URL shouldn't be blocked ;-)
924    
925 -------------------------------------------------------------------------------
926
927 5.3.3. Debugging
928
929 These options are mainly useful when tracing a problem. Note that you might
930 also want to invoke Privoxy with the --no-daemon command line option when
931 debugging.
932
933 -------------------------------------------------------------------------------
934
935 5.3.3.1. debug
936
937 Specifies:
938    
939     Key values that determine what information gets logged.
940    
941 Type of value:
942    
943     Integer values
944    
945 Default value:
946    
947     12289 (i.e.: URLs plus informational and warning messages)
948    
949 Effect if unset:
950    
951     Nothing gets logged.
952    
953 Notes:
954    
955     The available debug levels are:
956    
957       debug         1 # show each GET/POST/CONNECT request             
958       debug         2 # show each connection status                    
959       debug         4 # show I/O status                                
960       debug         8 # show header parsing                            
961       debug        16 # log all data into the logfile                  
962       debug        32 # debug force feature                            
963       debug        64 # debug regular expression filter                
964       debug       128 # debug fast redirects                           
965       debug       256 # debug GIF de-animation                         
966       debug       512 # Common Log Format                              
967       debug      1024 # debug kill pop-ups                             
968       debug      4096 # Startup banner and warnings.                   
969       debug      8192 # Non-fatal errors                               
970                                                                        
971    
972     To select multiple debug levels, you can either add them or use multiple
973     debug lines.
974    
975     A debug level of 1 is informative because it will show you each request as
976     it happens. 1, 4096 and 8192 are highly recommended so that you will notice
977     when things go wrong. The other levels are probably only of interest if you
978     are hunting down a specific problem. They can produce a hell of an output
979     (especially 16).
980    
981     The reporting of fatal errors (i.e. ones which crash Privoxy) is always on
982     and cannot be disabled.
983    
984     If you want to use CLF (Common Log Format), you should set "debug 512" ONLY
985     and not enable anything else.
986    
987 -------------------------------------------------------------------------------
988
989 5.3.3.2. single-threaded
990
991 Specifies:
992    
993     Whether to run only one server thread
994    
995 Type of value:
996    
997     None
998    
999 Default value:
1000    
1001     Unset
1002    
1003 Effect if unset:
1004    
1005     Multi-threaded (or, where unavailable: forked) operation, i.e. the ability
1006     to serve multiple requests simultaneously.
1007    
1008 Notes:
1009    
1010     This option is only there for debug purposes and you should never need to
1011     use it. It will drastically reduce performance.
1012    
1013 -------------------------------------------------------------------------------
1014
1015 5.3.4. Access Control and Security
1016
1017 This section of the config file controls the security-relevant aspects of
1018 Privoxy's configuration.
1019
1020 -------------------------------------------------------------------------------
1021
1022 5.3.4.1. listen-address
1023
1024 Specifies:
1025    
1026     The IP address and TCP port on which Privoxy will listen for client
1027     requests.
1028    
1029 Type of value:
1030    
1031     [IP-Address]:Port
1032    
1033 Default value:
1034    
1035     localhost:8118
1036    
1037 Effect if unset:
1038    
1039     Bind to localhost (127.0.0.1), port 8118. This is suitable and recommended
1040     for home users who run Privoxy on the same machine as their browser.
1041    
1042 Notes:
1043    
1044     You will need to configure your browser(s) to this proxy address and port.
1045    
1046     If you already have another service running on port 8118, or if you want to
1047     serve requests from other machines (e.g. on your local network) as well,
1048     you will need to override the default.
1049    
1050     If you leave out the IP address, Privoxy will bind to all interfaces
1051     (addresses) on your machine and may become reachable from the Internet. In
1052     that case, consider using access control lists (ACL's) (see "ACLs" below),
1053     or a firewall.
1054    
1055 Example:
1056    
1057     Suppose you are running Privoxy on a machine which has the address
1058     192.168.0.1 on your local private network (192.168.0.0) and has another
1059     outside connection with a different address. You want it to serve requests
1060     from inside only:
1061    
1062       listen-address  192.168.0.1:8118                                 
1063                                                                        
1064    
1065 -------------------------------------------------------------------------------
1066
1067 5.3.4.2. toggle
1068
1069 Specifies:
1070    
1071     Initial state of "toggle" status
1072    
1073 Type of value:
1074    
1075     1 or 0
1076    
1077 Default value:
1078    
1079     1
1080    
1081 Effect if unset:
1082    
1083     Act as if toggled on
1084    
1085 Notes:
1086    
1087     If set to 0, Privoxy will start in "toggled off" mode, i.e. behave like a
1088     normal, content-neutral proxy. See enable-remote-toggle below. This is not
1089     really useful anymore, since toggling is much easier via the web interface
1090     then via editing the conf file.
1091    
1092     The windows version will only display the toggle icon in the system tray if
1093     this option is present.
1094    
1095 -------------------------------------------------------------------------------
1096
1097 5.3.4.3. enable-remote-toggle
1098
1099 Specifies:
1100    
1101     Whether or not the web-based toggle feature may be used
1102    
1103 Type of value:
1104    
1105     0 or 1
1106    
1107 Default value:
1108    
1109     1
1110    
1111 Effect if unset:
1112    
1113     The web-based toggle feature is disabled.
1114    
1115 Notes:
1116    
1117     When toggled off, Privoxy acts like a normal, content-neutral proxy, i.e.
1118     it acts as if none of the actions applied to any URL.
1119    
1120     For the time being, access to the toggle feature can not be controlled
1121     separately by "ACLs" or HTTP authentication, so that everybody who can
1122     access Privoxy (see "ACLs" and listen-address above) can toggle it for all
1123     users. So this option is not recommended for multi-user environments with
1124     untrusted users.
1125    
1126     Note that you must have compiled Privoxy with support for this feature,
1127     otherwise this option has no effect.
1128    
1129 -------------------------------------------------------------------------------
1130
1131 5.3.4.4. enable-edit-actions
1132
1133 Specifies:
1134    
1135     Whether or not the web-based actions file editor may be used
1136    
1137 Type of value:
1138    
1139     0 or 1
1140    
1141 Default value:
1142    
1143     1
1144    
1145 Effect if unset:
1146    
1147     The web-based actions file editor is disabled.
1148    
1149 Notes:
1150    
1151     For the time being, access to the editor can not be controlled separately
1152     by "ACLs" or HTTP authentication, so that everybody who can access Privoxy
1153     (see "ACLs" and listen-address above) can modify its configuration for all
1154     users. So this option is not recommended for multi-user environments with
1155     untrusted users.
1156    
1157     Note that you must have compiled Privoxy with support for this feature,
1158     otherwise this option has no effect.
1159    
1160 -------------------------------------------------------------------------------
1161
1162 5.3.4.5. ACLs: permit-access and deny-access
1163
1164 Specifies:
1165    
1166     Who can access what.
1167    
1168 Type of value:
1169    
1170     src_addr[/src_masklen] [dst_addr[/dst_masklen]]
1171    
1172     Where src_addr and dst_addr are IP addresses in dotted decimal notation or
1173     valid DNS names, and src_masklen and dst_masklen are subnet masks in CIDR
1174     notation, i.e. integer values from 2 to 30 representing the length (in
1175     bits) of the network address. The masks and the whole destination part are
1176     optional.
1177    
1178 Default value:
1179    
1180     Unset
1181    
1182 Effect if unset:
1183    
1184     Don't restrict access further than implied by listen-address
1185    
1186 Notes:
1187    
1188     Access controls are included at the request of ISPs and systems
1189     administrators, and are not usually needed by individual users. For a
1190     typical home user, it will normally suffice to ensure that Privoxy only
1191     listens on the localhost or internal (home) network address by means of the
1192     listen-address option.
1193    
1194     Please see the warnings in the FAQ that this proxy is not intended to be a
1195     substitute for a firewall or to encourage anyone to defer addressing basic
1196     security weaknesses.
1197    
1198     Multiple ACL lines are OK. If any ACLs are specified, then the Privoxy
1199     talks only to IP addresses that match at least one permit-access line and
1200     don't match any subsequent deny-access line. In other words, the last match
1201     wins, with the default being deny-access.
1202    
1203     If Privoxy is using a forwarder (see forward below) for a particular
1204     destination URL, the dst_addr that is examined is the address of the
1205     forwarder and NOT the address of the ultimate target. This is necessary
1206     because it may be impossible for the local Privoxy to determine the IP
1207     address of the ultimate target (that's often what gateways are used for).
1208    
1209     You should prefer using IP addresses over DNS names, because the address
1210     lookups take time. All DNS names must resolve! You can not use domain
1211     patterns like "*.org" or partial domain names. If a DNS name resolves to
1212     multiple IP addresses, only the first one is used.
1213    
1214     Denying access to particular sites by ACL may have undesired side effects
1215     if the site in question is hosted on a machine which also hosts other
1216     sites.
1217    
1218 Examples:
1219    
1220     Explicitly define the default behavior if no ACL and listen-address are
1221     set: "localhost" is OK. The absence of a dst_addr implies that all
1222     destination addresses are OK:
1223    
1224       permit-access  localhost                                         
1225                                                                        
1226    
1227     Allow any host on the same class C subnet as www.privoxy.org access to
1228     nothing but www.example.com:
1229    
1230       permit-access  www.privoxy.org/24 www.example.com/32             
1231                                                                        
1232    
1233     Allow access from any host on the 26-bit subnet 192.168.45.64 to anywhere,
1234     with the exception that 192.168.45.73 may not access
1235     www.dirty-stuff.example.com:
1236    
1237       permit-access  192.168.45.64/26                                  
1238       deny-access    192.168.45.73    www.dirty-stuff.example.com      
1239                                                                        
1240    
1241 -------------------------------------------------------------------------------
1242
1243 5.3.4.6. buffer-limit
1244
1245 Specifies:
1246    
1247     Maximum size of the buffer for content filtering.
1248    
1249 Type of value:
1250    
1251     Size in Kbytes
1252    
1253 Default value:
1254    
1255     4096
1256    
1257 Effect if unset:
1258    
1259     Use a 4MB (4096 KB) limit.
1260    
1261 Notes:
1262    
1263     For content filtering, i.e. the +filter and +deanimate-gif actions, it is
1264     necessary that Privoxy buffers the entire document body. This can be
1265     potentially dangerous, since a server could just keep sending data
1266     indefinitely and wait for your RAM to exhaust -- with nasty consequences.
1267     Hence this option.
1268    
1269     When a document buffer size reaches the buffer-limit, it is flushed to the
1270     client unfiltered and no further attempt to filter the rest of the document
1271     is made. Remember that there may be multiple threads running, which might
1272     require up to buffer-limit Kbytes each, unless you have enabled
1273     "single-threaded" above.
1274    
1275 -------------------------------------------------------------------------------
1276
1277 5.3.5. Forwarding
1278
1279 This feature allows routing of HTTP requests through a chain of multiple
1280 proxies. It can be used to better protect privacy and confidentiality when
1281 accessing specific domains by routing requests to those domains through an
1282 anonymous public proxy (see e.g. http://www.multiproxy.org/anon_list.htm) Or to
1283 use a caching proxy to speed up browsing. Or chaining to a parent proxy may be
1284 necessary because the machine that Privoxy runs on has no direct Internet
1285 access.
1286
1287 Also specified here are SOCKS proxies. Privoxy supports the SOCKS 4 and SOCKS
1288 4A protocols.
1289
1290 -------------------------------------------------------------------------------
1291
1292 5.3.5.1. forward
1293
1294 Specifies:
1295    
1296     To which parent HTTP proxy specific requests should be routed.
1297    
1298 Type of value:
1299    
1300     target_domain[:port] http_parent[/port]
1301    
1302     Where target_domain is a domain name pattern (see the chapter on domain
1303     matching in the default.action file), http_parent is the address of the
1304     parent HTTP proxy as an IP addresses in dotted decimal notation or as a
1305     valid DNS name (or "." to denote "no forwarding", and the optional port
1306     parameters are TCP ports, i.e. integer values from 1 to 64535
1307    
1308 Default value:
1309    
1310     Unset
1311    
1312 Effect if unset:
1313    
1314     Don't use parent HTTP proxies.
1315    
1316 Notes:
1317    
1318     If http_parent is ".", then requests are not forwarded to another HTTP
1319     proxy but are made directly to the web servers.
1320    
1321     Multiple lines are OK, they are checked in sequence, and the last match
1322     wins.
1323    
1324 Examples:
1325    
1326     Everything goes to an example anonymizing proxy, except SSL on port 443
1327     (which it doesn't handle):
1328    
1329       forward   .*     anon-proxy.example.org:8080                     
1330       forward   :443   .                                               
1331                                                                        
1332    
1333     Everything goes to our example ISP's caching proxy, except for requests to
1334     that ISP's sites:
1335    
1336       forward   .*.                caching-proxy.example-isp.net:8000  
1337       forward   .example-isp.net   .                                   
1338                                                                        
1339    
1340 -------------------------------------------------------------------------------
1341
1342 5.3.5.2. forward-socks4 and forward-socks4a
1343
1344 Specifies:
1345    
1346     Through which SOCKS proxy (and to which parent HTTP proxy) specific
1347     requests should be routed.
1348    
1349 Type of value:
1350    
1351     target_domain[:port] socks_proxy[/port] http_parent[/port]
1352    
1353     Where target_domain is a domain name pattern (see the chapter on domain
1354     matching in the default.action file), http_parent and socks_proxy are IP
1355     addresses in dotted decimal notation or valid DNS names (http_parent may be
1356     "." to denote "no HTTP forwarding"), and the optional port parameters are
1357     TCP ports, i.e. integer values from 1 to 64535
1358    
1359 Default value:
1360    
1361     Unset
1362    
1363 Effect if unset:
1364    
1365     Don't use SOCKS proxies.
1366    
1367 Notes:
1368    
1369     Multiple lines are OK, they are checked in sequence, and the last match
1370     wins.
1371    
1372     The difference between forward-socks4 and forward-socks4a is that in the
1373     SOCKS 4A protocol, the DNS resolution of the target hostname happens on the
1374     SOCKS server, while in SOCKS 4 it happens locally.
1375    
1376     If http_parent is ".", then requests are not forwarded to another HTTP
1377     proxy but are made (HTTP-wise) directly to the web servers, albeit through
1378     a SOCKS proxy.
1379    
1380 Examples:
1381    
1382     From the company example.com, direct connections are made to all "internal"
1383     domains, but everything outbound goes through their ISP's proxy by way of
1384     example.com's corporate SOCKS 4A gateway to the Internet.
1385    
1386       forward-socks4a   .*.            socks-gw.example.com:1080  www-cache.example-isp.net:8080 
1387       forward           .example.com   .                                                         
1388                                                                                                  
1389    
1390     A rule that uses a SOCKS 4 gateway for all destinations but no HTTP parent
1391     looks like this:
1392    
1393       forward-socks4   .*.            socks-gw.example.com:1080  .     
1394                                                                        
1395    
1396 -------------------------------------------------------------------------------
1397
1398 5.3.5.3. Advanced Forwarding Examples
1399
1400 If you have links to multiple ISPs that provide various special content only to
1401 their subscribers, you can configure multiple Privoxies which have connections
1402 to the respective ISPs to act as forwarders to each other, so that your users
1403 can see the internal content of all ISPs.
1404
1405 Assume that host-a has a PPP connection to isp-a.net. And host-b has a PPP
1406 connection to isp-b.net. Both run Privoxy. Their forwarding configuration can
1407 look like this:
1408
1409 host-a:
1410
1411   forward    .*.         .                                                     
1412   forward    .isp-b.net  host-b:8118                                           
1413                                                                                
1414
1415 host-b:
1416
1417   forward    .*.         .                                                     
1418   forward    .isp-a.net  host-a:8118                                           
1419                                                                                
1420
1421 Now, your users can set their browser's proxy to use either host-a or host-b
1422 and be able to browse the internal content of both isp-a and isp-b.
1423
1424 If you intend to chain Privoxy and squid locally, then chain as browser ->
1425 squid -> privoxy is the recommended way.
1426
1427 Assuming that Privoxy and squid run on the same box, your squid configuration
1428 could then look like this:
1429
1430   # Define Privoxy as parent proxy (without ICP)                               
1431   cache_peer 127.0.0.1 parent 8118 7 no-query                                  
1432                                                                                
1433   # Define ACL for protocol FTP                                                
1434   acl ftp proto FTP                                                            
1435                                                                                
1436   # Do not forward FTP requests to Privoxy                                     
1437   always_direct allow ftp                                                      
1438                                                                                
1439   # Forward all the rest to Privoxy                                            
1440   never_direct allow all                                                       
1441                                                                                
1442
1443 You would then need to change your browser's proxy settings to squid's address
1444 and port. Squid normally uses port 3128. If unsure consult http_port in
1445 squid.conf.
1446
1447 -------------------------------------------------------------------------------
1448
1449 5.3.6. Windows GUI Options
1450
1451 Privoxy has a number of options specific to the Windows GUI interface:
1452
1453 If "activity-animation" is set to 1, the Privoxy icon will animate when
1454 "Privoxy" is active. To turn off, set to 0.
1455
1456   activity-animation 1
1457    
1458
1459 If "log-messages" is set to 1, Privoxy will log messages to the console window:
1460
1461   log-messages 1
1462    
1463
1464 If "log-buffer-size" is set to 1, the size of the log buffer, i.e. the amount
1465 of memory used for the log messages displayed in the console window, will be
1466 limited to "log-max-lines" (see below).
1467
1468 Warning: Setting this to 0 will result in the buffer to grow infinitely and eat
1469 up all your memory!
1470
1471   log-buffer-size 1
1472    
1473
1474 log-max-lines is the maximum number of lines held in the log buffer. See above.
1475
1476   log-max-lines 200
1477    
1478
1479 If "log-highlight-messages" is set to 1, Privoxy will highlight portions of the
1480 log messages with a bold-faced font:
1481
1482   log-highlight-messages 1
1483    
1484
1485 The font used in the console window:
1486
1487   log-font-name Comic Sans MS
1488    
1489
1490 Font size used in the console window:
1491
1492   log-font-size 8
1493    
1494
1495 "show-on-task-bar" controls whether or not Privoxy will appear as a button on
1496 the Task bar when minimized:
1497
1498   show-on-task-bar 0
1499    
1500
1501 If "close-button-minimizes" is set to 1, the Windows close button will minimize
1502 Privoxy instead of closing the program (close with the exit option on the File
1503 menu).
1504
1505   close-button-minimizes 1
1506    
1507
1508 The "hide-console" option is specific to the MS-Win console version of Privoxy.
1509 If this option is used, Privoxy will disconnect from and hide the command
1510 console.
1511
1512   #hide-console
1513    
1514
1515 -------------------------------------------------------------------------------
1516
1517 5.4. Actions Files
1518
1519 The actions files are used to define what actions Privoxy takes for which URLs,
1520 and thus determines how ad images, cookies and various other aspects of HTTP
1521 content and transactions are handled, and on which sites (or even parts
1522 thereof). There are three such files included with Privoxy, with slightly
1523 different purposes. default.action sets the default policies. standard.action
1524 is used by Privoxy and the web based editor to set pre-defined values (and
1525 normally should not be edited). Local exceptions are best done in user.action.
1526 The content of these can all be viewed and edited from http://
1527 config.privoxy.org/show-status.
1528
1529 Anything you want can blocked, including ads, banners, or just some obnoxious
1530 URL that you would rather not see is done here. Cookies can be accepted or
1531 rejected, or accepted only during the current browser session (i.e. not written
1532 to disk), content can be modified, JavaScripts tamed, user-tracking fooled, and
1533 much more. See below for a complete list of available actions.
1534
1535 An actions file typically has sections. Near the top, "aliases" are optionally
1536 defined (discussed below), then the default set of rules which will apply
1537 universally to all sites and pages. And then below that, exceptions to the
1538 defined universal policies.
1539
1540 -------------------------------------------------------------------------------
1541
1542 5.4.1. Finding the Right Mix
1543
1544 Note that some actions like cookie suppression or script disabling may render
1545 some sites unusable, which rely on these techniques to work properly. Finding
1546 the right mix of actions is not easy and certainly a matter of personal taste.
1547 In general, it can be said that the more "aggressive" your default settings (in
1548 the top section of the actions file) are, the more exceptions for "trusted"
1549 sites you will have to make later. If, for example, you want to kill popup
1550 windows per default, you'll have to make exceptions from that rule for sites
1551 that you regularly use and that require popups for actually useful content,
1552 like maybe your bank, favorite shop, or newspaper.
1553
1554 We have tried to provide you with reasonable rules to start from in the
1555 distribution actions files. But there is no general rule of thumb on these
1556 things. There just are too many variables, and sites are constantly changing.
1557 Sooner or later you will want to change the rules (and read this chapter again
1558 :).
1559
1560 -------------------------------------------------------------------------------
1561
1562 5.4.2. How to Edit
1563
1564 The easiest way to edit the "actions" files is with a browser by using our
1565 browser-based editor, which can be reached from http://config.privoxy.org/
1566 show-status.
1567
1568 If you prefer plain text editing to GUIs, you can of course also directly edit
1569 the the actions files.
1570
1571 -------------------------------------------------------------------------------
1572
1573 5.4.3. How Actions are Applied to URLs
1574
1575 Actions files are divided into sections. There are special sections, like the "
1576 alias" sections which will be discussed later. For now let's concentrate on
1577 regular sections: They have a heading line (often split up to multiple lines
1578 for readability) which consist of a list of actions, separated by whitespace
1579 and enclosed in curly braces. Below that, there is a list of URL patterns, each
1580 on a separate line.
1581
1582 To determine which actions apply to a request, the URL of the request is
1583 compared to all patterns in this file. Every time it matches, the list of
1584 applicable actions for the URL is incrementally updated, using the heading of
1585 the section in which the pattern is located. If multiple matches for the same
1586 URL set the same action differently, the last match wins. If not, the effects
1587 are aggregated (e.g. a URL might match both the "+handle-as-image" and "+block"
1588 actions).
1589
1590 You can trace this process by visiting http://config.privoxy.org/show-url-info.
1591
1592 More detail on this is provided in the Appendix, Anatomy of an Action.
1593
1594 -------------------------------------------------------------------------------
1595
1596 5.4.4. Patterns
1597
1598 Generally, a pattern has the form <domain>/<path>, where both the <domain> and
1599 <path> are optional. (This is why the pattern / matches all URLs).
1600
1601 www.example.com/
1602    
1603     is a domain-only pattern and will match any request to www.example.com,
1604     regardless of which document on that server is requested.
1605    
1606 www.example.com
1607    
1608     means exactly the same. For domain-only patterns, the trailing / may be
1609     omitted.
1610    
1611 www.example.com/index.html
1612    
1613     matches only the single document /index.html on www.example.com.
1614    
1615 /index.html
1616    
1617     matches the document /index.html, regardless of the domain, i.e. on any web
1618     server.
1619    
1620 index.html
1621    
1622     matches nothing, since it would be interpreted as a domain name and there
1623     is no top-level domain called .html.
1624    
1625 -------------------------------------------------------------------------------
1626
1627 5.4.4.1. The Domain Pattern
1628
1629 The matching of the domain part offers some flexible options: if the domain
1630 starts or ends with a dot, it becomes unanchored at that end. For example:
1631
1632 .example.com
1633    
1634     matches any domain that ENDS in .example.com
1635    
1636 www.
1637    
1638     matches any domain that STARTS with www.
1639    
1640 .example.
1641    
1642     matches any domain that CONTAINS .example. (Correctly speaking: It matches
1643     any FQDN that contains example as a domain.)
1644    
1645 Additionally, there are wild-cards that you can use in the domain names
1646 themselves. They work pretty similar to shell wild-cards: "*" stands for zero
1647 or more arbitrary characters, "?" stands for any single character, you can
1648 define character classes in square brackets and all of that can be freely
1649 mixed:
1650
1651 ad*.example.com
1652    
1653     matches "adserver.example.com", "ads.example.com", etc but not
1654     "sfads.example.com"
1655    
1656 *ad*.example.com
1657    
1658     matches all of the above, and then some.
1659    
1660 .?pix.com
1661    
1662     matches www.ipix.com, pictures.epix.com, a.b.c.d.e.upix.com etc.
1663    
1664 www[1-9a-ez].example.c*
1665    
1666     matches www1.example.com, www4.example.cc, wwwd.example.cy,
1667     wwwz.example.com etc., but not wwww.example.com.
1668    
1669 -------------------------------------------------------------------------------
1670
1671 5.4.4.2. The Path Pattern
1672
1673 Privoxy uses Perl compatible regular expressions (through the PCRE library) for
1674 matching the path.
1675
1676 There is an Appendix with a brief quick-start into regular expressions, and
1677 full (very technical) documentation on PCRE regex syntax is available on-line
1678 at http://www.pcre.org/man.txt. You might also find the Perl man page on
1679 regular expressions (man perlre) useful, which is available on-line at http://
1680 www.perldoc.com/perl5.6/pod/perlre.html.
1681
1682 Note that the path pattern is automatically left-anchored at the "/", i.e. it
1683 matches as if it would start with a "^" (regular expression speak for the
1684 beginning of a line).
1685
1686 Please also note that matching in the path is case INSENSITIVE by default, but
1687 you can switch to case sensitive at any point in the pattern by using the "(?
1688 -i)" switch: www.example.com/(?-i)PaTtErN.* will match only documents whose
1689 path starts with PaTtErN in exactly this capitalization.
1690
1691 -------------------------------------------------------------------------------
1692
1693 5.4.5. Actions
1694
1695 All actions are disabled by default, until they are explicitly enabled
1696 somewhere in an actions file. Actions are turned on if preceded with a "+", and
1697 turned off if preceded with a "-". So a "+action" means "do that action", e.g.
1698 "+block" means please "block the following URL patterns".
1699
1700 Actions are invoked by enclosing the action name in curly braces (e.g.
1701 {+some_action}), followed by a list of URLs (or patterns that match URLs) to
1702 which the action applies. There are three classes of actions:
1703
1704   * Boolean, i.e the action can only be "on" or "off". Examples:
1705    
1706       {+name}        # enable this action
1707       {-name}        # disable this action
1708          
1709    
1710   * Parameterized, e.g. "+/-hide-user-agent{ Mozilla 1.0 }", where some value
1711     is required in order to enable this type of action. Examples:
1712    
1713       {+name{param}}  # enable action and set parameter to "param"
1714       {-name}         # disable action ("parameter") can be omitted
1715          
1716    
1717   * Multi-value, e.g. "{+/-add-header{Name: value}}" or "{+/-send-wafer{name=
1718     value}}"), where some value needs to be defined in addition to simply
1719     enabling the action. Examples:
1720    
1721       {+name{param=value}}   # enable action and set "param" to "value"
1722       {-name{param=value}}   # remove the parameter "param" completely
1723       {-name}                # disable this action totally and remove param too
1724          
1725    
1726 If nothing is specified in any actions file, no "actions" are taken. So in this
1727 case Privoxy would just be a normal, non-blocking, non-anonymizing proxy. You
1728 must specifically enable the privacy and blocking features you need (although
1729 the provided default actions files will give a good starting point).
1730
1731 Later defined actions always over-ride earlier ones. So exceptions to any rules
1732 you make, should come in the latter part of the file. For multi-valued actions,
1733 the actions are applied in the order they are specified. Actions files are
1734 processed in the order they are defined in config (the default installation has
1735 three actions files). It also quite possible for any given URL pattern to match
1736 more than one action!
1737
1738 The list of valid Privoxy "actions" are:
1739
1740 -------------------------------------------------------------------------------
1741
1742 5.4.5.1. +add-header{Name: value}
1743
1744 Type:
1745    
1746     Multi-value.
1747    
1748 Typical uses:
1749    
1750     Send a user defined HTTP header to the web server.
1751    
1752 Possible values:
1753    
1754     Any value is possible. Validity of the defined HTTP headers is not checked.
1755    
1756 Example usage:
1757    
1758          {+add-header{X-User-Tracking: sucks}}
1759          .example.com
1760         
1761    
1762 Notes:
1763    
1764     This action may be specified multiple times, in order to define multiple
1765     headers. This is rarely needed for the typical user. If you don't know what
1766     "HTTP headers" are, you definitely don't need to worry about this one.
1767    
1768 -------------------------------------------------------------------------------
1769
1770 5.4.5.2. +block
1771
1772 Type:
1773    
1774     Boolean.
1775    
1776 Typical uses:
1777    
1778     Used to block a URL from reaching your browser. The URL may be anything,
1779     but is typically used to block ads or other obnoxious content.
1780    
1781 Possible values:
1782    
1783     N/A
1784    
1785 Example usage:
1786    
1787          {+block}
1788          .banners.example.com
1789          .ads.r.us
1790         
1791    
1792 Notes:
1793    
1794     If a URL matches one of the blocked patterns, Privoxy will intercept the
1795     URL and display its special "BLOCKED" page instead. If there is sufficient
1796     space, a large red banner will appear with a friendly message about why the
1797     page was blocked, and a way to go there anyway. If there is insufficient
1798     space a smaller blocked page will appear without the red banner. Click here
1799     to view the default blocked HTML page (Privoxy must be running for this to
1800     work as intended!).
1801    
1802     A very important exception is if the URL matches both "+block" and 
1803     "+handle-as-image", then it will be handled by "+set-image-blocker" (see
1804     below). It is important to understand this process, in order to understand
1805     how Privoxy is able to deal with ads and other objectionable content.
1806    
1807     The "+filter" action can also perform some of the same functionality as
1808     "+block", but by virtue of very different programming techniques, and is
1809     most often used for different reasons.
1810    
1811 -------------------------------------------------------------------------------
1812
1813 5.4.5.3. +deanimate-gifs
1814
1815 Type:
1816    
1817     Parameterized.
1818    
1819 Typical uses:
1820    
1821     To stop those annoying, distracting animated GIF images.
1822    
1823 Possible values:
1824    
1825     "last" or "first"
1826    
1827 Example usage:
1828    
1829           {+deanimate-gifs{last}}
1830           .example.com
1831         
1832    
1833 Notes:
1834    
1835     De-animate all animated GIF images, i.e. reduce them to their last frame.
1836     This will also shrink the images considerably (in bytes, not pixels!). If
1837     the option "first" is given, the first frame of the animation is used as
1838     the replacement. If "last" is given, the last frame of the animation is
1839     used instead, which probably makes more sense for most banner animations,
1840     but also has the risk of not showing the entire last frame (if it is only a
1841     delta to an earlier frame).
1842    
1843 -------------------------------------------------------------------------------
1844
1845 5.4.5.4. +downgrade-http-version
1846
1847 Type:
1848    
1849     Boolean.
1850    
1851 Typical uses:
1852    
1853     "+downgrade-http-version" will downgrade HTTP/1.1 client requests to HTTP/
1854     1.0 and downgrade the responses as well.
1855    
1856 Possible values:
1857    
1858     N/A
1859    
1860 Example usage:
1861    
1862          {+downgrade-http-version}
1863          .example.com
1864         
1865    
1866 Notes:
1867    
1868     Use this action for servers that use HTTP/1.1 protocol features that
1869     Privoxy doesn't handle well yet. HTTP/1.1 is only partially implemented.
1870     Default is not to downgrade requests. This is an infrequently needed
1871     action, and is used to help with rare problem sites only.
1872    
1873 -------------------------------------------------------------------------------
1874
1875 5.4.5.5. +fast-redirects
1876
1877 Type:
1878    
1879     Boolean.
1880    
1881 Typical uses:
1882    
1883     The "+fast-redirects" action enables interception of "redirect" requests
1884     from one server to another, which are used to track users.Privoxy can cut
1885     off all but the last valid URL in a redirect request and send a local
1886     redirect back to your browser without contacting the intermediate site(s).
1887    
1888 Possible values:
1889    
1890     N/A
1891    
1892 Example usage:
1893    
1894          {+fast-redirects}
1895          .example.com
1896         
1897    
1898 Notes:
1899    
1900     Many sites, like yahoo.com, don't just link to other sites. Instead, they
1901     will link to some script on their own server, giving the destination as a
1902     parameter, which will then redirect you to the final target. URLs resulting
1903     from this scheme typically look like: http://some.place/some_script?http://
1904     some.where-else.
1905    
1906     Sometimes, there are even multiple consecutive redirects encoded in the
1907     URL. These redirections via scripts make your web browsing more traceable,
1908     since the server from which you follow such a link can see where you go to.
1909     Apart from that, valuable bandwidth and time is wasted, while your browser
1910     ask the server for one redirect after the other. Plus, it feeds the
1911     advertisers.
1912    
1913     This is a normally "on" feature, and often requires exceptions for sites
1914     that are sensitive to defeating this mechanism.
1915    
1916 -------------------------------------------------------------------------------
1917
1918 5.4.5.6. +filter
1919
1920 Type:
1921    
1922     Parameterized.
1923    
1924 Typical uses:
1925    
1926     Apply page filtering as defined by named sections of the default.filter
1927     file to the specified site(s). "Filtering" can be any modification of the
1928     raw page content, including re-writing or deletion of content.
1929    
1930 Possible values:
1931    
1932     "+filter" must include the name of one of the section identifiers from
1933     default.filter (or whatever filterfile is specified in config).
1934    
1935 Example usage (from the current default.filter):
1936    
1937     +filter{html-annoyances}: Get rid of particularly annoying HTML abuse.
1938    
1939     +filter{js-annoyances}: Get rid of particularly annoying JavaScript abuse
1940    
1941     +filter{content-cookies}: Kill cookies that come in the HTML or JS content
1942    
1943     +filter{popups}: Kill all popups in JS and HTML
1944    
1945     +filter{frameset-borders}: Give frames a border and make them resizable
1946    
1947     +filter{webbugs}: Squish WebBugs (1x1 invisible GIFs used for user         
1948     tracking)                                                                  
1949    
1950     +filter{refresh-tags}: Kill automatic refresh tags (for dial-on-demand     
1951     setups)                                                                    
1952    
1953     +filter{fun}: Text replacements for subversive browsing fun!
1954    
1955     +filter{nimda}: Remove Nimda (virus) code.
1956    
1957     +filter{banners-by-size}: Kill banners by size (very efficient!)
1958    
1959     +filter{shockwave-flash}: Kill embedded Shockwave Flash objects
1960    
1961     +filter{crude-parental}: Kill all web pages that contain the words "sex" or
1962     "warez"                                                                    
1963    
1964 Notes:
1965    
1966     This is potentially a very powerful feature! And requires a knowledge of
1967     regular expressions if you want to "roll your own". Filtering operates on a
1968     line by line basis throughout the entire page.
1969    
1970     Filtering requires buffering the page content, which may appear to slow
1971     down page rendering since nothing is displayed until all content has passed
1972     the filters. (It does not really take longer, but seems that way since the
1973     page is not incrementally displayed.) This effect will be more noticeable
1974     on slower connections.
1975    
1976     Filtering can achieve some of the effects as the "+block" action, i.e. it
1977     can be used to block ads and banners. In the overall scheme of things,
1978     filtering is one of the first things "Privoxy" does with a web page. So
1979     other most other actions are applied to the already "filtered" page.
1980    
1981 -------------------------------------------------------------------------------
1982
1983 5.4.5.7. +hide-forwarded-for-headers
1984
1985 Type:
1986    
1987     Boolean.
1988    
1989 Typical uses:
1990    
1991     Block any existing X-Forwarded-for HTTP header, and do not add a new one.
1992    
1993 Possible values:
1994    
1995     N/A
1996    
1997 Example usage:
1998    
1999          {+hide-forwarded-for-headers}
2000          .example.com
2001         
2002    
2003 Notes:
2004    
2005     It is fairly safe to leave this on. It does not seem to break many sites.
2006    
2007 -------------------------------------------------------------------------------
2008
2009 5.4.5.8. +hide-from-header
2010
2011 Type:
2012    
2013     Parameterized.
2014    
2015 Typical uses:
2016    
2017     To block the browser from sending your email address in a "From:" header.
2018    
2019 Possible values:
2020    
2021     Keyword: "block", or any user defined value.
2022    
2023 Example usage:
2024    
2025          {+hide-from-header{block}}
2026          .example.com
2027         
2028    
2029 Notes:
2030    
2031     The keyword "block" will completely remove the header (not to be confused
2032     with the "+block" action). Alternately, you can specify any value you
2033     prefer to send to the web server.
2034    
2035 -------------------------------------------------------------------------------
2036
2037 5.4.5.9. +hide-referer
2038
2039 Type:
2040    
2041     Parameterized.
2042    
2043 Typical uses:
2044    
2045     Don't send the "Referer:" (sic) HTTP header to the web site. Or,
2046     alternately send a forged header instead.
2047    
2048 Possible values:
2049    
2050     Prevent the header from being sent with the keyword, "block". Or, "forge" a
2051     URL to one from the same server as the request. Or, set to user defined
2052     value of your choice.
2053    
2054 Example usage:
2055    
2056          {+hide-referer{forge}}
2057          .example.com
2058         
2059    
2060 Notes:
2061    
2062     "forge" is the preferred option here, since some servers will not send
2063     images back otherwise.
2064    
2065     "+hide-referrer" is an alternate spelling of "+hide-referer". It has the
2066     exact same parameters, and can be freely mixed with, "+hide-referer".
2067     ("referrer" is the correct English spelling, however the HTTP specification
2068     has a bug - it requires it to be spelled as "referer".)
2069    
2070 -------------------------------------------------------------------------------
2071
2072 5.4.5.10. +hide-user-agent
2073
2074 Type:
2075    
2076     Parameterized.
2077    
2078 Typical uses:
2079    
2080     To change the "User-Agent:" header so web servers can't tell your browser
2081     type. Who's business is it anyway?
2082    
2083 Possible values:
2084    
2085     Any user defined string.
2086    
2087 Example usage:
2088    
2089          {+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}}
2090          .msn.com
2091         
2092    
2093 Notes:
2094    
2095     Warning! This breaks many web sites that depend on this in order to
2096     determine how the target browser will respond to various requests. Use with
2097     caution.
2098    
2099 -------------------------------------------------------------------------------
2100
2101 5.4.5.11. +handle-as-image
2102
2103 Type:
2104    
2105     Boolean.
2106    
2107 Typical uses:
2108    
2109     To define what Privoxy should treat automatically as an image, and is an
2110     important ingredient of how ads are handled.
2111    
2112 Possible values:
2113    
2114     N/A
2115    
2116 Example usage:
2117    
2118          {+handle-as-image}
2119          /.*\.(gif|jpg|jpeg|png|bmp|ico)
2120         
2121    
2122 Notes:
2123    
2124     This only has meaning if the URL (or pattern) also is "+block"ed, in which
2125     case a user definable image can be sent rather than a HTML page. This is
2126     integral to the whole concept of ad blocking: the URL must match both a 
2127     "+block" rule, and "+handle-as-image". (See "+set-image-blocker" below for
2128     control over what will actually be displayed by the browser.)
2129    
2130     There is little reason to change the default definition for this action.
2131    
2132 -------------------------------------------------------------------------------
2133
2134 5.4.5.12. +set-image-blocker
2135
2136 Type:
2137    
2138     Parameterized.
2139    
2140 Typical uses:
2141    
2142     Decide what to do with URLs that end up tagged with both "+block" and 
2143     "+handle-as-image", e.g an advertisement.
2144    
2145 Possible values:
2146    
2147     There are four available options: "-set-image-blocker" will send a HTML
2148     "blocked" page, usually resulting in a "broken image" icon.
2149     "+set-image-blocker{blank}" will send a 1x1 transparent GIF image.
2150     "+set-image-blocker{pattern}" will send a checkerboard type pattern (the
2151     default). And finally, "+set-image-blocker{http://xyz.com}" will send a
2152     HTTP temporary redirect to the specified image. This has the advantage of
2153     the icon being being cached by the browser, which will speed up the
2154     display.
2155    
2156 Example usage:
2157    
2158          {+set-image-blocker{blank}}
2159          .example.com
2160         
2161    
2162 Notes:
2163    
2164     If you want invisible ads, they need to meet criteria as matching both
2165     images and blocked actions. And then, "image-blocker" should be set to
2166     "blank" for invisibility. Note you cannot treat HTML pages as images in
2167     most cases. For instance, frames require an HTML page to display. So a
2168     frame that is an ad, typically cannot be treated as an image. Forcing an
2169     "image" in this situation just will not work reliably.
2170    
2171 -------------------------------------------------------------------------------
2172
2173 5.4.5.13. +limit-connect
2174
2175 Type:
2176    
2177     Parameterized.
2178    
2179 Typical uses:
2180    
2181     By default, Privoxy only allows HTTP CONNECT requests to port 443 (the
2182     standard, secure HTTPS port). Use "+limit-connect" to disable this
2183     altogether, or to allow more ports.
2184    
2185 Possible values:
2186    
2187     Any valid port number, or port number range.
2188    
2189 Example usages:
2190    
2191          +limit-connect{443}                       #
2192      This is the default and need not be specified.
2193          +limit-connect{80,443}                  # Ports 80 and 443 are OK.
2194          +limit-connect{-3, 7, 20-100, 500-}   #
2195      Port less than 3, 7, 20 to 100 and above 500 are OK.
2196         
2197    
2198 Notes:
2199    
2200     The CONNECT methods exists in HTTP to allow access to secure websites
2201     (https:// URLs) through proxies. It works very simply: the proxy connects
2202     to the server on the specified port, and then short-circuits its
2203     connections to the client and to the remote proxy. This can be a big
2204     security hole, since CONNECT-enabled proxies can be abused as TCP relays
2205     very easily.
2206    
2207     If you want to allow CONNECT for more ports than this, or want to forbid
2208     CONNECT altogether, you can specify a comma separated list of ports and
2209     port ranges (the latter using dashes, with the minimum defaulting to 0 and
2210     max to 65K).
2211    
2212     If you don't know what any of this means, there probably is no reason to
2213     change this one.
2214    
2215 -------------------------------------------------------------------------------
2216
2217 5.4.5.14. +prevent-compression
2218
2219 Type:
2220    
2221     Boolean.
2222    
2223 Typical uses:
2224    
2225     Prevent the specified websites from compressing HTTP data.
2226    
2227 Possible values:
2228    
2229     N/A
2230    
2231 Example usage:
2232    
2233          {+prevent-compression}
2234          .example.com
2235         
2236    
2237 Notes:
2238    
2239     Some websites do this, which can be a problem for Privoxy, since "+filter",
2240     "+kill-popups" and "+gif-deanimate" will not work on compressed data. This
2241     will slow down connections to those websites, though. Default typically is
2242     to turn "prevent-compression" on.
2243    
2244 -------------------------------------------------------------------------------
2245
2246 5.4.5.15. +session-cookies-only
2247
2248 Type:
2249    
2250     Boolean.
2251    
2252 Typical uses:
2253    
2254     Allow cookies for the current browser session only.
2255    
2256 Possible values:
2257    
2258     N/A
2259    
2260 Example usage (disabling):
2261    
2262          {-session-cookies-only}
2263          .example.com
2264         
2265    
2266 Notes:
2267    
2268     If websites set cookies, "+session-cookies-only" will make sure they are
2269     erased when you exit and restart your web browser. This makes profiling
2270     cookies useless, but won't break sites which require cookies so that you
2271     can log in for transactions. This is generally turned on for all sites, and
2272     is the recommended setting.
2273    
2274     "+prevent-*-cookies" actions should be turned off as well (see below), for
2275     "+session-cookies-only" to work. Or, else no cookies will get through at
2276     all. For, "persistent" cookies that survive across browser sessions, see
2277     below as well.
2278    
2279 -------------------------------------------------------------------------------
2280
2281 5.4.5.16. +prevent-reading-cookies
2282
2283 Type:
2284    
2285     Boolean.
2286    
2287 Typical uses:
2288    
2289     Explicitly prevent the web server from reading any cookies on your system.
2290    
2291 Possible values:
2292    
2293     N/A
2294    
2295 Example usage:
2296    
2297          {+prevent-reading-cookies}
2298          .example.com
2299         
2300    
2301 Notes:
2302    
2303     Often used in conjunction with "+prevent-setting-cookies" to disable
2304     cookies completely. Note that "+session-cookies-only" requires these to
2305     both be disabled (or else it never gets any cookies to cache).
2306    
2307     For "persistent" cookies to work (i.e. they survive across browser sessions
2308     and reboots), all three cookie settings should be "off" for the specified
2309     sites.
2310    
2311 -------------------------------------------------------------------------------
2312
2313 5.4.5.17. +prevent-setting-cookies
2314
2315 Type:
2316    
2317     Boolean.
2318    
2319 Typical uses:
2320    
2321     Explicitly block the web server from storing cookies on your system.
2322    
2323 Possible values:
2324    
2325     N/A
2326    
2327 Example usage:
2328    
2329          {+prevent-setting-cookies}
2330          .example.com
2331         
2332    
2333 Notes:
2334    
2335     Often used in conjunction with "+prevent-reading-cookies" to disable
2336     cookies completely (see above).
2337    
2338 -------------------------------------------------------------------------------
2339
2340 5.4.5.18. +kill-popups
2341
2342 Type:
2343    
2344     Boolean.
2345    
2346 Typical uses:
2347    
2348     Stop those annoying JavaScript pop-up windows!
2349    
2350 Possible values:
2351    
2352     N/A
2353    
2354 Example usage:
2355    
2356          {+kill-popups}
2357          .example.com
2358         
2359    
2360 Notes:
2361    
2362     "+kill-popups" uses a built in filter to disable pop-ups that use the
2363     window.open() function, etc. This is one of the first actions processed by
2364     Privoxy as it contacts the remote web server. This action is not always
2365     100% reliable, and is supplemented by "+filter{popups}".
2366    
2367 -------------------------------------------------------------------------------
2368
2369 5.4.5.19. +send-vanilla-wafer
2370
2371 Type:
2372    
2373     Boolean.
2374    
2375 Typical uses:
2376    
2377     Sends a cookie for every site stating that you do not accept any copyright
2378     on cookies sent to you, and asking them not to track you.
2379    
2380 Possible values:
2381    
2382     N/A
2383    
2384 Example usage:
2385    
2386          {+send-vanilla-wafer}
2387          .example.com
2388         
2389    
2390 Notes:
2391    
2392     This action only applies if you are using a jarfile for saving cookies. Of
2393     course, this is a (relatively) unique header and could conceivably be used
2394     to track you.
2395    
2396 -------------------------------------------------------------------------------
2397
2398 5.4.5.20. +send-wafer
2399
2400 Type:
2401    
2402     Multi-value.
2403    
2404 Typical uses:
2405    
2406     This allows you to send an arbitrary, user definable cookie.
2407    
2408 Possible values:
2409    
2410     User specified cookie name and corresponding value.
2411    
2412 Example usage:
2413    
2414          {+send-wafer{name=value}}
2415          .example.com
2416         
2417    
2418 Notes:
2419    
2420     This can be specified multiple times in order to add as many cookies as you
2421     like.
2422    
2423 -------------------------------------------------------------------------------
2424
2425 5.4.5.21. Actions Examples
2426
2427 Note that the meaning of any of the above examples is reversed by preceding the
2428 action with a "-", in place of the "+". Also, that some actions are turned on
2429 in the default section of the actions file, and require little to no additional
2430 configuration. These are just "on". But, other actions that are turned on the
2431 default section do typically require exceptions to be listed in the lower
2432 sections of actions file. E.g. by default no URLs are "blocked" (i.e. in the
2433 default definitions of default.action). We need exceptions to this in order to
2434 enable ad blocking.
2435
2436 Some examples:
2437
2438 Turn off cookies by default, then allow a few through for specified sites
2439 (showing an excerpt from the "default" section of an actions file ONLY):
2440
2441  # Excerpt only:
2442  # Allow cookies to and from the server, but
2443  # for this browser session ONLY
2444  { 
2445    # other actions normally listed here...
2446    -prevent-setting-cookies \
2447    -prevent-reading-cookies \
2448    +session-cookies-only   \  
2449  }
2450  / # match all URLs
2451
2452  # Exceptions to the above, sites that benefit from persistent cookies
2453  # that are saved from one browser session to the next.
2454  { -session-cookies-only }
2455   .javasoft.com
2456   .sun.com
2457   .yahoo.com
2458   .msdn.microsoft.com
2459   .redhat.com
2460
2461    
2462
2463 Now turn off "fast redirects", and then we allow two exceptions:
2464
2465  # Turn them off (excerpt only)!
2466  {
2467   # other actions normally listed here...
2468   +fast-redirects
2469  }
2470  / # match all URLs
2471  
2472  # Reverse it for these two sites, which don't work right without it.
2473  {-fast-redirects}
2474   www.ukc.ac.uk/cgi-bin/wac\.cgi\?
2475   login.yahoo.com
2476    
2477
2478 Turn on page filtering according to rules in the defined sections of
2479 default.filter, and make one exception for Sourceforge:
2480
2481  # Run everything through the filter file, using only certain
2482  # specified sections:
2483  {
2484   # other actions normally listed here...
2485   +filter{html-annoyances} +filter{js-annoyances} +filter{kill-popups}\
2486   +filter{webbugs} +filter{nimda} +filter{banners-by-size}
2487  }
2488  / #match all URLs
2489               
2490  # Then disable filtering of code from all sourceforge domains!
2491  {-filter}
2492   .sourceforge.net
2493    
2494
2495 Now some URLs that we want "blocked" (normally generates the "blocked" banner).
2496 Typically, the "block" action is off by default in the upper section of an
2497 actions file, then enabled against certain URLs and patterns in the lower part
2498 of the file. Many of these use regular expressions that will expand to match
2499 multiple URLs:
2500
2501   # Blocklist:
2502   {+block}
2503   ad*.
2504   .*ads.
2505   banner?.
2506   count*.
2507   /.*count(er)?\.(pl|cgi|exe|dll|asp|php[34]?)
2508   /(?:.*/)?(publicite|werbung|rekla(ma|me|am)|annonse|maino(kset|nta|s)?)/
2509   .hitbox.com 
2510   /.*/(ng)?adclient\.cgi
2511   /.*/(plain|live|rotate)[-_.]?ads?/
2512   /.*/abanners/
2513   /autoads/
2514    
2515
2516 Note that many of these actions have the potential to cause a page to
2517 misbehave, possibly even not to display at all. There are many ways a site
2518 designer may choose to design his site, and what HTTP header content, and other
2519 criteria, he may depend on. There is no way to have hard and fast rules for all
2520 sites. See the Appendix for a brief example on troubleshooting actions.
2521
2522 -------------------------------------------------------------------------------
2523
2524 5.4.6. Aliases
2525
2526 Custom "actions", known to Privoxy as "aliases", can be defined by combining
2527 other "actions". These can in turn be invoked just like the built-in "actions".
2528 Currently, an alias can contain any character except space, tab, "=", "{" or "}
2529 ". But please use only "a"- "z", "0"-"9", "+", and "-". Alias names are not
2530 case sensitive, and must be defined before other actions in the actions file!
2531 And there can only be one set of "aliases" defined per file. Each actions file
2532 may have its own aliases, but they are only visible within that file.
2533
2534 Now let's define a few aliases:
2535
2536  # Useful custom aliases we can use later. These must come first!
2537  {{alias}}
2538  +prevent-cookies = +prevent-setting-cookies +prevent-reading-cookies
2539  -prevent-cookies = -prevent-setting-cookies -prevent-reading-cookies
2540  fragile     =
2541  -block -prevent-cookies -filter -fast-redirects -hide-referer -kill-popups
2542  shop        = -prevent-cookies -filter -fast-redirects
2543  +imageblock = +block +handle-as-image
2544
2545  # Aliases defined from other aliases, for people who don't like to type 
2546  # too much:  ;-)
2547  c0 = +prevent-cookies
2548  c1 = -prevent-cookies
2549  #... etc.  Customize to your heart's content.
2550    
2551
2552 Some examples using our "shop" and "fragile" aliases from above. These would
2553 appear in the lower sections of an actions file as exceptions to the default
2554 actions (as defined in the upper section):
2555
2556  # These sites are very complex and require
2557  # minimal interference.
2558  {fragile}
2559   .office.microsoft.com
2560   .windowsupdate.microsoft.com
2561   .nytimes.com
2562
2563  # Shopping sites - but we still want to block ads.
2564  {shop}
2565   .quietpc.com
2566   .worldpay.com   # for quietpc.com
2567   .scan.co.uk
2568
2569  # These shops require pop-ups also 
2570  {shop -kill-popups}
2571   .dabs.com
2572   .overclockers.co.uk
2573    
2574
2575 The "shop" and "fragile" aliases are often used for "problem" sites that
2576 require most actions to be disabled in order to function properly. 
2577
2578 -------------------------------------------------------------------------------
2579
2580 5.5. The Filter File
2581
2582 Any web page can be dynamically modified with the filter file. This
2583 modification can be removal, or re-writing, of any web page content, including
2584 tags and non-visible content. The default filter file is default.filter,
2585 located in the config directory.
2586
2587 This is potentially a very powerful feature, and requires knowledge of both
2588 "regular expression" and HTML in order create custom filters. But, there are a
2589 number of useful filters included with Privoxy for many common situations.
2590
2591 The included example file is divided into sections. Each section begins with
2592 the FILTER keyword, followed by the identifier for that section, e.g. "FILTER:
2593 webbugs". Each section performs a similar type of filtering, such as
2594 "html-annoyances".
2595
2596 This file uses regular expressions to alter or remove any string in the target
2597 page. The expressions can only operate on one line at a time. Some examples
2598 from the included default default.filter:
2599
2600 Stop web pages from displaying annoying messages in the status bar by deleting
2601 such references:
2602
2603  FILTER: html-annoyances
2604
2605  # New browser windows should be resizeable and have a location and status
2606  # bar. Make it so.
2607  #
2608  s/resizable="?(no|0)"?/resizable=1/ig s/noresize/yesresize/ig
2609  s/location="?(no|0)"?/location=1/ig s/status="?(no|0)"?/status=1/ig
2610  s/scrolling="?(no|0|Auto)"?/scrolling=1/ig
2611  s/menubar="?(no|0)"?/menubar=1/ig 
2612
2613  # The <BLINK> tag was a crime!
2614  #
2615  s*<blink>|</blink>**ig
2616
2617  # Is this evil? 
2618  #
2619  #s/framespacing="?(no|0)"?//ig
2620  #s/margin(height|width)=[0-9]*//gi
2621    
2622
2623 Just for kicks, replace any occurrence of "Microsoft" with "MicroSuck", and
2624 have a little fun with topical buzzwords:
2625
2626  FILTER: fun
2627
2628  s/microsoft(?!.com)/MicroSuck/ig
2629
2630  # Buzzword Bingo:
2631  #
2632  s/industry-leading|cutting-edge|award-winning/<font color=red><b>BINGO!</b></
2633 font>/ig
2634    
2635
2636 Kill those pesky little web-bugs:
2637
2638  # webbugs: Squish WebBugs (1x1 invisible GIFs used for user tracking)
2639  FILTER: webbugs
2640
2641  s/<img\s+[^>]*?(width|height)\s*=\s*['"]?1\D[^>]*?(width|height)\s*=\s*['"]?1
2642 (\D[^>]*?)?>/<!-- Squished WebBug -->/sig
2643    
2644
2645 -------------------------------------------------------------------------------
2646
2647 5.6. Templates
2648
2649 When Privoxy displays one of its internal pages, such as a 404 Not Found error
2650 page, it uses the appropriate template. On Linux, BSD, and Unix, these are
2651 located in /etc/privoxy/templates by default. These may be customized, if
2652 desired. cgi-style.css is used to control the HTML attributes (fonts, etc).
2653
2654 The default "Blocked" banner page with the bright red top banner, is called
2655 just "blocked". This may be customized or replaced with something else if
2656 desired. 
2657
2658 -------------------------------------------------------------------------------
2659
2660 6. Contacting the Developers, Bug Reporting and Feature Requests
2661
2662 We value your feedback. However, to provide you with the best support, please
2663 note:
2664
2665   * Use the Sourceforge Support Forum to get help:
2666        
2667         http://sourceforge.net/tracker/?group_id=11118&atid=211118
2668        
2669    
2670   * Submit bugs only through our Sourceforge Bug Forum:
2671      
2672         http://sourceforge.net/tracker/?group_id=11118&atid=111118. 
2673         
2674    
2675     Make sure that the bug has not already been submitted. Please try to verify
2676     that it is a Privoxy bug, and not a browser or site bug first. If you are
2677     using your own custom configuration, please try the stock configs to see if
2678     the problem is a configuration related bug. And if not using the latest
2679     development snapshot, please try the latest one. Or even better, CVS
2680     sources. Please be sure to include the Privoxy/Junkbuster version,
2681     platform, browser, any pertinent log data, any other relevant details
2682     (please be specific) and, if possible, some way to reproduce the bug.
2683    
2684   * Submit feature requests only through our Sourceforge feature request forum:
2685      
2686         http://sourceforge.net/tracker/?atid=361118&group_id=11118&func=browse.
2687        
2688    
2689   * You can also send feedback on websites that Privoxy has problems with. Please bookmark
2690     the following link: "Privoxy - Submit Filter Feedback"
2691     . Once you surf to a page with problems, use the
2692     bookmark to send us feedback. We will look into the issue as soon as possible.
2693        
2694    
2695   * For any other issues, feel free to use the mailing lists:
2696      
2697         http://sourceforge.net/mail/?group_id=11118.
2698      
2699    
2700     Anyone interested in actively participating in development and related
2701     discussions can also join the appropriate mailing list. Archives are
2702     available, too.
2703    
2704 -------------------------------------------------------------------------------
2705
2706 6.1. Submitting Ads and "Action" Problems
2707
2708 Ads and banners that are not stopped by Privoxy can be submitted to the
2709 developers by accessing a special page and filling out the brief, required
2710 form. Conversely, you can also report pages, images, etc. that Privoxy is
2711 blocking, but should not. The form itself does require Internet access.
2712
2713 To do this, point your browser to Privoxy at http://config.privoxy.org/
2714 (shortcut: http://p.p/), and then select Actions file feedback system, near the
2715 bottom of the page. Paste in the URL that is the cause of the unwanted
2716 behavior, and follow the prompts. The developers will try to incorporate a fix
2717 for the problem you reported into future versions.
2718
2719 New, improved default.action files will occasionally be made available based on
2720 your feedback. These will be announced on the ijbswa-announce list.
2721
2722 -------------------------------------------------------------------------------
2723
2724 7. Copyright and History
2725
2726 7.1. Copyright
2727
2728 Privoxy is free software; you can redistribute it and/or modify it under the
2729 terms of the GNU General Public License as published by the Free Software
2730 Foundation; either version 2 of the License, or (at your option) any later
2731 version.
2732
2733 This program is distributed in the hope that it will be useful, but WITHOUT ANY
2734 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
2735 PARTICULAR PURPOSE. See the GNU General Public License for more details, which
2736 is available from the Free Software Foundation, Inc, 59 Temple Place - Suite
2737 330, Boston, MA 02111-1307, USA.
2738
2739 You should have received a copy of the GNU General Public License along with
2740 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
2741 Place, Suite 330, Boston, MA 02111-1307 USA.
2742
2743 -------------------------------------------------------------------------------
2744
2745 7.2. History
2746
2747 Privoxy is evolved, and derived from, the Internet Junkbuster, with many
2748 improvments and enhancements over the original.
2749
2750 Junkbuster was originally written by Anonymous Coders and Junkbusters
2751 Corporation, and was released as free open-source software under the GNU GPL. 
2752 Stefan Waldherr made many improvements, and started the SourceForge project
2753 Privoxy to rekindle development. There are now several active developers
2754 contributing. The last stable release of Junkbuster was v2.0.2, which has now
2755 grown whiskers ;-).
2756
2757 -------------------------------------------------------------------------------
2758
2759 8. See Also
2760
2761 Other references and sites of interest to Privoxy users:
2762
2763 http://www.privoxy.org/, The Privoxy Home page.
2764
2765 http://sourceforge.net/projects/ijbswa, the Project Page for Privoxy on        
2766 Sourceforge.                                                                   
2767
2768 http://p.p/, access Privoxy from your browser. Alternately, http://            
2769 config.privoxy.org may work in some situations where the first does not.       
2770
2771 http://p.p/, and select "actions file feedback system" to submit "misses" to   
2772 the developers.                                                                
2773
2774 http://www.junkbusters.com/ht/en/cookies.html
2775
2776 http://www.waldherr.org/junkbuster/
2777
2778 http://privacy.net/analyze/
2779
2780 http://www.squid-cache.org/
2781
2782  
2783
2784 -------------------------------------------------------------------------------
2785
2786 9. Appendix
2787
2788 9.1. Regular Expressions
2789
2790 Privoxy can use "regular expressions" in various config files. Assuming support
2791 for "pcre" (Perl Compatible Regular Expressions) is compiled in, which is the
2792 default. Such configuration directives do not require regular expressions, but
2793 they can be used to increase flexibility by matching a pattern with wild-cards
2794 against URLs.
2795
2796 If you are reading this, you probably don't understand what "regular
2797 expressions" are, or what they can do. So this will be a very brief
2798 introduction only. A full explanation would require a book ;-)
2799
2800 "Regular expressions" is a way of matching one character expression against
2801 another to see if it matches or not. One of the "expressions" is a literal
2802 string of readable characters (letter, numbers, etc), and the other is a
2803 complex string of literal characters combined with wild-cards, and other
2804 special characters, called meta-characters. The "meta-characters" have special
2805 meanings and are used to build the complex pattern to be matched against. Perl
2806 Compatible Regular Expressions is an enhanced form of the regular expression
2807 language with backward compatibility.
2808
2809 To make a simple analogy, we do something similar when we use wild-card
2810 characters when listing files with the dir command in DOS. *.* matches all
2811 filenames. The "special" character here is the asterisk which matches any and
2812 all characters. We can be more specific and use ? to match just individual
2813 characters. So "dir file?.text" would match "file1.txt", "file2.txt", etc. We
2814 are pattern matching, using a similar technique to "regular expressions"!
2815
2816 Regular expressions do essentially the same thing, but are much, much more
2817 powerful. There are many more "special characters" and ways of building complex
2818 patterns however. Let's look at a few of the common ones, and then some
2819 examples:
2820
2821 . - Matches any single character, e.g. "a", "A", "4", ":", or "@".
2822
2823 ? - The preceding character or expression is matched ZERO or ONE times. Either/
2824 or.                                                                            
2825
2826 + - The preceding character or expression is matched ONE or MORE times.
2827
2828 * - The preceding character or expression is matched ZERO or MORE times.
2829
2830 \ - The "escape" character denotes that the following character should be taken
2831 literally. This is used where one of the special characters (e.g. ".") needs to
2832 be taken literally and not as a special meta-character. Example: "example      
2833 \.com", makes sure the period is recognized only as a period (and not expanded 
2834 to its meta-character meaning of any single character).                        
2835
2836 [] - Characters enclosed in brackets will be matched if any of the enclosed    
2837 characters are encountered. For instance, "[0-9]" matches any numeric digit    
2838 (zero through nine). As an example, we can combine this with "+" to match any  
2839 digit one of more times: "[0-9]+".                                             
2840
2841 () - parentheses are used to group a sub-expression, or multiple               
2842 sub-expressions.                                                               
2843
2844 | - The "bar" character works like an "or" conditional statement. A match is   
2845 successful if the sub-expression on either side of "|" matches. As an example: 
2846 "/(this|that) example/" uses grouping and the bar character and would match    
2847 either "this example" or "that example", and nothing else.                     
2848
2849 s/string1/string2/g - This is used to rewrite strings of text. "string1" is    
2850 replaced by "string2" in this example. There must of course be a match on      
2851 "string1" first.                                                               
2852
2853 These are just some of the ones you are likely to use when matching URLs with
2854 Privoxy, and is a long way from a definitive list. This is enough to get us
2855 started with a few simple examples which may be more illuminating:
2856
2857 /.*/banners/.* - A simple example that uses the common combination of "." and "
2858 *" to denote any character, zero or more times. In other words, any string at
2859 all. So we start with a literal forward slash, then our regular expression
2860 pattern (".*") another literal forward slash, the string "banners", another
2861 forward slash, and lastly another ".*". We are building a directory path here.
2862 This will match any file with the path that has a directory named "banners" in
2863 it. The ".*" matches any characters, and this could conceivably be more forward
2864 slashes, so it might expand into a much longer looking path. For example, this
2865 could match: "/eye/hate/spammers/banners/annoy_me_please.gif", or just "/
2866 banners/annoying.html", or almost an infinite number of other possible
2867 combinations, just so it has "banners" in the path somewhere.
2868
2869 A now something a little more complex:
2870
2871 /.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have several literal forward
2872 slashes again ("/"), so we are building another expression that is a file path
2873 statement. We have another ".*", so we are matching against any conceivable
2874 sub-path, just so it matches our expression. The only true literal that must
2875 match our pattern is adv, together with the forward slashes. What comes after
2876 the "adv" string is the interesting part.
2877
2878 Remember the "?" means the preceding expression (either a literal character or
2879 anything grouped with "(...)" in this case) can exist or not, since this means
2880 either zero or one match. So "((er)?ts?|ertis(ing|ements?))" is optional, as
2881 are the individual sub-expressions: "(er)", "(ing|ements?)", and the "s". The "
2882 |" means "or". We have two of those. For instance, "(ing|ements?)", can expand
2883 to match either "ing" OR "ements?". What is being done here, is an attempt at
2884 matching as many variations of "advertisement", and similar, as possible. So
2885 this would expand to match just "adv", or "advert", or "adverts", or
2886 "advertising", or "advertisement", or "advertisements". You get the idea. But
2887 it would not match "advertizements" (with a "z"). We could fix that by changing
2888 our regular expression to: "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/", which
2889 would then match either spelling.
2890
2891 /.*/advert[0-9]+\.(gif|jpe?g) - Again another path statement with forward
2892 slashes. Anything in the square brackets "[]" can be matched. This is using
2893 "0-9" as a shorthand expression to mean any digit one through nine. It is the
2894 same as saying "0123456789". So any digit matches. The "+" means one or more of
2895 the preceding expression must be included. The preceding expression here is
2896 what is in the square brackets -- in this case, any digit one through nine.
2897 Then, at the end, we have a grouping: "(gif|jpe?g)". This includes a "|", so
2898 this needs to match the expression on either side of that bar character also. A
2899 simple "gif" on one side, and the other side will in turn match either "jpeg"
2900 or "jpg", since the "?" means the letter "e" is optional and can be matched
2901 once or not at all. So we are building an expression here to match image GIF or
2902 JPEG type image file. It must include the literal string "advert", then one or
2903 more digits, and a "." (which is now a literal, and not a special character,
2904 since it is escaped with "\"), and lastly either "gif", or "jpeg", or "jpg".
2905 Some possible matches would include: "//advert1.jpg", "/nasty/ads/
2906 advert1234.gif", "/banners/from/hell/advert99.jpg". It would not match
2907 "advert1.gif" (no leading slash), or "/adverts232.jpg" (the expression does not
2908 include an "s"), or "/advert1.jsp" ("jsp" is not in the expression anywhere).
2909
2910 s/microsoft(?!.com)/MicroSuck/i - This is a substitution. "MicroSuck" will
2911 replace any occurrence of "microsoft". The "i" at the end of the expression
2912 means ignore case. The "(?!.com)" means the match should fail if "microsoft" is
2913 followed by ".com". In other words, this acts like a "NOT" modifier. In case
2914 this is a hyperlink, we don't want to break it ;-).
2915
2916 We are barely scratching the surface of regular expressions here so that you
2917 can understand the default Privoxy configuration files, and maybe use this
2918 knowledge to customize your own installation. There is much, much more that can
2919 be done with regular expressions. Now that you know enough to get started, you
2920 can learn more on your own :/
2921
2922 More reading on Perl Compatible Regular expressions: http://www.perldoc.com/
2923 perl5.6/pod/perlre.html
2924
2925 -------------------------------------------------------------------------------
2926
2927 9.2. Privoxy's Internal Pages
2928
2929 Since Privoxy proxies each requested web page, it is easy for Privoxy to trap
2930 certain special URLs. In this way, we can talk directly to Privoxy, and see how
2931 it is configured, see how our rules are being applied, change these rules and
2932 other configuration options, and even turn Privoxy's filtering off, all with a
2933 web browser. 
2934
2935 The URLs listed below are the special ones that allow direct access to Privoxy.
2936 Of course, Privoxy must be running to access these. If not, you will get a
2937 friendly error message. Internet access is not necessary either.
2938
2939   * Privoxy main page:
2940    
2941         http://config.privoxy.org/
2942        
2943     Alternately, this may be reached at http://p.p/, but this variation may not
2944     work as reliably as the above in some configurations.
2945    
2946   * Show information about the current configuration, including viewing and
2947     editing of actions files:
2948    
2949         http://config.privoxy.org/show-status
2950        
2951   * Show the source code version numbers:
2952    
2953         http://config.privoxy.org/show-version
2954        
2955   * Show the browser's request headers:
2956    
2957         http://config.privoxy.org/show-request
2958        
2959   * Show which actions apply to a URL and why:
2960    
2961         http://config.privoxy.org/show-url-info
2962        
2963   * Toggle Privoxy on or off. In this case, "Privoxy" continues to run, but
2964     only as a pass-through proxy, with no actions taking place:
2965    
2966         http://config.privoxy.org/toggle
2967        
2968     Short cuts. Turn off, then on:
2969    
2970         http://config.privoxy.org/toggle?set=disable
2971        
2972         http://config.privoxy.org/toggle?set=enable
2973        
2974 These may be bookmarked for quick reference. See next. 
2975
2976 -------------------------------------------------------------------------------
2977
2978 9.2.1. Bookmarklets
2979
2980 Below are some "bookmarklets" to allow you to easily access a "mini" version of
2981 some of Privoxy's special pages. They are designed for MS Internet Explorer,
2982 but should work equally well in Netscape, Mozilla, and other browsers which
2983 support JavaScript. They are designed to run directly from your bookmarks - not
2984 by clicking the links below (although that should work for testing).
2985
2986 To save them, right-click the link and choose "Add to Favorites" (IE) or "Add
2987 Bookmark" (Netscape). You will get a warning that the bookmark "may not be
2988 safe" - just click OK. Then you can run the Bookmarklet directly from your
2989 favorites/bookmarks. For even faster access, you can put them on the "Links"
2990 bar (IE) or the "Personal Toolbar" (Netscape), and run them with a single
2991 click.
2992
2993   * Enable Privoxy
2994    
2995   * Disable Privoxy
2996    
2997   * Toggle Privoxy (Toggles between enabled and disabled)
2998    
2999   * View Privoxy Status
3000    
3001   * Actions file feedback system
3002    
3003 Credit: The site which gave me the general idea for these bookmarklets is 
3004 www.bookmarklets.com. They have more information about bookmarklets.
3005
3006 -------------------------------------------------------------------------------
3007
3008 9.3. Chain of Events
3009
3010 Let's take a quick look at the basic sequence of events when a web page is
3011 requested by your browser and Privoxy is on duty:
3012
3013   * First, your web browser requests a web page. The browser knows to send the
3014     request to Privoxy, which will in turn, relay the request to the remote web
3015     server after passing the following tests:
3016    
3017   * Privoxy traps any request for its own internal CGI pages (e.g http://p.p/)
3018     and sends the CGI page back to the browser.
3019    
3020   * Next, Privoxy checks to see if the URL matches any "+block" patterns. If
3021     so, the URL is then blocked, and the remote web server will not be
3022     contacted. "+handle-as-image" is then checked and if it does not match, an
3023     HTML "BLOCKED" page is sent back. Otherwise, if it does match, an image is
3024     returned. The type of image depends on the setting of "+set-image-blocker"
3025     (blank, checkerboard pattern, or an HTTP redirect to an image elsewhere).
3026    
3027   * Untrusted URLs are blocked. If URLs are being added to the trust file, then
3028     that is done.
3029    
3030   * If the URL pattern matches the "+fast-redirects" action, it is then
3031     processed. Unwanted parts of the requested URL are stripped.
3032    
3033   * Now the rest of the client browser's request headers are processed. If any
3034     of these match any of the relevant actions (e.g. "+hide-user-agent", etc.),
3035     headers are suppressed or forged as determined by these actions and their
3036     parameters.
3037    
3038   * Now the web server starts sending its response back (i.e. typically a web
3039     page and related data).
3040    
3041   * First, the server headers are read and processed to determine, among other
3042     things, the MIME type (document type) and encoding. The headers are then
3043     filtered as deterimed by the "+prevent-setting-cookies", 
3044     "+session-cookies-only", and "+downgrade-http-version" actions.
3045    
3046   * If the "+kill-popups" action applies, and it is an HTML or JavaScript
3047     document, the popup-code in the response is filtered on-the-fly as it is
3048     received.
3049    
3050   * If a "+filter" or "+deanimate-gifs" action applies (and the document type
3051     fits the action), the rest of the page is read into memory (up to a
3052     configurable limit). Then the filter rules (from default.filter) are
3053     processed against the buffered content. Filters are applied in the order
3054     they are specified in the default.filter file. Animated GIFs, if present,
3055     are reduced to either the first or last frame, depending on the action
3056     setting.The entire page, which is now filtered, is then sent by Privoxy
3057     back to your browser.
3058    
3059     If neither "+filter" or "+deanimate-gifs" matches, then Privoxy passes the
3060     raw data through to the client browser as it becomes available.
3061    
3062   * As the browser receives the now (probably filtered) page content, it reads
3063     and then requests any URLs that may be embedded within the page source,
3064     e.g. ad images, stylesheets, JavaScript, other HTML documents (e.g.
3065     frames), sounds, etc. For each of these objects, the browser issues a new
3066     request. And each such request is in turn processed as above. Note that a
3067     complex web page may have many such embedded URLs.
3068    
3069 -------------------------------------------------------------------------------
3070
3071 9.4. Anatomy of an Action
3072
3073 The way Privoxy applies "actions" and "filters" to any given URL can be
3074 complex, and not always so easy to understand what is happening. And sometimes
3075 we need to be able to see just what Privoxy is doing. Especially, if something
3076 Privoxy is doing is causing us a problem inadvertently. It can be a little
3077 daunting to look at the actions and filters files themselves, since they tend
3078 to be filled with "regular expressions" whose consequences are not always so
3079 obvious.
3080
3081 One quick test to see if Privoxy is causing a problem or not, is to disable it
3082 temporarily. This should be the first troubleshooting step. See the
3083 Bookmarklets section on a quick and easy way to do this (be sure to flush
3084 caches afterward!).
3085
3086 Privoxy also provides the http://config.privoxy.org/show-url-info page that can
3087 show us very specifically how actions are being applied to any given URL. This
3088 is a big help for troubleshooting.
3089
3090 First, enter one URL (or partial URL) at the prompt, and then Privoxy will tell
3091 us how the current configuration will handle it. This will not help with
3092 filtering effects (i.e. the "+filter" action) from the default.filter file
3093 since this is handled very differently and not so easy to trap! It also will
3094 not tell you about any other URLs that may be embedded within the URL you are
3095 testing. For instance, images such as ads are expressed as URLs within the raw
3096 page source of HTML pages. So you will only get info for the actual URL that is
3097 pasted into the prompt area -- not any sub-URLs. If you want to know about
3098 embedded URLs like ads, you will have to dig those out of the HTML source. Use
3099 your browser's "View Page Source" option for this. Or right click on the ad,
3100 and grab the URL.
3101
3102 Let's try an example, google.com, and look at it one section at a time:
3103
3104  Matches for http://google.com:                                                     
3105                                                                                     
3106 --- File standard ---                                                               
3107 (no matches in this file)                                                           
3108                                                                                     
3109 --- File default ---                                                                
3110                                                                                     
3111 { -add-header -block +deanimate-gifs{last} -downgrade-http-version +fast-redirects  
3112  -filter{popups} -filter{fun} -filter{shockwave-flash} -filter{crude-parental}      
3113  +filter{html-annoyances} +filter{js-annoyances} +filter{content-cookies}           
3114  +filter{webbugs} +filter{refresh-tags} +filter{nimda} +filter{banners-by-size}     
3115  +hide-forwarded-for-headers +hide-from-header{block} +hide-referer{forge}          
3116  -hide-user-agent -handle-as-image +set-image-blocker{pattern} -limit-connect       
3117  +prevent-compression +session-cookies-only -prevent-reading-cookies                
3118  -prevent-setting-cookies -kill-popups -send-vanilla-wafer -send-wafer }            
3119 /                                                                                   
3120                                                                                     
3121  { -session-cookies-only }                                                          
3122  .google.com                                                                        
3123                                                                                     
3124  { -fast-redirects }                                                                
3125  .google.com                                                                        
3126                                                                                     
3127 --- File user ---                                                                   
3128 (no matches in this file)                                                           
3129
3130 This tells us how we have defined our "actions", and which ones match for our
3131 example, "google.com". The first listing is any matches for the standard.action
3132 file. No hits at all here on "standard". Then next is "default", or our
3133 default.action file. The large, multi-line listing, is how the actions are set
3134 to match for all URLs, i.e. our default settings. If you look at your "actions"
3135 file, this would be the section just below the "aliases" section near the top.
3136 This will apply to all URLs as signified by the single forward slash at the end
3137 of the listing -- "/".
3138
3139 But we can define additional actions that would be exceptions to these general
3140 rules, and then list specific URLs (or patterns) that these exceptions would
3141 apply to. Last match wins. Just below this then are two explicit matches for
3142 ".google.com". The first is negating our previous cookie setting, which was for
3143 "+session-cookies-only" (i.e. not persistent). So we will allow persistent
3144 cookies for google. The second turns off any "+fast-redirects" action, allowing
3145 this to take place unmolested. Note that there is a leading dot here --
3146 ".google.com". This will match any hosts and sub-domains, in the google.com
3147 domain also, such as "www.google.com". So, apparently, we have these two
3148 actions defined somewhere in the lower part of our default.action file, and
3149 "google.com" is referenced somewhere in these latter sections.
3150
3151 Then, for our user.action file, we again have no hits.
3152
3153 And finally we pull it all together in the bottom section and summarize how
3154 Privoxy is applying all its "actions" to "google.com": 
3155
3156  Final results:                                                                    
3157  -add-header -block +deanimate-gifs{last} -downgrade-http-version -fast-redirects  
3158  -filter{popups} -filter{fun} -filter{shockwave-flash} -filter{crude-parental}     
3159  +filter{html-annoyances} +filter{js-annoyances} +filter{content-cookies}          
3160  +filter{webbugs} +filter{refresh-tags} +filter{nimda} +filter{banners-by-size}    
3161  +hide-forwarded-for-headers +hide-from-header{block} +hide-referer{forge}         
3162  -hide-user-agent -handle-as-image +set-image-blocker{pattern} -limit-connect      
3163  +prevent-compression -session-cookies-only -prevent-reading-cookies               
3164  -prevent-setting-cookies -kill-popups -send-vanilla-wafer -send-wafer             
3165                                                                                    
3166                                                                                    
3167
3168 Notice the only difference here to the previous listing, is to "fast-redirects"
3169 and "session-cookies-only".
3170
3171 Now another example, "ad.doubleclick.net":
3172
3173  { +block +handle-as-image }                                                   
3174   .ad.doubleclick.net                                                          
3175                                                                                
3176  { +block +handle-as-image }                                                   
3177   ad*.                                                                         
3178                                                                                
3179  { +block +handle-as-image }                                                   
3180   .doubleclick.net                                                             
3181                                                                                
3182                                                                                
3183
3184 We'll just show the interesting part here, the explicit matches. It is matched
3185 three different times. Each as an "+block +handle-as-image", which is the
3186 expanded form of one of our aliases that had been defined as: "+imageblock". (
3187 "Aliases" are defined in the first section of the actions file and typically
3188 used to combine more than one action.)
3189
3190 Any one of these would have done the trick and blocked this as an unwanted
3191 image. This is unnecessarily redundant since the last case effectively would
3192 also cover the first. No point in taking chances with these guys though ;-)
3193 Note that if you want an ad or obnoxious URL to be invisible, it should be
3194 defined as "ad.doubleclick.net" is done here -- as both a "+block" and an 
3195 "+handle-as-image". The custom alias "+imageblock" just simplifies the process
3196 and make it more readable.
3197
3198 One last example. Let's try "http://www.rhapsodyk.net/adsl/HOWTO/". This one is
3199 giving us problems. We are getting a blank page. Hmmm...
3200
3201  Matches for http://www.rhapsodyk.net/adsl/HOWTO/:                                   
3202                                                                                      
3203  { -add-header -block +deanimate-gifs -downgrade-http-version +fast-redirects        
3204    +filter{html-annoyances} +filter{js-annoyances} +filter{kill-popups}              
3205    +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal}             
3206    +filter{fun} +hide-forwarded-for-headers +hide-from-header{block}                 
3207    +hide-referer{forge} -hide-user-agent -handle-as-image +set-image-blocker{blank}  
3208    +prevent-compression +session-cookies-only -prevent-setting-cookies               
3209    -prevent-reading-cookies +kill-popups -send-vanilla-wafer -send-wafer }           
3210    /                                                                                 
3211                                                                                      
3212  { +block +handle-as-image }                                                         
3213   /ads                                                                               
3214                                                                                      
3215                                                                                      
3216
3217 Ooops, the "/adsl/" is matching "/ads"! But we did not want this at all! Now we
3218 see why we get the blank page. We could now add a new action below this that
3219 explicitly does not block ("{-block}") paths with "adsl". There are various
3220 ways to handle such exceptions. Example:
3221
3222  { -block }                                                                    
3223   /adsl                                                                        
3224                                                                                
3225                                                                                
3226
3227 Now the page displays ;-) Be sure to flush your browser's caches when making
3228 such changes. Or, try using Shift+Reload.
3229
3230 But now what about a situation where we get no explicit matches like we did
3231 with:
3232
3233  { +block +handle-as-image }                                                   
3234  /ads                                                                          
3235                                                                                
3236                                                                                
3237
3238 That actually was very telling and pointed us quickly to where the problem was.
3239 If you don't get this kind of match, then it means one of the default rules in
3240 the first section is causing the problem. This would require some guesswork,
3241 and maybe a little trial and error to isolate the offending rule. One likely
3242 cause would be one of the "{+filter}" actions. Try adding the URL for the site
3243 to one of aliases that turn off "+filter":
3244
3245  {shop}                                                                        
3246  .quietpc.com                                                                  
3247  .worldpay.com   # for quietpc.com                                             
3248  .jungle.com                                                                   
3249  .scan.co.uk                                                                   
3250  .forbes.com                                                                   
3251                                                                                
3252                                                                                
3253
3254 "{shop}" is an "alias" that expands to "{ -filter -session-cookies-only }". Or
3255 you could do your own exception to negate filtering: 
3256
3257  {-filter}                                                                     
3258  .forbes.com                                                                   
3259                                                                                
3260                                                                                
3261
3262 This would probably be most appropriately put in user.action, for local site
3263 exceptions.
3264
3265 "{fragile}" is an alias that disables most actions. This can be used as a last
3266 resort for problem sites. Remember to flush caches! If this still does not
3267 work, you will have to go through the remaining actions one by one to find
3268 which one(s) is causing the problem.
3269