Sync with source.
[privoxy.git] / doc / text / user-manual.txt
1 Privoxy User Manual
2
3 By: Privoxy Developers
4
5 $Id: user-manual.sgml,v 1.61 2002/03/29 01:31:08 hal9 Exp $
6
7 The user manual gives users information on how to install, configure and use
8 Privoxy. Privoxy is a web proxy with advanced filtering capabilities for
9 protecting privacy, filtering web page content, managing cookies, controlling
10 access, and removing ads, banners, pop-ups and other obnoxious Internet Junk.
11 Privoxy has a very flexible configuration and can be customized to suit
12 individual needs and tastes. Privoxy has application for both stand-alone
13 systems and multi-user networks.
14
15 You can find the latest version of the user manual at http://www.privoxy.org/
16 user-manual/.
17
18 -------------------------------------------------------------------------------
19
20 Table of Contents
21 1. Introduction
22    
23     1.1. New Features
24    
25 2. Installation
26    
27     2.1. Source
28     2.2. Red Hat
29     2.3. SuSE
30     2.4. OS/2
31     2.5. Windows
32     2.6. Other
33    
34 3. Quickstart to Using Privoxy
35    
36     3.1. Command Line Options
37    
38 4. Privoxy Configuration
39    
40     4.1. Controlling Privoxy with Your Web Browser
41     4.2. Configuration Files Overview
42     4.3. The Main Configuration File
43        
44         4.3.1. Defining Other Configuration Files
45         4.3.2. Other Configuration Options
46         4.3.3. Access Control List (ACL)
47         4.3.4. Forwarding
48         4.3.5. Windows GUI Options
49        
50     4.4. The Actions File
51        
52         4.4.1. URL Domain and Path Syntax
53         4.4.2. Actions
54         4.4.3. Aliases
55        
56     4.5. The Filter File
57     4.6. Templates
58    
59 5. Contacting the Developers, Bug Reporting and Feature Requests
60 6. Copyright and History
61    
62     6.1. License
63     6.2. History
64    
65 7. See also
66 8. Appendix
67    
68     8.1. Regular Expressions
69     8.2. Privoxy's Internal Pages
70        
71         8.2.1. Bookmarklets
72        
73     8.3. Anatomy of an Action
74    
75 1. Introduction
76
77 Privoxy is a web proxy with advanced filtering capabilities for protecting
78 privacy, filtering web page content, managing cookies, controlling access, and
79 removing ads, banners, pop-ups and other obnoxious Internet junk. Privoxy has a
80 very flexible configuration and can be customized to suit individual needs and
81 tastes. Privoxy has application for both stand-alone systems and multi-user
82 networks.
83
84 Privoxy is based on the code of the Internet Junkbuster. Junkbuster was
85 originally written by JunkBusters Corporation, and was released as free
86 open-source software under the GNU GPL. Stefan Waldherr made many improvements,
87 and started the SourceForge project to continue development.
88
89 Privoxy continues the Junkbuster tradition, but adds many refinements and
90 enhancements.
91
92 This documentation is included with the current BETA version of Privoxy and is
93 mostly complete at this point. The most up to date reference for the time being
94 is still the comments in the source files and in the individual configuration
95 files. Development of version 3.0 is currently nearing completion, and includes
96 many significant changes and enhancements over earlier versions. The target
97 release date for stable v3.0 is "soon" ;-)
98
99 Since this is a BETA version, not all new features are well tested. This
100 documentation may be slightly out of sync as a result (especially with CVS
101 sources). And there may be bugs, though hopefully not many!
102
103 -------------------------------------------------------------------------------
104
105 1.1. New Features
106
107 In addition to Internet Junkbuster's traditional feature of ad and banner
108 blocking and cookie management, Privoxy provides new features, some of them
109 currently under development:
110
111   * Integrated browser based configuration and control utility (http://p.p).
112     Browser-based tracing of rule and filter effects.
113    
114   * Blocking of annoying pop-up browser windows.
115    
116   * HTTP/1.1 compliant (most, but not all 1.1 features are supported).
117    
118   * Support for Perl Compatible Regular Expressions in the configuration files,
119     and generally a more sophisticated and flexible configuration syntax over
120     previous versions.
121    
122   * GIF de-animation.
123    
124   * Web page content filtering (removes banners based on size, invisible
125     "web-bugs", JavaScript, pop-ups, status bar abuse, etc.)
126    
127   * Bypass many click-tracking scripts (avoids script redirection).
128    
129   * Multi-threaded (POSIX and native threads).
130    
131   * Auto-detection and re-reading of config file changes.
132    
133   * User-customizable HTML templates (e.g. 404 error page).
134    
135   * Improved cookie management features (e.g. session based cookies).
136    
137   * Improved signal handling, and a true daemon mode (Unix).
138    
139   * Builds from source on most UNIX-like systems. Packages available for: Linux
140     (RedHat, SuSE, or Debian), Windows, Sun Solaris, Mac OSX, OS/2, HP-UX 11
141     and AmigaOS.
142    
143   * In addition, the configuration is much more powerful and versatile
144     over-all.
145    
146 -------------------------------------------------------------------------------
147
148 2. Installation
149
150 Privoxy is available as raw source code, or pre-compiled binaries. See the 
151 Privoxy Home Page for binaries and current release info. Privoxy is also
152 available via CVS. This is the recommended approach at this time. But please be
153 aware that CVS is constantly changing, and it may break in mysterious ways.
154
155 -------------------------------------------------------------------------------
156
157 2.1. Source
158
159 For gzipped tar archives, unpack the source:
160
161  tar xzvf privoxy-2.9.13-beta-src* [.tgz or .tar.gz]                           
162  cd privoxy-2.9.13-beta                                                        
163                                                                                
164
165 For retrieving the current CVS sources, you'll need the CVS package installed
166 first. To download CVS source:
167
168   cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login          
169   cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co current 
170   cd current                                                                         
171                                                                                      
172
173 This will create a directory named current/, which will contain the source
174 tree.
175
176 Then, in either case, to build from tarball/CVS source:
177
178  ./configure      (--help to see options)                                      
179  make             (the make from gnu, gmake for *BSD)                          
180  su                                                                            
181  make -n install  (to see where all the files will go)                         
182  make install     (to really install)                                          
183                                                                                
184
185 For Redhat and SuSE Linux RPM packages, see below.
186
187 -------------------------------------------------------------------------------
188
189 2.2. Red Hat
190
191 To build Redhat RPM packages, install source as above. Then:
192
193  autoheader                                                                    
194  autoconf                                                                      
195  ./configure                                                                   
196  make redhat-dist                                                              
197                                                                                
198
199 This will create both binary and src RPMs in the usual places. Example:
200
201    /usr/src/redhat/RPMS/i686/privoxy-2.9.11-1.i686.rpm
202
203    /usr/src/redhat/SRPMS/privoxy-2.9.11-1.src.rpm
204
205 To install, of course:
206
207  rpm -Uvv /usr/src/redhat/RPMS/i686/privoxy-2.9.11-1.i686.rpm                  
208                                                                                
209
210 This will place the Privoxy configuration files in /etc/privoxy/, and log files
211 in /var/log/privoxy/.
212
213 -------------------------------------------------------------------------------
214
215 2.3. SuSE
216
217 To build SuSE RPM packages, install source as above. Then:
218
219  autoheader                                                                    
220  autoconf                                                                      
221  ./configure                                                                   
222  make suse-dist                                                                
223                                                                                
224
225 This will create both binary and src RPMs in the usual places. Example:
226
227    /usr/src/packages/RPMS/i686/privoxy-2.9.11-1.i686.rpm
228
229    /usr/src/packages/SRPMS/privoxy-2.9.11-1.src.rpm
230
231 To install, of course:
232
233  rpm -Uvv /usr/src/packages/RPMS/i686/privoxy-2.9.11-1.i686.rpm                
234                                                                                
235
236 This will place the Privoxy configuration files in /etc/privoxy/, and log files
237 in /var/log/privoxy/.
238
239 -------------------------------------------------------------------------------
240
241 2.4. OS/2
242
243 Privoxy is packaged in a WarpIN self- installing archive. The self-installing
244 program will be named depending on the release version, something like:
245 ijbos2_setup_1.2.3.exe. In order to install it, simply run this executable or
246 double-click on its icon and follow the WarpIN installation panels. A shadow of
247 the Privoxy executable will be placed in your startup folder so it will start
248 automatically whenever OS/2 starts.
249
250 The directory you choose to install Privoxy into will contain all of the
251 configuration files.
252
253 If you would like to build binary images on OS/2 yourself, you will need a few
254 Unix-like tools: autoconf, autoheader and sh. These tools will be used to
255 create the required config.h file, which is not part of the source distribution
256 because it differs based on platform. You will also need a compiler. The
257 distribution has been created using IBM VisualAge compilers, but you can use
258 any compiler you like. GCC/EMX has the disadvantage of needing to be
259 single-threaded due to a limitation of EMX's implementation of the select()
260 socket call.
261
262 In addition to needing the source code distribution as outlined earlier, you
263 will want to extract the os2seutp directory from CVS:
264
265  cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login           
266  cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co os2setup 
267                                                                                      
268
269 This will create a directory named os2setup/, which will contain the
270 Makefile.vac makefile and os2build.cmd which is used to completely create the
271 binary distribution. The sequence of events for building the executable for
272 yourself goes something like this:
273
274  cd current                                                                    
275  autoheader                                                                    
276  autoconf                                                                      
277  sh configure                                                                  
278  cd ..\os2setup                                                                
279  nmake -f Makefile.vac                                                         
280                                                                                
281
282 You will see this sequence laid out in os2build.cmd.
283
284 -------------------------------------------------------------------------------
285
286 2.5. Windows
287
288 Click-click. (I need help on this. Not a clue here. Also for configuration
289 section below. HB.)
290
291 -------------------------------------------------------------------------------
292
293 2.6. Other
294
295 Some quick notes on other Operating Systems.
296
297 For FreeBSD (and other *BSDs?), the build will require gmake instead of the
298 included make. gmake is available from http://www.gnu.org. The rest should be
299 the same as above for Linux/Unix.
300
301 -------------------------------------------------------------------------------
302
303 3. Quickstart to Using Privoxy
304
305 Before launching Privoxy for the first time, you will want to configure your
306 browser(s) to use Privoxy and the HTTP and HTTPS proxy. The default is
307 localhost for the proxy address, and port 8118 (earlier versions used port
308 800). This is the one required configuration that must be done!
309
310 With Netscape (and Mozilla), this can be set under Edit -> Preferences ->
311 Advanced -> Proxies -> HTTP Proxy. For Internet Explorer: Tools > Internet
312 Properties -> Connections -> LAN Setting. Then, check "Use Proxy" and fill in
313 the appropriate info (Address: localhost, Port: 8118). Include if HTTPS proxy
314 support too.
315
316 After doing this, flush your browser's disk and memory caches to force a
317 re-reading of all pages and get rid of any ads that may be cached. You are now
318 ready to start enjoying the benefits of using Privoxy.
319
320 Privoxy is typically started by specifying the main configuration file to be
321 used on the command line. Example Unix startup command:
322
323                                                                                
324  # /usr/sbin/privoxy /etc/privoxy/config                                       
325                                                                                
326                                                                                
327
328 An init script is provided for SuSE and Redhat.
329
330 For for SuSE: /etc/rc.d/privoxy start
331
332 For RedHat: /etc/rc.d/init.d/privoxy start
333
334 If no configuration file is specified on the command line, Privoxy will look
335 for a file named config in the current directory. Except on Win32 where it will
336 try config.txt. If no file is specified on the command line and no default
337 configuration file can be found, Privoxy will fail to start.
338
339 The included default configuration files should give a reasonable starting
340 point, though may be somewhat aggressive in blocking junk. Most of the per site
341 configuration is done in the "actions" files. These are where various cookie
342 actions are defined, ad and banner blocking, and other aspects of Privoxy
343 configuration. There are several such files included, with varying levels of
344 aggressiveness.
345
346 You will probably want to keep an eye out for sites that require persistent
347 cookies, and add these to default.action as needed. By default, most of these
348 will be accepted only during the current browser session, until you add them to
349 the configuration. If you want the browser to handle this instead, you will
350 need to edit default.action and disable this feature. If you use more than one
351 browser, it would make more sense to let Privoxy handle this. In which case,
352 the browser(s) should be set to accept all cookies.
353
354 Privoxy is HTTP/1.1 compliant, but not all 1.1 features are as yet implemented.
355 If browsers that support HTTP/1.1 (like Mozilla or recent versions of I.E.)
356 experience problems, you might try to force HTTP/1.0 compatibility. For
357 Mozilla, look under Edit -> Preferences -> Debug -> Networking. Or set the
358 "+downgrade" config option in default.action.
359
360 After running Privoxy for a while, you can start to fine tune the configuration
361 to suit your personal, or site, preferences and requirements. There are many,
362 many aspects that can be customized. "Actions" (as specified in default.action)
363 can be adjusted by pointing your browser to http://p.p/, and then follow the
364 link to "edit the actions list". (This is an internal page and does not require
365 Internet access.)
366
367 In fact, various aspects of Privoxy configuration can be viewed from this page,
368 including current configuration parameters, source code version numbers, the
369 browser's request headers, and "actions" that apply to a given URL. In addition
370 to the default.action file editor mentioned above, Privoxy can also be turned
371 "on" and "off" from this page.
372
373 If you encounter problems, please verify it is a Privoxy bug, by disabling
374 Privoxy, and then trying the same page. Also, try another browser if possible
375 to eliminate browser or site problems. Before reporting it as a bug, see if
376 there is not a configuration option that is enabled that is causing the page
377 not to load. You can then add an exception for that page or site. For instance,
378 try adding it to the {fragile} section of default.action. This will turn off
379 most actions for this site. For more on troubleshooting problem sites, see the 
380 Appendix. If a bug, please report it to the developers (see below).
381
382 -------------------------------------------------------------------------------
383
384 3.1. Command Line Options
385
386 Privoxy may be invoked with the following command-line options:
387
388   * --version
389    
390     Print version info and exit, Unix only.
391    
392   * --help
393    
394     Print a short usage info and exit, Unix only.
395    
396   * --no-daemon
397    
398     Don't become a daemon, i.e. don't fork and become process group leader,
399     don't detach from controlling tty. Unix only.
400    
401   * --pidfile FILE
402    
403     On startup, write the process ID to FILE. Delete the FILE on exit. Failiure
404     to create or delete the FILE is non-fatal. If no FILE option is given, no
405     PID file will be used. Unix only.
406    
407   * --user USER[.GROUP]
408    
409     After (optionally) writing the PID file, assume the user ID of USER, and if
410     included the GID of GROUP. Exit if the privileges are not sufficient to do
411     so. Unix only.
412    
413   * configfile
414    
415     If no configfile is included on the command line, Privoxy will look for a
416     file named "config" in the current directory (except on Win32 where it will
417     look for "config.txt" instead). Specify full path to avoid confusion.
418    
419 -------------------------------------------------------------------------------
420
421 4. Privoxy Configuration
422
423 All Privoxy configuration is kept in text files. These files can be edited with
424 a text editor. Many important aspects of Privoxy can also be controlled easily
425 with a web browser.
426
427 -------------------------------------------------------------------------------
428
429 4.1. Controlling Privoxy with Your Web Browser
430
431 Privoxy can be reached by the special URL http://p.p/ (or alternately http://
432 config.privoxy.org/), which is an internal page. You will see the following
433 section: 
434
435 Please choose from the following options:                                      
436                                                                                
437     * Show information about the current configuration                         
438     * Show the source code version numbers                                     
439     * Show the client's request headers.                                       
440     * Show which actions apply to a URL and why                                
441     * Toggle Privoxy on or off                                                 
442     * Edit the actions list                                                    
443                                                                                
444                                                                                
445
446 This should be self-explanatory. Note the last item is an editor for the
447 "actions list", which is where much of the ad, banner, cookie, and URL blocking
448 magic is configured as well as other advanced features of Privoxy. This is an
449 easy way to adjust various aspects of Privoxy configuration. The actions file,
450 and other configuration files, are explained in detail below. Privoxy will
451 automatically detect any changes to these files.
452
453 "Toggle Privoxy On or Off" is handy for sites that might have problems with
454 your current actions and filters, or just to test if a site misbehaves, whether
455 it is Privoxy causing the problem or not. Privoxy continues to run as a proxy
456 in this case, but all filtering is disabled. 
457
458 -------------------------------------------------------------------------------
459
460 4.2. Configuration Files Overview
461
462 For Unix, *BSD and Linux, all configuration files are located in /etc/privoxy/
463 by default. For MS Windows, OS/2, and AmigaOS these are all in the same
464 directory as the Privoxy executable. The name and number of configuration files
465 has changed from previous versions, and is subject to change as development
466 progresses.
467
468 The installed defaults provide a reasonable starting point, though possibly
469 aggressive by some standards. For the time being, there are only three default
470 configuration files (this will change in time):
471
472   * The main configuration file is named config on Linux, Unix, BSD, OS/2, and
473     AmigaOS and config.txt on Windows.
474    
475   * The default.action file is used to define various "actions" relating to
476     images, banners, pop-ups, access restrictions, banners and cookies. There
477     is a CGI based editor for this file that can be accessed via http://p.p.
478     (Other actions files are included as well with differing levels of
479     filtering and blocking, e.g. ijb-basic.action.)
480    
481   * The default.filter file can be used to re-write the raw page content,
482     including viewable text as well as embedded HTML and JavaScript, and
483     whatever else lurks on any given web page.
484    
485 default.action and default.filter can use Perl style regular expressions for
486 maximum flexibility. All files use the "#" character to denote a comment. Such
487 lines are not processed by Privoxy. After making any changes, there is no need
488 to restart Privoxy in order for the changes to take effect. Privoxy should
489 detect such changes automatically.
490
491 While under development, the configuration content is subject to change. The
492 below documentation may not be accurate by the time you read this. Also, what
493 constitutes a "default" setting, may change, so please check all your
494 configuration files on important issues.
495
496 -------------------------------------------------------------------------------
497
498 4.3. The Main Configuration File
499
500 Again, the main configuration file is named config on Linux/Unix/BSD and OS/2,
501 and config.txt on Windows. Configuration lines consist of an initial keyword
502 followed by a list of values, all separated by whitespace (any number of spaces
503 or tabs). For example:
504
505   blockfile blocklist.ini
506    
507
508 Indicates that the blockfile is named "blocklist.ini". (A default installation
509 does not use this.)
510
511 A "#" indicates a comment. Any part of a line following a "#" is ignored,
512 except if the "#" is preceded by a "\".
513
514 Thus, by placing a "#" at the start of an existing configuration line, you can
515 make it a comment and it will be treated as if it weren't there. This is called
516 "commenting out" an option and can be useful to turn off features: If you
517 comment out the "logfile" line, Privoxy will not log to a file at all. Watch
518 for the "default:" section in each explanation to see what happens if the
519 option is left unset (or commented out).
520
521 Long lines can be continued on the next line by using a "\" as the very last
522 character.
523
524 There are various aspects of Privoxy behavior that can be tuned.
525
526 -------------------------------------------------------------------------------
527
528 4.3.1. Defining Other Configuration Files
529
530 Privoxy can use a number of other files to tell it what ads to block, what
531 cookies to accept, etc. This section of the configuration file tells Privoxy
532 where to find all those other files.
533
534 On Windows and AmigaOS, Privoxy looks for these files in the same directory as
535 the executable. On Unix and OS/2, Privoxy looks for these files in the current
536 working directory. In either case, an absolute path name can be used to avoid
537 problems.
538
539 When development goes modular and multi-user, the blocker, filter, and per-user
540 config will be stored in subdirectories of "confdir". For now, only confdir/
541 templates is used for storing HTML templates for CGI results.
542
543 The location of the configuration files:
544
545   confdir /etc/privoxy       # No trailing /, please.
546    
547
548 The directory where all logging (i.e. logfile and jarfile) takes place. No
549 trailing "/", please:
550
551   logdir /var/log/privoxy
552    
553
554 Note that all file specifications below are relative to the above two
555 directories!
556
557 The "default.action" file contains patterns to specify the actions to apply to
558 requests for each site. Default: Cookies to and from all destinations are kept
559 only during the current browser session (i.e. they are not saved to disk).
560 Pop-ups are disabled for all sites. All sites are filtered through selected
561 sections of "default.filter". No sites are blocked. Privoxy displays a
562 checkboard type pattern for filtered ads and other images. The syntax of this
563 file is explained in detail below. Other "actions" files are included, and you
564 are free to use any of them. They have varying degrees of aggressiveness.
565
566   actionsfile default.action
567    
568
569 The "default.filter" file contains content modification rules that use "regular
570 expressions". These rules permit powerful changes on the content of Web pages,
571 e.g., you could disable your favorite JavaScript annoyances, re-write the
572 actual displayed text, or just have some fun replacing "Microsoft" with
573 "MicroSuck" wherever it appears on a Web page. Default: whatever the developers
574 are playing with :-/
575
576 Filtering requires buffering the page content, which may appear to slow down
577 page rendering since nothing is displayed until all content has passed the
578 filters. (It does not really take longer, but seems that way since the page is
579 not incrementally displayed.) This effect will be more noticeable on slower
580 connections. 
581
582   filterfile default.filter
583    
584
585 The logfile is where all logging and error messages are written. The logfile
586 can be useful for tracking down a problem with Privoxy (e.g., it's not blocking
587 an ad you think it should block) but in most cases you probably will never look
588 at it.
589
590 Your logfile will grow indefinitely, and you will probably want to periodically
591 remove it. On Unix systems, you can do this with a cron job (see "man cron").
592 For Redhat, a logrotate script has been included.
593
594 On SuSE Linux systems, you can place a line like "/var/log/privoxy.* +1024k 644
595 nobody.nogroup" in /etc/logfiles, with the effect that cron.daily will
596 automatically archive, gzip, and empty the log, when it exceeds 1M size.
597
598 Default: Log to the a file named logfile. Comment out to disable logging.
599
600   logfile logfile
601    
602
603 The "jarfile" defines where Privoxy stores the cookies it intercepts. Note that
604 if you use a "jarfile", it may grow quite large. Default: Don't store
605 intercepted cookies.
606
607   #jarfile jarfile
608    
609
610 If you specify a "trustfile", Privoxy will only allow access to sites that are
611 named in the trustfile. You can also mark sites as trusted referrers, with the
612 effect that access to untrusted sites will be granted, if a link from a trusted
613 referrer was used. The link target will then be added to the "trustfile". This
614 is a very restrictive feature that typical users most probably want to leave
615 disabled. Default: Disabled, don't use the trust mechanism.
616
617   #trustfile trust
618    
619
620 If you use the trust mechanism, it is a good idea to write up some on-line
621 documentation about your blocking policy and to specify the URL(s) here. They
622 will appear on the page that your users receive when they try to access
623 untrusted content. Use multiple times for multiple URLs. Default: Don't display
624 links on the "untrusted" info page.
625
626   trust-info-url http://www.your-site.com/why_we_block.html
627   trust-info-url http://www.your-site.com/what_we_allow.html
628    
629
630 -------------------------------------------------------------------------------
631
632 4.3.2. Other Configuration Options
633
634 This part of the configuration file contains options that control how Privoxy
635 operates.
636
637 "Admin-address" should be set to the email address of the proxy administrator.
638 It is used in many of the proxy-generated pages. Default: fill@me.in.please.
639
640   #admin-address fill@me.in.please
641    
642
643 "Proxy-info-url" can be set to a URL that contains more info about this Privoxy
644 installation, it's configuration and policies. It is used in many of the
645 proxy-generated pages and its use is highly recommended in multi-user
646 installations, since your users will want to know why certain content is
647 blocked or modified. Default: Don't show a link to on-line documentation.
648
649   proxy-info-url http://www.your-site.com/proxy.html
650    
651
652 "Listen-address" specifies the address and port where Privoxy will listen for
653 connections from your Web browser. The default is to listen on the localhost
654 port 8118, and this is suitable for most users. (In your web browser, under
655 proxy configuration, list the proxy server as "localhost" and the port as
656 "8118").
657
658 If you already have another service running on port 8118, or if you want to
659 serve requests from other machines (e.g. on your local network) as well, you
660 will need to override the default. The syntax is "listen-address
661 [<ip-address>]:<port>". If you leave out the IP address, Privoxy will bind to
662 all interfaces (addresses) on your machine and may become reachable from the
663 Internet. In that case, consider using access control lists (acl's) (see
664 "aclfile" above), or a firewall.
665
666 For example, suppose you are running Privoxy on a machine which has the address
667 192.168.0.1 on your local private network (192.168.0.0) and has another outside
668 connection with a different address. You want it to serve requests from inside
669 only:
670
671   listen-address 192.168.0.1:8118
672    
673
674 If you want it to listen on all addresses (including the outside connection):
675
676   listen-address :8118
677    
678
679 If you do this, consider using ACLs (see "aclfile" above). Note: you will need
680 to point your browser(s) to the address and port that you have configured here.
681 Default: localhost:8118 (127.0.0.1:8118).
682
683 The debug option sets the level of debugging information to log in the logfile
684 (and to the console in the Windows version). A debug level of 1 is informative
685 because it will show you each request as it happens. Higher levels of debug are
686 probably only of interest to developers.
687
688   debug         1 # GPC   = show each GET/POST/CONNECT request
689   debug         2 # CONN  = show each connection status
690   debug         4 # IO    = show I/O status
691   debug         8 # HDR   = show header parsing
692   debug        16 # LOG   = log all data into the logfile
693   debug        32 # FRC   = debug force feature
694   debug        64 # REF   = debug regular expression filter 
695   debug       128 #       = debug fast redirects
696   debug       256 #       = debug GIF de-animation
697   debug       512 # CLF   = Common Log Format
698   debug      1024 #       = debug kill pop-ups
699   debug      4096 # INFO  = Startup banner and warnings.
700   debug      8192 # ERROR = Non-fatal errors
701     
702
703 It is highly recommended that you enable ERROR reporting (debug 8192), at least
704 until v3.0 is released.
705
706 The reporting of FATAL errors (i.e. ones which crash Privoxy) is always on and
707 cannot be disabled.
708
709 If you want to use CLF (Common Log Format), you should set "debug 512" ONLY, do
710 not enable anything else.
711
712 Multiple "debug" directives, are OK - they're logical-OR'd together.
713
714   debug 15 # same as setting the first 4 listed above
715    
716
717 Default:
718
719   debug 1 # URLs
720   debug 4096 # Info
721   debug 8192 # Errors - *we highly recommended enabling this*
722    
723
724 Privoxy normally uses "multi-threading", a software technique that permits it
725 to handle many different requests simultaneously. In some cases you may wish to
726 disable this -- particularly if you're trying to debug a problem. The
727 "single-threaded" option forces Privoxy to handle requests sequentially.
728 Default: Multi-threaded mode.
729
730   #single-threaded
731    
732
733 "toggle" allows you to temporarily disable all Privoxy's filtering. Just set
734 "toggle 0".
735
736 The Windows version of Privoxy puts an icon in the system tray, which also
737 allows you to change this option. If you right-click on that icon (or select
738 the "Options" menu), one choice is "Enable". Clicking on enable toggles Privoxy
739 on and off. This is useful if you want to temporarily disable Privoxy, e.g., to
740 access a site that requires cookies which you would otherwise have blocked.
741 This can also be toggled via a web browser at the Privoxy internal address of 
742 http://p.p on any platform.
743
744 "toggle 1" means Privoxy runs normally, "toggle 0" means that Privoxy becomes a
745 non-anonymizing non-blocking proxy. Default: 1 (on).
746
747   toggle 1
748    
749
750 For content filtering, i.e. the "+filter" and "+deanimate-gif" actions, it is
751 necessary that Privoxy buffers the entire document body. This can be
752 potentially dangerous, since a server could just keep sending data indefinitely
753 and wait for your RAM to exhaust. With nasty consequences.
754
755 The buffer-limit option lets you set the maximum size in Kbytes that each
756 buffer may use. When the documents buffer exceeds this size, it is flushed to
757 the client unfiltered and no further attempt to filter the rest of it is made.
758 Remember that there may multiple threads running, which might require
759 increasing the "buffer-limit" Kbytes each, unless you have enabled
760 "single-threaded" above.
761
762   buffer-limit 4069
763    
764
765 To enable the web-based default.action file editor set enable-edit-actions to
766 1, or 0 to disable. Note that you must have compiled Privoxy with support for
767 this feature, otherwise this option has no effect. This internal page can be
768 reached at http://p.p.
769
770 Security note: If this is enabled, anyone who can use the proxy can edit the
771 actions file, and their changes will affect all users. For shared proxies, you
772 probably want to disable this. Default: enabled.
773
774   enable-edit-actions 1
775    
776
777 Allow Privoxy to be toggled on and off remotely, using your web browser. Set
778 "enable-remote-toggle"to 1 to enable, and 0 to disable. Note that you must have
779 compiled Privoxy with support for this feature, otherwise this option has no
780 effect.
781
782 Security note: If this is enabled, anyone who can use the proxy can toggle it
783 on or off (see http://p.p), and their changes will affect all users. For shared
784 proxies, you probably want to disable this. Default: enabled.
785
786   enable-remote-toggle 1
787    
788
789 -------------------------------------------------------------------------------
790
791 4.3.3. Access Control List (ACL)
792
793 Access controls are included at the request of some ISPs and systems
794 administrators, and are not usually needed by individual users. Please note the
795 warnings in the FAQ that this proxy is not intended to be a substitute for a
796 firewall or to encourage anyone to defer addressing basic security weaknesses.
797
798 If no access settings are specified, the proxy talks to anyone that connects.
799 If any access settings file are specified, then the proxy talks only to IP
800 addresses permitted somewhere in this file and not denied later in this file.
801
802 Summary -- if using an ACL:
803
804 Client must have permission to receive service.
805
806 LAST match in ACL wins.
807
808 Default behavior is to deny service.
809
810 The syntax for an entry in the Access Control List is:
811
812   ACTION    SRC_ADDR[/SRC_MASKLEN]    [ DST_ADDR[/DST_MASKLEN] ]
813    
814
815 Where the individual fields are:
816
817  ACTION      = "permit-access" or "deny-access"
818
819  SRC_ADDR    = client hostname or dotted IP address
820  SRC_MASKLEN = number of bits in the subnet mask for the source
821
822  DST_ADDR    = server or forwarder hostname or dotted IP address
823  DST_MASKLEN = number of bits in the subnet mask for the target
824    
825
826 The field separator (FS) is whitespace (space or tab).
827
828 IMPORTANT NOTE: If Privoxy is using a forwarder (see below) or a gateway for a
829 particular destination URL, the DST_ADDR that is examined is the address of the
830 forwarder or the gateway and NOT the address of the ultimate target. This is
831 necessary because it may be impossible for the local Privoxy to determine the
832 address of the ultimate target (that's often what gateways are used for).
833
834 Here are a few examples to show how the ACL features work:
835
836 "localhost" is OK -- no DST_ADDR implies that ALL destination addresses are OK:
837
838   permit-access localhost
839    
840
841 A silly example to illustrate permitting any host on the class-C subnet with
842 Privoxy to go anywhere:
843
844   permit-access www.privoxy.com/24
845    
846
847 Except deny one particular IP address from using it at all:
848
849   deny-access ident.privoxy.com
850    
851
852 You can also specify an explicit network address and subnet mask. Explicit
853 addresses do not have to be resolved to be used.
854
855   permit-access 207.153.200.0/24
856    
857
858 A subnet mask of 0 matches anything, so the next line permits everyone.
859
860   permit-access 0.0.0.0/0
861    
862
863 Note, you cannot say:
864
865   permit-access .org
866    
867
868 to allow all *.org domains. Every IP address listed must resolve fully.
869
870 An ISP may want to provide a Privoxy that is accessible by "the world" and yet
871 restrict use of some of their private content to hosts on its internal network
872 (i.e. its own subscribers). Say, for instance the ISP owns the Class-B IP
873 address block 123.124.0.0 (a 16 bit netmask). This is how they could do it:
874
875  permit-access 0.0.0.0/0 0.0.0.0/0   # other clients can go anywhere 
876                                        # with the following exceptions:
877  
878  deny-access   0.0.0.0/0   123.124.0.0/16 # block all external requests for
879                                           # sites on the ISP's network
880
881  permit 0.0.0.0/0 www.my_isp.com        # except for the ISP's main 
882                                           # web site
883
884  permit 123.124.0.0/16 0.0.0.0/0          # the ISP's clients can go 
885                                           # anywhere
886    
887
888 Note that if some hostnames are listed with multiple IP addresses, the primary
889 value returned by DNS (via gethostbyname()) is used. Default: Anyone can access
890 the proxy.
891
892 -------------------------------------------------------------------------------
893
894 4.3.4. Forwarding
895
896 This feature allows chaining of HTTP requests via multiple proxies. It can be
897 used to better protect privacy and confidentiality when accessing specific
898 domains by routing requests to those domains to a special purpose filtering
899 proxy such as lpwa.com. Or to use a caching proxy to speed up browsing.
900
901 It can also be used in an environment with multiple networks to route requests
902 via multiple gateways allowing transparent access to multiple networks without
903 having to modify browser configurations.
904
905 Also specified here are SOCKS proxies. Privoxy SOCKS 4 and SOCKS 4A. The
906 difference is that SOCKS 4A will resolve the target hostname using DNS on the
907 SOCKS server, not our local DNS client.
908
909 The syntax of each line is:
910
911  forward target_domain[:port] http_proxy_host[:port]
912  forward-socks4 target_domain[:port] socks_proxy_host[:port] http_proxy_host[:
913 port]
914  forward-socks4a target_domain[:port] socks_proxy_host[:port] http_proxy_host[:
915 port]
916    
917
918 If http_proxy_host is ".", then requests are not forwarded to a HTTP proxy but
919 are made directly to the web servers.
920
921 Lines are checked in sequence, and the last match wins.
922
923 There is an implicit line equivalent to the following, which specifies that
924 anything not finding a match on the list is to go out without forwarding or
925 gateway protocol, like so:
926
927   forward .* . # implicit
928    
929
930 In the following common configuration, everything goes to Lucent's LPWA, except
931 SSL on port 443 (which it doesn't handle):
932
933  forward .* lpwa.com:8000
934  forward :443 .
935    
936
937 Some users have reported difficulties related to LPWA's use of "." as the last
938 element of the domain, and have said that this can be fixed with this:
939
940   forward lpwa. lpwa.com:8000
941    
942
943 (NOTE: the syntax for specifying target_domain has changed since the previous
944 paragraph was written -- it will not work now. More information is welcome.)
945
946 In this fictitious example, everything goes via an ISP's caching proxy, except
947 requests to that ISP:
948
949  forward .* caching.myisp.net:8000
950  forward myisp.net .
951    
952
953 For the @home network, we're told the forwarding configuration is this:
954
955   forward .* proxy:8080
956    
957
958 Also, we're told they insist on getting cookies and JavaScript, so you should
959 allow cookies from home.com. We consider JavaScript a potential security risk.
960 Java need not be enabled.
961
962 In this example direct connections are made to all "internal" domains, but
963 everything else goes through Lucent's LPWA by way of the company's SOCKS
964 gateway to the Internet.
965
966  forward-socks4 .* lpwa.com:8000 firewall.my_company.com:1080
967  forward my_company.com .
968    
969
970 This is how you could set up a site that always uses SOCKS but no forwarders:
971
972   forward-socks4a .* . firewall.my_company.com:1080
973    
974
975 An advanced example for network administrators:
976
977 If you have links to multiple ISPs that provide various special content to
978 their subscribers, you can configure forwarding to pass requests to the
979 specific host that's connected to that ISP so that everybody can see all of the
980 content on all of the ISPs.
981
982 This is a bit tricky, but here's an example:
983
984 host-a has a PPP connection to isp-a.com. And host-b has a PPP connection to
985 isp-b.com. host-a can run a Privoxy proxy with forwarding like this:
986
987  forward .* .
988  forward isp-b.com host-b:8118
989    
990
991 host-b can run a Privoxy proxy with forwarding like this:
992
993  forward .* .
994  forward isp-a.com host-a:8118
995    
996
997 Now, anyone on the Internet (including users on host-a and host-b) can set
998 their browser's proxy to either host-a or host-b and be able to browse the
999 content on isp-a or isp-b.
1000
1001 Here's another practical example, for University of Kent at Canterbury students
1002 with a network connection in their room, who need to use the University's Squid
1003 web cache.
1004
1005  forward *. ssbcache.ukc.ac.uk:3128  # Use the proxy, except for:
1006  forward .ukc.ac.uk .  # Anything on the same domain as us
1007  forward * .  # Host with no domain specified
1008  forward 129.12.*.* .  # A dotted IP on our /16 network.
1009  forward 127.*.*.* .  # Loopback address
1010  forward localhost.localdomain .  # Loopback address
1011  forward www.ukc.mirror.ac.uk .  # Specific host
1012    
1013
1014 If you intend to chain Privoxy and squid locally, then chain as browser ->
1015 squid -> privoxy is the recommended way.
1016
1017 Your squid configuration could then look like this:
1018
1019   # Define Privoxy as parent cache 
1020   
1021   cache_peer 127.0.0.1 parent 8118 0 no-query
1022   
1023   # Define ACL for protocol FTP 
1024   acl FTP proto FTP 
1025
1026   # Do not forward ACL FTP to privoxy
1027   always_direct allow FTP 
1028
1029   # Do not forward ACL CONNECT (https) to privoxy
1030   always_direct allow CONNECT 
1031
1032   # Forward the rest to privoxy
1033   never_direct allow all 
1034    
1035
1036 -------------------------------------------------------------------------------
1037
1038 4.3.5. Windows GUI Options
1039
1040 Privoxy has a number of options specific to the Windows GUI interface:
1041
1042 If "activity-animation" is set to 1, the Privoxy icon will animate when
1043 "Privoxy" is active. To turn off, set to 0.
1044
1045   activity-animation 1
1046    
1047
1048 If "log-messages" is set to 1, Privoxy will log messages to the console window:
1049
1050   log-messages 1
1051    
1052
1053 If "log-buffer-size" is set to 1, the size of the log buffer, i.e. the amount
1054 of memory used for the log messages displayed in the console window, will be
1055 limited to "log-max-lines" (see below).
1056
1057 Warning: Setting this to 0 will result in the buffer to grow infinitely and eat
1058 up all your memory!
1059
1060   log-buffer-size 1
1061    
1062
1063 log-max-lines is the maximum number of lines held in the log buffer. See above.
1064
1065   log-max-lines 200
1066    
1067
1068 If "log-highlight-messages" is set to 1, Privoxy will highlight portions of the
1069 log messages with a bold-faced font:
1070
1071   log-highlight-messages 1
1072    
1073
1074 The font used in the console window:
1075
1076   log-font-name Comic Sans MS
1077    
1078
1079 Font size used in the console window:
1080
1081   log-font-size 8
1082    
1083
1084 "show-on-task-bar" controls whether or not Privoxy will appear as a button on
1085 the Task bar when minimized:
1086
1087   show-on-task-bar 0
1088    
1089
1090 If "close-button-minimizes" is set to 1, the Windows close button will minimize
1091 Privoxy instead of closing the program (close with the exit option on the File
1092 menu).
1093
1094   close-button-minimizes 1
1095    
1096
1097 The "hide-console" option is specific to the MS-Win console version of Privoxy.
1098 If this option is used, Privoxy will disconnect from and hide the command
1099 console.
1100
1101   #hide-console
1102    
1103
1104 -------------------------------------------------------------------------------
1105
1106 4.4. The Actions File
1107
1108 The "default.action" file (formerly actionsfile or ijb.action) is used to
1109 define what actions Privoxy takes, and thus determines how images, cookies and
1110 various other aspects of HTTP content and transactions are handled. Images can
1111 be anything you want, including ads, banners, or just some obnoxious URL that
1112 you would rather not see. Cookies can be accepted or rejected, or accepted only
1113 during the current browser session (i.e. not written to disk). Changes to
1114 default.action should be immediately visible to Privoxy without the need to
1115 restart.
1116
1117 The easiest way to edit "actions" file is with a browser by loading http://p.p/
1118 , and then select "Edit Actions List". A text editor can also be used.
1119
1120 To determine which actions apply to a request, the URL of the request is
1121 compared to all patterns in this file. Every time it matches, the list of
1122 applicable actions for the URL is incrementally updated. You can trace this
1123 process by visiting http://p.p/show-url-info.
1124
1125 There are four types of lines in this file: comments (begin with a "#"
1126 character), actions, aliases and patterns, all of which are explained below, as
1127 well as the configuration file syntax that Privoxy understands. 
1128
1129 -------------------------------------------------------------------------------
1130
1131 4.4.1. URL Domain and Path Syntax
1132
1133 Generally, a pattern has the form <domain>/<path>, where both the <domain> and
1134 <path> part are optional. If you only specify a domain part, the "/" can be
1135 left out:
1136
1137 www.example.com - is a domain only pattern and will match any request to
1138 "www.example.com".
1139
1140 www.example.com/ - means exactly the same.
1141
1142 www.example.com/index.html - matches only the single document "/index.html" on
1143 "www.example.com".
1144
1145 /index.html - matches the document "/index.html", regardless of the domain.
1146
1147 index.html - matches nothing, since it would be interpreted as a domain name
1148 and there is no top-level domain called ".html".
1149
1150 The matching of the domain part offers some flexible options: if the domain
1151 starts or ends with a dot, it becomes unanchored at that end. For example:
1152
1153 .example.com - matches any domain that ENDS in ".example.com".
1154
1155 www. - matches any domain that STARTS with "www".
1156
1157 Additionally, there are wild-cards that you can use in the domain names
1158 themselves. They work pretty similar to shell wild-cards: "*" stands for zero
1159 or more arbitrary characters, "?" stands for any single character. And you can
1160 define character classes in square brackets and they can be freely mixed:
1161
1162 ad*.example.com - matches "adserver.example.com", "ads.example.com", etc but
1163 not "sfads.example.com".
1164
1165 *ad*.example.com - matches all of the above, and then some.
1166
1167 .?pix.com - matches "www.ipix.com", "pictures.epix.com", "a.b.c.d.e.upix.com",
1168 etc.
1169
1170 www[1-9a-ez].example.com - matches "www1.example.com", "www4.example.com",
1171 "wwwd.example.com", "wwwz.example.com", etc., but not "wwww.example.com".
1172
1173 If Privoxy was compiled with "pcre" support (default), Perl compatible regular
1174 expressions can be used. See the pcre/docs/ directory or "man perlre" (also
1175 available on http://www.perldoc.com/perl5.6/pod/perlre.html) for details. A
1176 brief discussion of regular expressions is in the Appendix. For instance:
1177
1178 /.*/advert[0-9]+\.jpe?g - would match a URL from any domain, with any path that
1179 includes "advert" followed immediately by one or more digits, then a "." and
1180 ending in either "jpeg" or "jpg". So we match "example.com/ads/advert2.jpg",
1181 and "www.example.com/ads/banners/advert39.jpeg", but not "www.example.com/ads/
1182 banners/advert39.gif" (no gifs in the example pattern).
1183
1184 Please note that matching in the path is case INSENSITIVE by default, but you
1185 can switch to case sensitive at any point in the pattern by using the "(?-i)"
1186 switch:
1187
1188 www.example.com/(?-i)PaTtErN.* - will match only documents whose path starts
1189 with "PaTtErN" in exactly this capitalization.
1190
1191 -------------------------------------------------------------------------------
1192
1193 4.4.2. Actions
1194
1195 Actions are enabled if preceded with a "+", and disabled if preceded with a
1196 "-". Actions are invoked by enclosing the action name in curly braces (e.g.
1197 {+some_action}), followed by a list of URLs to which the action applies. There
1198 are three classes of actions:
1199
1200   * Boolean (e.g. "+/-block"):
1201    
1202       {+name}        # enable this action
1203       {-name}        # disable this action
1204          
1205    
1206   * parameterized (e.g. "+/-hide-user-agent"):
1207    
1208       {+name{param}}  # enable action and set parameter to "param"
1209       {-name}         # disable action
1210          
1211    
1212   * Multi-value (e.g. "{+/-add-header{Name: value}}", "{+/-wafer{name=value}}
1213     "):
1214    
1215       {+name{param}}   # enable action and add parameter "param"
1216       {-name{param}}   # remove the parameter "param"
1217       {-name}          # disable this action totally
1218          
1219    
1220 If nothing is specified in this file, no "actions" are taken. So in this case
1221 Privoxy would just be a normal, non-blocking, non-anonymizing proxy. You must
1222 specifically enable the privacy and blocking features you need (although the
1223 provided default default.action file will give a good starting point).
1224
1225 Later defined actions always over-ride earlier ones. For multi-valued actions,
1226 the actions are applied in the order they are specified.
1227
1228 The list of valid Privoxy "actions" are:
1229
1230   * Add the specified HTTP header, which is not checked for validity. You may
1231     specify this many times to specify many different headers:
1232    
1233       +add-header{Name: value}
1234          
1235    
1236   * Block this URL totally. In a default installation, a "blocked" URL will
1237     result in bright red banner that says "BLOCKED", with a reason why it is
1238     being blocked.
1239    
1240       +block
1241          
1242    
1243   * De-animate all animated GIF images, i.e. reduce them to their last frame.
1244     This will also shrink the images considerably (in bytes, not pixels!). If
1245     the option "first" is given, the first frame of the animation is used as
1246     the replacement. If "last" is given, the last frame of the animation is
1247     used instead, which probably makes more sense for most banner animations,
1248     but also has the risk of not showing the entire last frame (if it is only a
1249     delta to an earlier frame).
1250    
1251       +deanimate-gifs{last}
1252       +deanimate-gifs{first}
1253          
1254    
1255   * "+downgrade" will downgrade HTTP/1.1 client requests to HTTP/1.0 and
1256     downgrade the responses as well. Use this action for servers that use HTTP/
1257     1.1 protocol features that Privoxy doesn't handle well yet. HTTP/1.1 is
1258     only partially implemented. Default is not to downgrade requests.
1259    
1260       +downgrade
1261          
1262    
1263   * Many sites, like yahoo.com, don't just link to other sites. Instead, they
1264     will link to some script on their own server, giving the destination as a
1265     parameter, which will then redirect you to the final target. URLs resulting
1266     from this scheme typically look like: http://some.place/some_script?http://
1267     some.where-else.
1268    
1269     Sometimes, there are even multiple consecutive redirects encoded in the
1270     URL. These redirections via scripts make your web browsing more traceable,
1271     since the server from which you follow such a link can see where you go to.
1272     Apart from that, valuable bandwidth and time is wasted, while your browser
1273     ask the server for one redirect after the other. Plus, it feeds the
1274     advertisers.
1275    
1276     The "+fast-redirects" option enables interception of these types of
1277     requests by Privoxy, who will cut off all but the last valid URL in the
1278     request and send a local redirect back to your browser without contacting
1279     the intermediate site(s).
1280    
1281       +fast-redirects
1282          
1283    
1284   * Apply the filters in the section_header section of the default.filter file
1285     to the site(s). default.filter sections are grouped according to like
1286     functionality.
1287    
1288      +filter{section_header}
1289          
1290    
1291     Filter sections that are pre-defined in the supplied default.filter
1292     include:
1293    
1294         html-annoyances: Get rid of particularly annoying HTML abuse.
1295        
1296         js-annoyances: Get rid of particularly annoying JavaScript abuse
1297        
1298         no-poups: Kill all popups in JS and HTML
1299        
1300         frameset-borders: Give frames a border
1301        
1302         webbugs: Squish WebBugs (1x1 invisible GIFs used for user tracking)
1303        
1304         no-refresh: Automatic refresh sucks on auto-dialup lines
1305        
1306         fun: Text replacements for subversive browsing fun!
1307        
1308         nimda: Remove (virus) Nimda code.
1309        
1310         banners-by-size: Kill banners by size
1311        
1312         crude-parental: Kill all web pages that contain the words "sex" or     
1313         "warez"                                                                
1314        
1315   * Block any existing X-Forwarded-for header, and do not add a new one:
1316    
1317       +hide-forwarded
1318          
1319    
1320   * If the browser sends a "From:" header containing your e-mail address, this
1321     either completely removes the header ("block"), or changes it to the
1322     specified e-mail address.
1323    
1324       +hide-from{block}
1325       +hide-from{spam@sittingduck.xqq}
1326          
1327    
1328   * Don't send the "Referer:" (sic) header to the web site. You can block it,
1329     forge a URL to the same server as the request (which is preferred because
1330     some sites will not send images otherwise) or set it to a constant string
1331     of your choice.
1332    
1333       +hide-referer{block}
1334       +hide-referer{forge}
1335       +hide-referer{http://nowhere.com}
1336          
1337    
1338   * Alternative spelling of "+hide-referer". It has the same parameters, and
1339     can be freely mixed with, "+hide-referer". ("referrer" is the correct
1340     English spelling, however the HTTP specification has a bug - it requires it
1341     to be spelled "referer".)
1342    
1343       +hide-referrer{...}
1344          
1345    
1346   * Change the "User-Agent:" header so web servers can't tell your browser
1347     type. Warning! This breaks many web sites. Specify the user-agent value you
1348     want. Example, pretend to be using Netscape on Linux:
1349    
1350       +hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)}
1351          
1352    
1353   * Treat this URL as an image. This only matters if it's also "+block"ed, in
1354     which case a "blocked" image can be sent rather than a HTML page. See
1355     "+image-blocker{}" below for the control over what is actually sent. If you
1356     want invisible ads, they should be defined as images and blocked. And also,
1357     "image-blocker" should be set to "blank".
1358    
1359       +image
1360          
1361    
1362   * Decides what to do with URLs that end up tagged with "{+block +image}", e.g
1363     an advertizement. There are five options. "-image-blocker" will send a HTML
1364     "blocked" page, usually resulting in a "broken image" icon. "+image-blocker
1365     {blank}" will send a 1x1 transparent GIF image. And finally,
1366     "+image-blocker{http://xyz.com}" will send a HTTP temporary redirect to the
1367     specified image. This has the advantage of the icon being being cached by
1368     the browser, which will speed up the display. "+image-blocker{pattern}"
1369     will send a checkboard type pattern
1370    
1371       +image-blocker{blank}
1372       +image-blocker{pattern}
1373       +image-blocker{http://p.p/send-banner}
1374          
1375    
1376   * By default (i.e. in the absence of a "+limit-connect" action), Privoxy will
1377     only allow CONNECT requests to port 443, which is the standard port for
1378     https as a precaution.
1379    
1380     The CONNECT methods exists in HTTP to allow access to secure websites
1381     (https:// URLs) through proxies. It works very simply: the proxy connects
1382     to the server on the specified port, and then short-circuits its
1383     connections to the client and to the remote proxy. This can be a big
1384     security hole, since CONNECT-enabled proxies can be abused as TCP relays
1385     very easily.
1386    
1387     If you want to allow CONNECT for more ports than this, or want to forbid
1388     CONNECT altogether, you can specify a comma separated list of ports and
1389     port ranges (the latter using dashes, with the minimum defaulting to 0 and
1390     max to 65K):
1391    
1392       +limit-connect{443} # This is the default and need no be specified.
1393       +limit-connect{80,443} # Ports 80 and 443 are OK.
1394       +limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100
1395        #and above 500 are OK.
1396          
1397    
1398   * "+no-compression" prevents the website from compressing the data. Some
1399     websites do this, which can be a problem for Privoxy, since "+filter",
1400     "+no-popup" and "+gif-deanimate" will not work on compressed data. This
1401     will slow down connections to those websites, though. Default is
1402     "nocompression" is turned on.
1403    
1404       +nocompression
1405          
1406    
1407   * If the website sets cookies, "no-cookies-keep" will make sure they are
1408     erased when you exit and restart your web browser. This makes profiling
1409     cookies useless, but won't break sites which require cookies so that you
1410     can log in for transactions. Default: on.
1411    
1412       +no-cookies-keep
1413          
1414    
1415   * Prevent the website from reading cookies:
1416    
1417       +no-cookies-read
1418          
1419    
1420   * Prevent the website from setting cookies:
1421    
1422       +no-cookies-set
1423          
1424    
1425   * Filter the website through a built-in filter to disable those obnoxious
1426     JavaScript pop-up windows via window.open(), etc. The two alternative
1427     spellings are equivalent.
1428    
1429       +no-popup
1430       +no-popups
1431          
1432    
1433   * This action only applies if you are using a jarfile for saving cookies. It
1434     sends a cookie to every site stating that you do not accept any copyright
1435     on cookies sent to you, and asking them not to track you. Of course, this
1436     is a (relatively) unique header they could use to track you.
1437    
1438       +vanilla-wafer
1439          
1440    
1441   * This allows you to add an arbitrary cookie. It can be specified multiple
1442     times in order to add as many cookies as you like.
1443    
1444       +wafer{name=value}
1445          
1446    
1447 The meaning of any of the above is reversed by preceding the action with a "-",
1448 in place of the "+".
1449
1450 Some examples:
1451
1452 Turn off cookies by default, then allow a few through for specified sites:
1453
1454  # Turn off all persistent cookies
1455  { +no-cookies-read }
1456  { +no-cookies-set }
1457  # Allow cookies for this browser session ONLY
1458  { +no-cookies-keep }
1459
1460  # Exceptions to the above, sites that benefit from persistent cookies
1461  { -no-cookies-read }
1462  { -no-cookies-set }
1463  { -no-cookies-keep }
1464  .javasoft.com
1465  .sun.com
1466  .yahoo.com
1467  .msdn.microsoft.com
1468  .redhat.com
1469
1470  # Alternative way of saying the same thing
1471  {-no-cookies-set -no-cookies-read -no-cookies-keep}
1472  .sourceforge.net
1473  .sf.net
1474    
1475
1476 Now turn off "fast redirects", and then we allow two exceptions:
1477
1478  # Turn them off!
1479  {+fast-redirects}
1480  
1481  # Reverse it for these two sites, which don't work right without it.
1482  {-fast-redirects}
1483  www.ukc.ac.uk/cgi-bin/wac\.cgi\?
1484  login.yahoo.com
1485    
1486
1487 Turn on page filtering according to rules in the defined sections of
1488 refilterfile, and make one exception for sourceforge:
1489
1490  # Run everything through the filter file, using only the
1491  # specified sections:
1492  +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}\
1493  +filter{webbugs} +filter{nimda} +filter{banners-by-size}
1494               
1495  # Then disable filtering of code from sourceforge!
1496  {-filter}
1497  .cvs.sourceforge.net
1498    
1499
1500 Now some URLs that we want "blocked", ie we won't see them. Many of these use
1501 regular expressions that will expand to match multiple URLs:
1502
1503   # Blocklist:
1504   {+block}
1505   /.*/(.*[-_.])?ads?[0-9]?(/|[-_.].*|\.(gif|jpe?g))
1506   /.*/(.*[-_.])?count(er)?(\.cgi|\.dll|\.exe|[?/])
1507   /.*/(ng)?adclient\.cgi
1508   /.*/(plain|live|rotate)[-_.]?ads?/
1509   /.*/(sponsor)s?[0-9]?/
1510   /.*/_?(plain|live)?ads?(-banners)?/
1511   /.*/abanners/
1512   /.*/ad(sdna_image|gifs?)/
1513   /.*/ad(server|stream|juggler)\.(cgi|pl|dll|exe)
1514   /.*/adbanners/
1515   /.*/adserver
1516   /.*/adstream\.cgi
1517   /.*/adv((er)?ts?|ertis(ing|ements?))?/
1518   /.*/banner_?ads/
1519   /.*/banners?/
1520   /.*/banners?\.cgi/
1521   /.*/cgi-bin/centralad/getimage
1522   /.*/images/addver\.gif
1523   /.*/images/marketing/.*\.(gif|jpe?g)
1524   /.*/popupads/
1525   /.*/siteads/
1526   /.*/sponsor.*\.gif
1527   /.*/sponsors?[0-9]?/
1528   /.*/advert[0-9]+\.jpg
1529   /Media/Images/Adds/
1530   /ad_images/
1531   /adimages/
1532   /.*/ads/
1533   /bannerfarm/
1534   /grafikk/annonse/
1535   /graphics/defaultAd/
1536   /image\.ng/AdType
1537   /image\.ng/transactionID
1538   /images/.*/.*_anim\.gif # alvin brattli
1539   /ip_img/.*\.(gif|jpe?g)
1540   /rotateads/
1541   /rotations/ 
1542   /worldnet/ad\.cgi
1543   /cgi-bin/nph-adclick.exe/
1544   /.*/Image/BannerAdvertising/
1545   /.*/ad-bin/
1546   /.*/adlib/server\.cgi
1547   /autoads/
1548    
1549
1550 Note that many of these actions have the potential to cause a page to
1551 misbehave, possibly even not to display at all. There are many ways a site
1552 designer may choose to design his site, and what HTTP header content he may
1553 depend on. There is no way to have hard and fast rules for all sites. See the 
1554 Appendix for a brief example on troubleshooting actions. 
1555
1556 -------------------------------------------------------------------------------
1557
1558 4.4.3. Aliases
1559
1560 Custom "actions", known to Privoxy as "aliases", can be defined by combining
1561 other "actions". These can in turn be invoked just like the built-in "actions".
1562 Currently, an alias can contain any character except space, tab, "=", "{" or "}
1563 ". But please use only "a"- "z", "0"-"9", "+", and "-". Alias names are not
1564 case sensitive, and must be defined before anything else in the
1565 default.actionfile ! And there can only be one set of "aliases" defined.
1566
1567 Now let's define a few aliases:
1568
1569  # Useful customer aliases we can use later. These must come first!
1570  {{alias}}
1571  +no-cookies = +no-cookies-set +no-cookies-read
1572  -no-cookies = -no-cookies-set -no-cookies-read
1573  fragile     =
1574  -block -no-cookies -filter -fast-redirects -hide-referer -no-popups
1575  shop        = -no-cookies -filter -fast-redirects
1576  +imageblock = +block +image
1577
1578  #For people who don't like to type too much:  ;-)
1579  c0 = +no-cookies
1580  c1 = -no-cookies
1581  c2 = -no-cookies-set +no-cookies-read
1582  c3 = +no-cookies-set -no-cookies-read
1583  #... etc.  Customize to your heart's content.
1584    
1585
1586 Some examples using our "shop" and "fragile" aliases from above:
1587
1588  # These sites are very complex and require
1589  # minimal interference.
1590  {fragile}
1591  .office.microsoft.com
1592  .windowsupdate.microsoft.com
1593  .nytimes.com
1594
1595  # Shopping sites - still want to block ads.
1596  {shop}
1597  .quietpc.com
1598  .worldpay.com   # for quietpc.com
1599  .jungle.com
1600  .scan.co.uk
1601
1602  # These shops require pop-ups
1603  {shop -no-popups}
1604  .dabs.com
1605  .overclockers.co.uk
1606    
1607
1608 -------------------------------------------------------------------------------
1609
1610 4.5. The Filter File
1611
1612 Any web page can be dynamically modified with the filter file. This
1613 modification can be removal, or re-writing, of any web page content, including
1614 tags and non-visible content. The default filter file is default.filter,
1615 located in the config directory.
1616
1617 The included example file is divided into sections. Each section begins with
1618 the FILTER keyword, followed by the identifier for that section, e.g. "FILTER:
1619 webbugs". Each section performs a similar type of filtering, such as
1620 "html-annoyances". 
1621
1622 This file uses regular expressions to alter or remove any string in the target
1623 page. The expressions can only operate on one line at a time. Some examples
1624 from the included default default.filter:
1625
1626 Stop web pages from displaying annoying messages in the status bar by deleting
1627 such references:
1628
1629  FILTER: html-annoyances
1630
1631  # New browser windows should be resizeable and have a location and status
1632  # bar. Make it so.
1633  #
1634  s/resizable="?(no|0)"?/resizable=1/ig s/noresize/yesresize/ig
1635  s/location="?(no|0)"?/location=1/ig s/status="?(no|0)"?/status=1/ig
1636  s/scrolling="?(no|0|Auto)"?/scrolling=1/ig
1637  s/menubar="?(no|0)"?/menubar=1/ig 
1638
1639  # The <BLINK> tag was a crime!
1640  #
1641  s*<blink>|</blink>**ig
1642
1643  # Is this evil? 
1644  #
1645  #s/framespacing="?(no|0)"?//ig
1646  #s/margin(height|width)=[0-9]*//gi
1647    
1648
1649 Just for kicks, replace any occurrence of "Microsoft" with "MicroSuck", and
1650 have a little fun with topical buzzwords:
1651
1652  FILTER: fun
1653
1654  s/microsoft(?!.com)/MicroSuck/ig
1655
1656  # Buzzword Bingo:
1657  #
1658  s/industry-leading|cutting-edge|award-winning/<font color=red><b>BINGO!</b></
1659 font>/ig
1660    
1661
1662 Kill those pesky little web-bugs:
1663
1664  # webbugs: Squish WebBugs (1x1 invisible GIFs used for user tracking)
1665  FILTER: webbugs
1666
1667  s/<img\s+[^>]*?(width|height)\s*=\s*['"]?1\D[^>]*?(width|height)\s*=\s*['"]?1
1668 (\D[^>]*?)?>/<!-- Squished WebBug -->/sig
1669    
1670
1671 -------------------------------------------------------------------------------
1672
1673 4.6. Templates
1674
1675 When Privoxy displays one of its internal pages, such as a 404 Not Found error
1676 page, it uses the appropriate template. On Linux, BSD, and Unix, these are
1677 located in /etc/privoxy/templates by default. These may be customized, if
1678 desired. 
1679
1680 -------------------------------------------------------------------------------
1681
1682 5. Contacting the Developers, Bug Reporting and Feature Requests
1683
1684 We value your feedback. However, to provide you with the best support, please
1685 note:
1686
1687   * Use the Sourceforge support forum to get help.
1688    
1689   * Submit bugs only thru our Sourceforge bug forum. Make sure that the bug has
1690     not already been submitted. Please try to verify that it is a Privoxy bug,
1691     and not a browser or site bug first. If you are using your own custom
1692     configuration, please try the stock configs to see if the problem is a
1693     configuration related bug. And if not using the latest development
1694     snapshot, please try the latest one. Or even better, CVS sources.
1695    
1696   * Submit feature requests only thru our Sourceforge feature request forum.
1697    
1698  
1699
1700 For any other issues, feel free to use the mailing lists.
1701
1702 Anyone interested in actively participating in development and related
1703 discussions can join the appropriate mailing list here. Archives are available
1704 here too.
1705
1706 -------------------------------------------------------------------------------
1707
1708 6. Copyright and History
1709
1710 6.1. License
1711
1712 Privoxy is free software; you can redistribute it and/or modify it under the
1713 terms of the GNU General Public License as published by the Free Software
1714 Foundation; either version 2 of the License, or (at your option) any later
1715 version.
1716
1717 This program is distributed in the hope that it will be useful, but WITHOUT ANY
1718 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1719 PARTICULAR PURPOSE. See the GNU General Public License for more details, which
1720 is available from the Free Software Foundation, Inc, 59 Temple Place - Suite
1721 330, Boston, MA 02111-1307, USA.
1722
1723 -------------------------------------------------------------------------------
1724
1725 6.2. History
1726
1727 Privoxy is evolved, and derived from, the Internet Junkbuster, with many
1728 improvments and enhancements over the original.
1729
1730 Junkbuster was originally written by Anonymous Coders and Junkbuster's
1731 Corporation, and was released as free open-source software under the GNU GPL. 
1732 Stefan Waldherr made many improvements, and started the SourceForge project
1733 Privoxy to rekindle development. There are now several active developers
1734 contributing. The last stable release of Junkbuster was v2.0.2, which has now
1735 grown whiskers ;-).
1736
1737 -------------------------------------------------------------------------------
1738
1739 7. See also
1740
1741   http://sourceforge.net/projects/ijbswa, the Project Page for Privoxy.
1742
1743   http://www.privoxy.org/
1744
1745   http://p.p/
1746
1747   http://www.junkbusters.com/ht/en/cookies.html
1748
1749   http://www.waldherr.org/junkbuster/
1750
1751   http://privacy.net/analyze/
1752
1753  http://www.squid-cache.org/
1754
1755  
1756
1757 -------------------------------------------------------------------------------
1758
1759 8. Appendix
1760
1761 8.1. Regular Expressions
1762
1763 Privoxy can use "regular expressions" in various config files. Assuming support
1764 for "pcre" (Perl Compatible Regular Expressions) is compiled in, which is the
1765 default. Such configuration directives do not require regular expressions, but
1766 they can be used to increase flexibility by matching a pattern with wild-cards
1767 against URLs.
1768
1769 If you are reading this, you probably don't understand what "regular
1770 expressions" are, or what they can do. So this will be a very brief
1771 introduction only. A full explanation would require a book ;-)
1772
1773 "Regular expressions" is a way of matching one character expression against
1774 another to see if it matches or not. One of the "expressions" is a literal
1775 string of readable characters (letter, numbers, etc), and the other is a
1776 complex string of literal characters combined with wild-cards, and other
1777 special characters, called meta-characters. The "meta-characters" have special
1778 meanings and are used to build the complex pattern to be matched against. Perl
1779 Compatible Regular Expressions is an enhanced form of the regular expression
1780 language with backward compatibility.
1781
1782 To make a simple analogy, we do something similar when we use wild-card
1783 characters when listing files with the dir command in DOS. *.* matches all
1784 filenames. The "special" character here is the asterisk which matches any and
1785 all characters. We can be more specific and use ? to match just individual
1786 characters. So "dir file?.text" would match "file1.txt", "file2.txt", etc. We
1787 are pattern matching, using a similar technique to "regular expressions"!
1788
1789 Regular expressions do essentially the same thing, but are much, much more
1790 powerful. There are many more "special characters" and ways of building complex
1791 patterns however. Let's look at a few of the common ones, and then some
1792 examples:
1793
1794 . - Matches any single character, e.g. "a", "A", "4", ":", or "@".
1795
1796 ? - The preceding character or expression is matched ZERO or ONE times. Either/
1797 or.                                                                            
1798
1799 + - The preceding character or expression is matched ONE or MORE times.
1800
1801 * - The preceding character or expression is matched ZERO or MORE times.
1802
1803 \ - The "escape" character denotes that the following character should be taken
1804 literally. This is used where one of the special characters (e.g. ".") needs to
1805 be taken literally and not as a special meta-character.                        
1806
1807 [] - Characters enclosed in brackets will be matched if any of the enclosed    
1808 characters are encountered.                                                    
1809
1810 () - parentheses are used to group a sub-expression, or multiple               
1811 sub-expressions.                                                               
1812
1813 | - The "bar" character works like an "or" conditional statement. A match is   
1814 successful if the sub-expression on either side of "|" matches.                
1815
1816 s/string1/string2/g - This is used to rewrite strings of text. "string1" is    
1817 replaced by "string2" in this example.                                         
1818
1819 These are just some of the ones you are likely to use when matching URLs with
1820 Privoxy, and is a long way from a definitive list. This is enough to get us
1821 started with a few simple examples which may be more illuminating:
1822
1823 /.*/banners/.* - A simple example that uses the common combination of "." and "
1824 *" to denote any character, zero or more times. In other words, any string at
1825 all. So we start with a literal forward slash, then our regular expression
1826 pattern (".*") another literal forward slash, the string "banners", another
1827 forward slash, and lastly another ".*". We are building a directory path here.
1828 This will match any file with the path that has a directory named "banners" in
1829 it. The ".*" matches any characters, and this could conceivably be more forward
1830 slashes, so it might expand into a much longer looking path. For example, this
1831 could match: "/eye/hate/spammers/banners/annoy_me_please.gif", or just "/
1832 banners/annoying.html", or almost an infinite number of other possible
1833 combinations, just so it has "banners" in the path somewhere.
1834
1835 A now something a little more complex:
1836
1837 /.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have several literal forward
1838 slashes again ("/"), so we are building another expression that is a file path
1839 statement. We have another ".*", so we are matching against any conceivable
1840 sub-path, just so it matches our expression. The only true literal that must
1841 match our pattern is adv, together with the forward slashes. What comes after
1842 the "adv" string is the interesting part.
1843
1844 Remember the "?" means the preceding expression (either a literal character or
1845 anything grouped with "(...)" in this case) can exist or not, since this means
1846 either zero or one match. So "((er)?ts?|ertis(ing|ements?))" is optional, as
1847 are the individual sub-expressions: "(er)", "(ing|ements?)", and the "s". The "
1848 |" means "or". We have two of those. For instance, "(ing|ements?)", can expand
1849 to match either "ing" OR "ements?". What is being done here, is an attempt at
1850 matching as many variations of "advertisement", and similar, as possible. So
1851 this would expand to match just "adv", or "advert", or "adverts", or
1852 "advertising", or "advertisement", or "advertisements". You get the idea. But
1853 it would not match "advertizements" (with a "z"). We could fix that by changing
1854 our regular expression to: "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/", which
1855 would then match either spelling.
1856
1857 /.*/advert[0-9]+\.(gif|jpe?g) - Again another path statement with forward
1858 slashes. Anything in the square brackets "[]" can be matched. This is using
1859 "0-9" as a shorthand expression to mean any digit one through nine. It is the
1860 same as saying "0123456789". So any digit matches. The "+" means one or more of
1861 the preceding expression must be included. The preceding expression here is
1862 what is in the square brackets -- in this case, any digit one through nine.
1863 Then, at the end, we have a grouping: "(gif|jpe?g)". This includes a "|", so
1864 this needs to match the expression on either side of that bar character also. A
1865 simple "gif" on one side, and the other side will in turn match either "jpeg"
1866 or "jpg", since the "?" means the letter "e" is optional and can be matched
1867 once or not at all. So we are building an expression here to match image GIF or
1868 JPEG type image file. It must include the literal string "advert", then one or
1869 more digits, and a "." (which is now a literal, and not a special character,
1870 since it is escaped with "\"), and lastly either "gif", or "jpeg", or "jpg".
1871 Some possible matches would include: "//advert1.jpg", "/nasty/ads/
1872 advert1234.gif", "/banners/from/hell/advert99.jpg". It would not match
1873 "advert1.gif" (no leading slash), or "/adverts232.jpg" (the expression does not
1874 include an "s"), or "/advert1.jsp" ("jsp" is not in the expression anywhere).
1875
1876 s/microsoft(?!.com)/MicroSuck/i - This is a substitution. "MicroSuck" will
1877 replace any occurrence of "microsoft". The "i" at the end of the expression
1878 means ignore case. The "(?!.com)" means the match should fail if "microsoft" is
1879 followed by ".com". In other words, this acts like a "NOT" modifier. In case
1880 this is a hyperlink, we don't want to break it ;-).
1881
1882 We are barely scratching the surface of regular expressions here so that you
1883 can understand the default Privoxy configuration files, and maybe use this
1884 knowledge to customize your own installation. There is much, much more that can
1885 be done with regular expressions. Now that you know enough to get started, you
1886 can learn more on your own :/
1887
1888 More reading on Perl Compatible Regular expressions: http://www.perldoc.com/
1889 perl5.6/pod/perlre.html
1890
1891 -------------------------------------------------------------------------------
1892
1893 8.2. Privoxy's Internal Pages
1894
1895 Since Privoxy proxies each requested web page, it is easy for Privoxy to trap
1896 certain special URLs. In this way, we can talk directly to Privoxy, and see how
1897 it is configured, see how our rules are being applied, change these rules and
1898 other configuration options, and even turn Privoxy's filtering off, all with a
1899 web browser. 
1900
1901 The URLs listed below are the special ones that allow direct access to Privoxy.
1902 Of course, Privoxy must be running to access these. If not, you will get a
1903 friendly error message. Internet access is not necessary either.
1904
1905   * Privoxy main page:
1906    
1907         http://config.privoxy.org/
1908        
1909     Alternately, this may be reached at http://p.p/, but this variation may not
1910     work as reliably as the above in some configurations.
1911    
1912   * Show information about the current configuration:
1913    
1914         http://config.privoxy.org/show-status
1915        
1916   * Show the source code version numbers:
1917    
1918         http://config.privoxy.org/show-version
1919        
1920   * Show the client's request headers:
1921    
1922         http://config.privoxy.org/show-request
1923        
1924   * Show which actions apply to a URL and why:
1925    
1926         http://config.privoxy.org/show-url-info
1927        
1928   * Toggle Privoxy on or off. In this case, "Privoxy" continues to run, but
1929     only as a pass-through proxy, with no actions taking place:
1930    
1931         http://config.privoxy.org/toggle
1932        
1933     Short cuts. Turn off, then on:
1934    
1935         http://config.privoxy.org/toggle?set=disable
1936        
1937         http://config.privoxy.org/toggle?set=enable
1938        
1939   * Edit the actions list file:
1940    
1941         http://config.privoxy.org/edit-actions
1942        
1943 These may be bookmarked for quick reference. 
1944
1945 -------------------------------------------------------------------------------
1946
1947 8.2.1. Bookmarklets
1948
1949 Here are some bookmarklets to allow you to easily access a "mini" version of
1950 this page. They are designed for MS Internet Explorer, but should work equally
1951 well in Netscape, Mozilla, and other browsers which support JavaScript. They
1952 are designed to run directly from your bookmarks - not by clicking the links
1953 below (although that will work for testing).
1954
1955 To save them, right-click the link and choose "Add to Favorites" (IE) or "Add
1956 Bookmark" (Netscape). You will get a warning that the bookmark "may not be
1957 safe" - just click OK. Then you can run the Bookmarklet directly from your
1958 favourites/bookmarks. For even faster access, you can put them on the "Links"
1959 bar (IE) or the "Personal Toolbar" (Netscape), and run them with a single
1960 click.
1961
1962   * Enable Privoxy
1963    
1964   * Disable Privoxy
1965    
1966   * Toggle Privoxy (Toggles between enabled and disabled)
1967    
1968   * View Privoxy Status
1969    
1970 Credit: The site which gave me the general idea for these bookmarklets is 
1971 www.bookmarklets.com. They have more information about bookmarklets.
1972
1973 -------------------------------------------------------------------------------
1974
1975 8.3. Anatomy of an Action
1976
1977 The way Privoxy applies "actions" to any given URL can be complex, and not
1978 always so easy to understand what is happening. And sometimes we need to be
1979 able to see just what Privoxy is doing. Especially, if something Privoxy is
1980 doing is causing us a problem inadvertantly. It can be a little daunting to
1981 look at the actions files themselves, since they tend to be filled with
1982 "regular expressions" whose consequences are not always so obvious. Privoxy
1983 provides the http://config.privoxy.org/show-url-info page that can show us very
1984 specifically how actions are being applied to any given URL. This is a big help
1985 for troubleshooting.
1986
1987 First, enter one URL (or partial URL) at the prompt, and then Privoxy will tell
1988 us how the current configuration will handle it. This will not help with
1989 filtering effects from the default.filter file! It also will not tell you about
1990 any other URLs that may be embedded within the URL you are testing. For
1991 instance, images such as ads are expressed as URLs within the raw page source
1992 of HTML pages. So you will only get info for the actual URL that is pasted into
1993 the prompt area -- not any sub-URLs. If you want to know about embedded URLs
1994 like ads, you will have to dig those out of the HTML source. Use your browser's
1995 "View Page Source" option for this.
1996
1997 Let's look at an example, google.com, one section at a time:
1998
1999  System default actions:                                                       
2000                                                                                
2001  { -add-header -block -deanimate-gifs -downgrade -fast-redirects -filter       
2002    -hide-forwarded -hide-from -hide-referer -hide-user-agent -image            
2003    -image-blocker -limit-connect -no-compression -no-cookies-keep              
2004    -no-cookies-read -no-cookies-set -no-popups -vanilla-wafer -wafer }         
2005                                                                                
2006                                                                                
2007
2008 This is the top section, and only tells us of the compiled in defaults. This is
2009 basically what Privoxy would do if there were not any "actions" defined, i.e.
2010 it does nothing. Every action is disabled. This is not particularly informative
2011 for our purposes here. OK, next section:
2012
2013  Matches for http://google.com:                                                
2014                                                                                
2015  { -add-header -block +deanimate-gifs -downgrade +fast-redirects               
2016    +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}          
2017    +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal}       
2018    +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge}         
2019    -hide-user-agent -image +image-blocker{blank} +no-compression               
2020    +no-cookies-keep -no-cookies-read -no-cookies-set +no-popups                
2021    -vanilla-wafer -wafer }                                                     
2022    /                                                                           
2023                                                                                
2024  { -no-cookies-keep -no-cookies-read -no-cookies-set }                         
2025   .google.com                                                                  
2026                                                                                
2027  { -fast-redirects }                                                           
2028   .google.com                                                                  
2029                                                                                
2030                                                                                
2031
2032 This is much more informative, and tells us how we have defined our "actions",
2033 and which ones match for our example, "google.com". The first grouping shows
2034 our default settings, which would apply to all URLs. If you look at your
2035 "actions" file, this would be the section just below the "aliases" section near
2036 the top. This applies to all URLs as signified by the single forward slash -- "
2037 /".
2038
2039 These are the default actions we have enabled. But we can define additional
2040 actions that would be exceptions to these general rules, and then list specific
2041 URLs that these exceptions would apply to. Last match wins. Just below this
2042 then are two explict matches for ".google.com". The first is negating our
2043 various cookie blocking actions (i.e. we will allow cookies here). The second
2044 is allowing "fast-redirects". Note that there is a leading dot here --
2045 ".google.com". This will match any hosts and sub-domains, in the google.com
2046 domain also, such as "www.google.com". So, apparently, we have these actions
2047 defined somewhere in the lower part of our actions file, and "google.com" is
2048 referenced in these sections. 
2049
2050 And now we pull it altogether in the bottom section and summarize how Privoxy
2051 is appying all its "actions" to "google.com": 
2052
2053  Final results:                                                                
2054                                                                                
2055  -add-header -block -deanimate-gifs -downgrade -fast-redirects                 
2056  +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}            
2057  +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal}         
2058  +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge}           
2059  -hide-user-agent -image +image-blocker{blank} -limit-connect +no-compression  
2060  -no-cookies-keep -no-cookies-read -no-cookies-set +no-popups -vanilla-wafer   
2061  -wafer                                                                        
2062                                                                                
2063                                                                                
2064
2065 Now another example, "ad.doubleclick.net":
2066
2067  { +block +image }                                                             
2068   .ad.doubleclick.net                                                          
2069                                                                                
2070  { +block +image }                                                             
2071   ad*.                                                                         
2072                                                                                
2073  { +block +image }                                                             
2074   .doubleclick.net                                                             
2075                                                                                
2076                                                                                
2077
2078 We'll just show the interesting part here, the explicit matches. It is matched
2079 three different times. Each as an "+block +image", which is the expanded form
2080 of one of our aliases that had been defined as: "+imageblock". ("Aliases" are
2081 defined in the first section of the actions file and typically used to combine
2082 more than one action.)
2083
2084 Any one of these would have done the trick and blocked this as an unwanted
2085 image. This is unnecessarily redundant since the last case effectively would
2086 also cover the first. No point in taking chances with these guys though ;-)
2087 Note that if you want an ad or obnoxious URL to be invisible, it should be
2088 defined as "ad.doubleclick.net" is done here -- as both a "+block" and an
2089 "+image". The custom alias "+imageblock" does this for us.
2090
2091 One last example. Let's try "http://www.rhapsodyk.net/adsl/HOWTO/". This one is
2092 giving us problems. We are getting a blank page. Hmmm...
2093
2094  Matches for http://www.rhapsodyk.net/adsl/HOWTO/:                             
2095                                                                                
2096  { -add-header -block +deanimate-gifs -downgrade +fast-redirects               
2097    +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}          
2098    +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal}       
2099    +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge}         
2100    -hide-user-agent -image +image-blocker{blank} +no-compression               
2101    +no-cookies-keep -no-cookies-read -no-cookies-set +no-popups                
2102    -vanilla-wafer -wafer }                                                     
2103    /                                                                           
2104                                                                                
2105  { +block +image }                                                             
2106   /ads                                                                         
2107                                                                                
2108                                                                                
2109
2110 Ooops, the "/adsl/" is matching "/ads"! But we did not want this at all! Now we
2111 see why we get the blank page. We could now add a new action below this that
2112 explictly does not block (-block) pages with "adsl". There are various ways to
2113 handle such exceptions. Example:
2114
2115  { -block }                                                                    
2116   /adsl                                                                        
2117                                                                                
2118                                                                                
2119
2120 Now the page displays ;-) 
2121
2122 But now what about a situation where we get no explicit matches like we did
2123 with: 
2124
2125  { -block }                                                                    
2126   /adsl                                                                        
2127                                                                                
2128                                                                                
2129
2130 That actually was very telling and pointed us quickly to where the problem was.
2131 If you don't get this kind of match, then it means one of the default rules in
2132 the first section is causing the problem. This would require some guesswork,
2133 and maybe a little trial and error to isolate the offending rule. One likely
2134 cause would be one of the "{+filter}" actions. Try adding the URL for the site
2135 to one of aliases that turn off "+filter":
2136
2137  {shop}                                                                        
2138  .quietpc.com                                                                  
2139  .worldpay.com   # for quietpc.com                                             
2140  .jungle.com                                                                   
2141  .scan.co.uk                                                                   
2142  .forbes.com                                                                   
2143                                                                                
2144                                                                                
2145
2146 "{shop}" is an "alias" that expands to "{ -filter -no-cookies -no-cookies-keep
2147 }". Or you could do your own exception to negate filtering: 
2148
2149  {-filter}                                                                     
2150  .forbes.com                                                                   
2151                                                                                
2152                                                                                
2153