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