Fix typo.
[privoxy.git] / doc / text / user-manual.txt
1 Junkbuster User Manual
2
3 By: Junkbuster Developers
4
5 $Id: user-manual.sgml,v 1.23 2001/12/02 00:20:41 hal9 Exp $
6
7 The user manual gives the users information on how to install and configure
8 Internet Junkbuster. Internet Junkbuster is an application that provides
9 privacy and security to users of the World Wide Web.
10
11 You can find the latest version of the user manual at http://
12 ijbswa.sourceforge.net/user-manual/.
13
14 Feel free to send a note to the developers at <
15 ijbswa-developers@lists.sourceforge.net>.
16
17 -------------------------------------------------------------------------------
18
19 Table of Contents
20 1. Introduction
21    
22     1.1. New Features
23    
24 2. Installation
25    
26     2.1. Source
27     2.2. Red Hat
28     2.3. SuSE
29     2.4. OS/2
30     2.5. Windows
31     2.6. Other
32    
33 3. Junkbuster Configuration
34    
35     3.1. The Main Configuration File
36     3.2. The Actions File
37     3.3. The Filter File
38    
39 4. Quickstart to Using Junkbuster
40 5. Contact the Developers
41 6. Copyright and History
42    
43     6.1. License
44     6.2. History
45    
46 7. See also
47 8. Appendix
48    
49     8.1. Regular Expressions
50    
51 1. Introduction
52
53 Internet Junkbuster is a web proxy with advanced filtering capabilities for
54 protecting privacy, filtering web page content, managing cookies, controlling
55 access, and removing ads, banners, pop-ups and other obnoxious Internet Junk.
56 Junkbuster has a very flexible configuration and can be customized to suit
57 individual needs and tastes. Internet Junkbuster has application for both
58 stand-alone systems and multi-user networks.
59
60 This documentation is included with the current development version of Internet
61 Junkbuster and is incomplete at this point. The most up to date reference for
62 the time being is still the comments in the source files and in the individual
63 configuration files. Development of version 3.0 is currently underway, and
64 includes many significant changes and enhancements over earlier verions. The
65 target release date for stable v3.0 is December 2001.
66
67 Since this is a development version, some features are in the process of being
68 implemented. This documentation may be slightly out of sync as a result. And
69 there are bugs, though hopefully not many!
70
71 -------------------------------------------------------------------------------
72
73 1.1. New Features
74
75 In addition to Junkbuster's traditional features of ad and banner blocking and
76 cookie management, this is a list of new features currently under development:
77
78   * A browser based configuration utility (WIP at http://i.j.b).
79    
80   * Modularized configuration that will allow for system wide settings, and
81     individual user settings. (not implemented yet)
82    
83   * Blocking of annoying pop-up browser windows (previously available as a
84     patch).
85    
86   * Support for HTTP/1.1 (partially implemented at this point).
87    
88   * Support for Perl Compatible Regular Expressions in the configuration files,
89     and generally a more sophisticated configuration syntax over previous
90     versions.
91    
92   * Web page content filtering.
93    
94   * Multi-threaded.
95    
96 In addition, the configuration is more versatile overall.
97
98 -------------------------------------------------------------------------------
99
100 2. Installation
101
102 Junkbuster is available as raw source code, or pre-compiled binaries. See the 
103 Junkbuster Home Page for current release info. Junkbuster is also available via
104 CVS. This is the recommended approach at this time. But please be aware that
105 CVS is constantly changing, and it may break in mysterious ways.
106
107 -------------------------------------------------------------------------------
108
109 2.1. Source
110
111 For gzipped tar archives, unpack the source:
112
113  tar xzvf ijb_source_* [.tgz or .tar.gz]                                       
114  cd ijb_source_2.9.9_alpha                                                     
115                                                                                
116
117 For retrieving the current CVS sources, you'll need the CVS package installed
118 first. To download CVS source:
119
120   cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login          
121   cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co current 
122   cd current                                                                         
123                                                                                      
124
125 This will create a directory named current/, which will contain the source
126 tree.
127
128 Then, in either case, to build from tarball/CVS source:
129
130  ./configure   (--help to see options)                                         
131  make          (the make from gnu, gmake for *BSD)                             
132  su                                                                            
133  make -n install    (to see where all the files will go)                       
134  make install       (to really install)                                        
135                                                                                
136
137 For Redhat and SuSE Linux RPM packages, see below.
138
139 -------------------------------------------------------------------------------
140
141 2.2. Red Hat
142
143 To build Redhat RPM packages, install source as above. Then:
144
145  autoheader   [suggested for CVS source]                                       
146  autoconf     [suggested for CVS source]                                       
147  ./configure                                                                   
148  make redhat-dist                                                              
149                                                                                
150
151 This will create both binary and src RPMs in the usual places. Example:
152
153    /usr/src/redhat/RPMS/i686/junkbuster-2.9.8-1.i686.rpm
154
155    /usr/src/redhat/SRPMS/junkbuster-2.9.9-1.src.rpm
156
157 To install, of course:
158
159  rpm -Uvv /usr/src/redhat/RPMS/i686/junkbuster-2.9.9-1.i686.rpm                
160                                                                                
161
162 This will place the Junkbuster configuration files in /etc/junkbuster/, and log
163 files in /var/log/junkbuster/.
164
165 -------------------------------------------------------------------------------
166
167 2.3. SuSE
168
169 To build SuSE RPM packages, install source as above. Then:
170
171  autoheader   [suggested for CVS source]                                       
172  autoconf     [suggested for CVS source]                                       
173  ./configure                                                                   
174  make suse-dist                                                                
175                                                                                
176
177 This will create both binary and src RPMs in the usual places. Example:
178
179    /usr/src/packages/RPMS/i686/junkbuster-2.9.9-1.i686.rpm
180
181    /usr/src/packages/SRPMS/junkbuster-2.9.9-1.src.rpm
182
183 To install, of course:
184
185  rpm -Uvv /usr/src/packages/RPMS/i686/junkbuster-2.9.9-1.i686.rpm              
186                                                                                
187
188 This will place the Junkbuster configuration files in /etc/junkbuster/, and log
189 files in /var/log/junkbuster/.
190
191 -------------------------------------------------------------------------------
192
193 2.4. OS/2
194
195 The OS/2 version of Junkbuster requires the EMX runtime library to be
196 installed. The EMX runtime library is available on the hobbes OS/2 archive,
197 among many other locations: http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&button
198 =Search&key=emxrt.zip&stype=all&sort=type&dir=%2Fpub%2Fos2%2Fdev%2Femx%2Fv0.9d
199
200 Junkbuster is packaged in a WarpIN self- installing archive. The
201 self-installing program will be named depending on the release version,
202 something like: ijbos123.exe. In order to install it, simply run this
203 executable or double-click on its icon and follow the WarpIN installation
204 panels. A shadow of the Junkbuster executable will be placed in your startup
205 folder so it will start automatically whenever OS/2 starts.
206
207 The directory you choose to install Junkbuster into will contain all of the
208 configuration files.
209
210 If you would like to build binary images on OS/2 yourself, you will need a
211 working EMX/GCC environment, plus several Unix-like tools. The Hobbes OS/2
212 archive is a good place to start when building such an environment. A set of
213 Unix-like tools named gnupack is located here: http://hobbes.nmsu.edu/cgi-bin/
214 h-search?sh=1&key=gnupack&stype=all&sort=type&dir=%2Fpub%2Fos2%2Fapps
215
216 Once you have the source code unpacked as above, you can build the binaries
217 from the current/ directory:
218
219  autoconf                                                                      
220  sh configure                                                                  
221  make                                                                          
222                                                                                
223
224 -------------------------------------------------------------------------------
225
226 2.5. Windows
227
228 Click-click. (I need help on this. Not a clue here. Also for configuration
229 section below. HB.)
230
231 -------------------------------------------------------------------------------
232
233 2.6. Other
234
235 Some quick notes on other Operating Systems.
236
237 For FreeBSD (and other *BSDs?), the build will need gmake instead of the
238 included make. gmake is available from http://www.gnu.org. The rest should be
239 the same as above for Linux/Unix.
240
241 -------------------------------------------------------------------------------
242
243 3. Junkbuster Configuration
244
245 For Unix, *BSD and Linux, all configuraton files are located in /etc/junkbuster
246 / by default. For MS Windows and OS/2, these are all in the same directory as
247 the Junkbuster executable. The name and number of configuration files has
248 changed from previous versions, and is subject to change as development
249 progresses.
250
251 The installed defaults provide a reasonable starting point. For the time being,
252 there are only three default configuration files (this will change in time):
253
254   * The main configuration file is named config on Linux, Unix, BSD, and OS/2,
255     and config.txt on Windows. On Amiga, it is AmiTCP:db/junkbuster/config.
256    
257   * The ijb.action file is used to define various "actions" relating to images,
258     banners, pop-ups, access restrictions, banners and cookies. There is a CGI
259     based editor for this file that can be accessed via http://i.j.b. This is
260     the easiest method of configuring actions. (Still under active
261     development.)
262    
263   * The re_filterfile file can be used to rewrite the raw page content,
264     including text as well as embedded HTML and JavaScript.
265    
266 ijb.action and re_filterfile can use Perl style regular expressions for maximum
267 flexibility. All files use the "#" character to denote a comment. Such lines
268 are not processed by Junkbuster. After making any changes, restart Junkbuster
269 in order for the changes to take effect.
270
271 While under development, the configuration content is subject to change. The
272 below documentation may not be accurate by the time you read this. Also, what
273 constitutes a "default" setting, may change, so please check all your
274 configuration files on important issues.
275
276 -------------------------------------------------------------------------------
277
278 3.1. The Main Configuration File
279
280 Again, the main configuration file is named config on Linux/Unix/BSD and OS/2,
281 and config.txt on Windows. Configuration lines consist of an initial keyword
282 followed by a list of values, all separated by whitespace (any number of spaces
283 or tabs). For example:
284
285   blockfile blocklist.ini
286    
287
288 Indicates that the blockfile is named "blocklist.ini".
289
290 A "#" indicates a comment. Any part of a line following a "#" is ignored,
291 except if the "#" is preceded by a "\".
292
293 Thus, by placing a "#" at the start of an existing configuration line, you can
294 make it a comment and it will be treated as if it weren't there. This is called
295 "commenting out" an option and can be useful to turn off features: If you
296 comment out the "logfile" line, junkbuster will not log to a file at all. Watch
297 for the "default:" section in each explanation to see what happens if the
298 option is left unset (or commented out).
299
300 Long lines can be continued on the next line by using a "\" as the very last
301 character.
302
303 There are various aspects of Junkbuster behavior that can be tuned.
304
305 -------------------------------------------------------------------------------
306
307 3.1.1. Defining Other Configuration Files
308
309 Junkbuster can use a number of other files to tell it what ads to block, what
310 cookies to accept, etc. This section of the configuration file tells Junkbuster
311 where to find all those other files.
312
313 On Windows, Junkbuster looks for these files in the same directory as the
314 executable. On Unix and OS/2, Junkbuster looks for these files in the current
315 working directory. In either case, an absolute path name can be used to avoid
316 problems.
317
318 When development goes modular and multiuser, the blocker, filter, and per-user
319 config will be stored in subdirectories of "confdir". For now, only confdir/
320 templates is used for storing HTML templates for CGI results.
321
322 The location of the configuration files:
323
324   confdir /etc/junkbuster       # No trailing /, please.
325    
326
327 The directory where all logging (i.e. logfile and jarfile) takes place. No
328 trailing "/", please:
329
330   logdir /var/log/junkbuster
331    
332
333 Note that all file specifications below are relative to the above two
334 directories!
335
336 The "ijb.action" file contains patterns to specify the actions to apply to
337 requests for each site. Default: Cookies to and from all destinations are kept
338 only during the current browser session (i.e. they are not saved to disk).
339 Popups are disabled for all sites. All sites are filtered if "re_filterfile"
340 specified. No sites are blocked. An empty image is displayed for filtered ads
341 and other images (formerly "tinygif"). The syntax of this file is explained in
342 detail below.
343
344   actionsfile ijb.action
345    
346
347 The "re_filterfile" file contains content modification rules. These rules
348 permit powerful changes on the content of Web pages, e.g., you could disable
349 your favourite JavaScript annoyances, rewrite the actual content, or just have
350 some fun replacing "Microsoft" with "MicroSuck" wherever it appears on a Web
351 page. Default: No content modification, or whatever the developers are playing
352 with :-/
353
354   re_filterfile re_filterfile
355    
356
357 The logfile is where all logging and error messages are written. The logfile
358 can be useful for tracking down a problem with Junkbuster (e.g., it's not
359 blocking an ad you think it should block) but in most cases you probably will
360 never look at it.
361
362 Your logfile will grow indefinitely, and you will probably want to periodically
363 remove it. On Unix systems, you can do this with a cron job (see "man cron").
364 For Redhat, a logrotate script has been included.
365
366 On SuSE Linux systems, you can place a line like "/var/log/junkbuster.* +1024k
367 644 nobody.nogroup" in /etc/logfiles, with the effect that cron.daily will
368 automatically archive, gzip, and empty the log, when it exceeds 1M size.
369
370 Default: Log to the a file named logfile. Comment out to disable logging.
371
372   logfile logfile
373    
374
375 The "jarfile" defines where Junkbuster stores the cookies it intercepts. Note
376 that if you use a "jarfile", it may grow quite large. Default: Don't store
377 intercepted cookies.
378
379   #jarfile jarfile
380    
381
382 If you specify a "trustfile", Junkbuster will only allow access to sites that
383 are named in the trustfile. You can also mark sites as trusted referrers, with
384 the effect that access to untrusted sites will be granted, if a link from a
385 trusted referrer was used. The link target will then be added to the
386 "trustfile". This is a very restrictive feature that typical users most
387 propably want to leave disabled. Default: Disabled, don't use the trust
388 mechanism.
389
390   #trustfile trust
391    
392
393 If you use the trust mechanism, it is a good idea to write up some online
394 documentation about your blocking policy and to specify the URL(s) here. They
395 will appear on the page that your users receive when they try to access
396 untrusted content. Use multiple times for multiple URLs. Default: Don't display
397 links on the "untrusted" info page.
398
399   trust-info-url http://www.your-site.com/why_we_block.html
400   trust-info-url http://www.your-site.com/what_we_allow.html
401    
402
403 -------------------------------------------------------------------------------
404
405 3.1.2. Other Configuration Options
406
407 This part of the configuration file contains options that control how
408 Junkbuster operates.
409
410 "Admin-address" should be set to the email address of the proxy administrator.
411 It is used in many of the proxy-generated pages. Default: fill@me.in.please.
412
413   #admin-address fill@me.in.please
414    
415
416 "Proxy-info-url" can be set to a URL that contains more info about this
417 Junkbuster installation, it's configuration and policies. It is used in many of
418 the proxy-generated pages and its use is highly recommended in multi-user
419 installations, since your users will want to know why certain content is
420 blocked or modified. Default: Don't show a link to online documentation.
421
422   proxy-info-url http://www.your-site.com/proxy.html
423    
424
425 "Listen-address" specifies the address and port where Junkbuster will listen
426 for connections from your Web browser. The default is to listen on the
427 localhost port 8000, and this is suitable for most users. (In your web browser,
428 under proxy configuration, list the proxy server as "localhost" and the port as
429 "8000").
430
431 If you already have another service running on port 8000, or if you want to
432 serve requests from other machines (e.g. on your local network) as well, you
433 will need to override the default. The syntax is "listen-address
434 [<ip-address>]:<port>". If you leave out the IP address, junkbuster will bind
435 to all interfaces (addresses) on your machine and may become reachable from the
436 Internet. In that case, consider using access control lists (acl's) (see
437 "aclfile" above), or a firewall.
438
439 For example, suppose you are running Junkbuster on a machine which has the
440 address 192.168.0.1 on your local private network (192.168.0.0) and has another
441 outside connection with a different address. You want it to serve requests from
442 inside only:
443
444   listen-address 192.168.0.1:8000
445    
446
447 If you want it to listen on all addresses (including the outside connection):
448
449   listen-address :8000
450    
451
452 If you do this, consider using ACLs (see "aclfile" above). Note: you will need
453 to point your browser(s) to the address and port that you have configured here.
454 Default: localhost:8000 (127.0.0.1:8000).
455
456 The debug option sets the level of debugging information to log in the logfile
457 (and to the console in the Windows version). A debug level of 1 is informative
458 because it will show you each request as it happens. Higher levels of debug are
459 probably only of interest to developers.
460
461   debug         1 # GPC   = show each GET/POST/CONNECT request
462   debug         2 # CONN  = show each connection status
463   debug         4 # IO    = show I/O status
464   debug         8 # HDR   = show header parsing
465   debug        16 # LOG   = log all data into the logfile
466   debug        32 # FRC   = debug force feature
467   debug        64 # REF   = debug regular expression filter 
468   debug       128 #       = debug fast redirects
469   debug       256 #       = debug GIF deanimation
470   debug       512 # CLF   = Common Log Format
471   debug      1024 #       = debug kill popups
472   debug      4096 # INFO  = Startup banner and warnings.
473   debug      8192 # ERROR = Non-fatal errors
474     
475
476 It is highly recommended that you enable ERROR reporting (debug 8192), at least
477 until the next stable release.
478
479 The reporting of FATAL errors (i.e. ones which crash JunkBuster) is always on
480 and cannot be disabled.
481
482 If you want to use CLF (Common Log Format), you should set "debug 512" ONLY, do
483 not enable anything else.
484
485 Multiple "debug" directives, are OK - they're logical-OR'd together.
486
487   debug 15 # same as setting the first 4 listed above
488    
489
490 Default:
491
492   debug 1 # URLs
493   debug 4096 # Info
494   debug 8192 # Errors - *we highly recommended enabling this*
495    
496
497 Junkbuster normally uses "multi-threading", a software technique that permits
498 it to handle many different requests simultaneously. In some cases you may wish
499 to disable this -- particularly if you're trying to debug a problem. The
500 "single-threaded" option forces Junkbuster to handle requests sequentially.
501 Default: Multi-threaded mode.
502
503   #single-threaded
504    
505
506 "toggle" allows you to temporarily disable all Junkbuster's filtering. Just set
507 "toggle 0".
508
509 The Windows version of Junkbuster puts an icon in the system tray, which also
510 allows you to change this option. If you right-click on that icon (or select
511 the "Options" menu), one choice is "Enable". Clicking on enable toggles
512 Junkbuster on and off. This is useful if you want to temporarily disable
513 Junkbuster, e.g., to access a site that requires cookies which you would
514 otherwise have blocked. This can also be toggled via a web browser at the
515 Junkbuster internal address of http://i.j.b on any platform.
516
517 "toggle 1" means Junkbuster runs normally, "toggle 0" means that Junkbuster
518 becomes a non-anonymizing non-blocking proxy. Default: 1 (on).
519
520   toggle 1
521    
522
523 For content filtering, i.e. the "+filter" and "+deanimate-gif" actions, it is
524 neccessary that Junkbuster buffers the entire document body. This can be
525 potentially dangerous, since a server could just keep sending data indefinitely
526 and wait for your RAM to exhaust. With nasty consequences.
527
528 The buffer-limit option lets you set the maximum size in Kbytes that each
529 buffer may use. When the documents buffer exceeds this size, it is flushed to
530 the client unfiltered and no further attempt to filter the rest of it is made.
531 Remember that there may multiple threads running, which might require
532 increasing the "buffer-limit" Kbytes each, unless you have enabled
533 "single-threaded" above.
534
535   buffer-limit 4069
536    
537
538 To enable the web-based ijb.action file editor set enable-edit-actions to 1, or
539 0 to disable. Note that you must have compiled JunkBuster with support for this
540 feature, otherwise this option has no effect. This internal page can be reached
541 at http://i.j.b.
542
543 Security note: If this is enabled, anyone who can use the proxy can edit the
544 actions file, and their changes will affect all users. For shared proxies, you
545 probably want to disable this. Default: enabled.
546
547   enable-edit-actions 1
548    
549
550 Allow JunkBuster to be toggled on and off remotely, using your web browser. Set
551 "enable-remote-toggle"to 1 to enable, and 0 to disable. Note that you must have
552 compiled JunkBuster with support for this feature, otherwise this option has no
553 effect.
554
555 Security note: If this is enabled, anyone who can use the proxy can toggle it
556 on or off (see http://i.j.b), and their changes will affect all users. For
557 shared proxies, you probably want to disable this. Default: enabled.
558
559   enable-remote-toggle 1
560    
561
562 -------------------------------------------------------------------------------
563
564 3.1.3. Access Control List (ACL)
565
566 Access controls are included at the request of some ISPs and systems
567 administrators, and are not usually needed by individual users. Please note the
568 warnings in the FAQ that this proxy is not intended to be a substitute for a
569 firewall or to encourage anyone to defer addressing basic security weaknesses.
570
571 If no access settings are specified, the proxy talks to anyone that connects.
572 If any access settings file are specified, then the proxy talks only to IP
573 addresses permitted somewhere in this file and not denied later in this file.
574
575 Summary -- if using an ACL:
576
577 Client must have permission to receive service.
578
579 LAST match in ACL wins.
580
581 Default behavior is to deny service.
582
583 The syntax for an entry in the Access Control List is:
584
585   ACTION    SRC_ADDR[/SRC_MASKLEN]    [ DST_ADDR[/DST_MASKLEN] ]
586    
587
588 Where the individual fields are:
589
590  ACTION      = "permit-access" or "deny-access"
591
592  SRC_ADDR    = client hostname or dotted IP address
593  SRC_MASKLEN = number of bits in the subnet mask for the source
594
595  DST_ADDR    = server or forwarder hostname or dotted IP address
596  DST_MASKLEN = number of bits in the subnet mask for the target
597    
598
599 The field separator (FS) is whitespace (space or tab).
600
601 IMPORTANT NOTE: If the junkbuster is using a forwarder (see below) or a gateway
602 for a particular destination URL, the DST_ADDR that is examined is the address
603 of the forwarder or the gateway and NOT the address of the ultimate target.
604 This is necessary because it may be impossible for the local Junkbuster to
605 determine the address of the ultimate target (that's often what gateways are
606 used for).
607
608 Here are a few examples to show how the ACL features work:
609
610 "localhost" is OK -- no DST_ADDR implies that ALL destination addresses are OK:
611
612   permit-access localhost
613    
614
615 A silly example to illustrate permitting any host on the class-C subnet with
616 Junkbuster to go anywhere:
617
618   permit-access www.junkbusters.com/24
619    
620
621 Except deny one particular IP address from using it at all:
622
623   deny-access ident.junkbusters.com
624    
625
626 You can also specify an explicit network address and subnet mask. Explicit
627 addresses do not have to be resolved to be used.
628
629   permit-access 207.153.200.0/24
630    
631
632 A subnet mask of 0 matches anything, so the next line permits everyone.
633
634   permit-access 0.0.0.0/0
635    
636
637 Note, you cannot say:
638
639   permit-access .org
640    
641
642 to allow all *.org domains. Every IP address listed must resolve fully.
643
644 An ISP may want to provide a Junkbuster that is accessible by "the world" and
645 yet restrict use of some of their private content to hosts on its internal
646 network (i.e. its own subscribers). Say, for instance the ISP owns the Class-B
647 IP address block 123.124.0.0 (a 16 bit netmask). This is how they could do it:
648
649  permit-access 0.0.0.0/0 0.0.0.0/0   # other clients can go anywhere 
650                                        # with the following exceptions:
651  
652  deny-access   0.0.0.0/0   123.124.0.0/16 # block all external requests for
653                                           # sites on the ISP's network
654
655  permit 0.0.0.0/0 www.my_isp.com        # except for the ISP's main 
656                                           # web site
657
658  permit 123.124.0.0/16 0.0.0.0/0          # the ISP's clients can go 
659                                           # anywhere
660    
661
662 Note that if some hostnames are listed with multiple IP addresses, the primary
663 value returned by DNS (via gethostbyname()) is used. Default: Anyone can access
664 the proxy.
665
666 -------------------------------------------------------------------------------
667
668 3.1.4. Forwarding
669
670 This feature allows chaining of HTTP requests via multiple proxies. It can be
671 used to better protect privacy and confidentiality when accessing specific
672 domains by routing requests to those domains to a special purpose filtering
673 proxy such as lpwa.com. Or to use a caching proxy to speed up browsing.
674
675 It can also be used in an environment with multiple networks to route requests
676 via multiple gateways allowing transparent access to multiple networks without
677 having to modify browser configurations.
678
679 Also specified here are SOCKS proxies. Junkbuster SOCKS 4 and SOCKS 4A. The
680 difference is that SOCKS 4A will resolve the target hostname using DNS on the
681 SOCKS server, not our local DNS client.
682
683 The syntax of each line is:
684
685  forward target_domain[:port] http_proxy_host[:port]
686  forward-socks4 target_domain[:port] socks_proxy_host[:port] http_proxy_host[:
687 port]
688  forward-socks4a target_domain[:port] socks_proxy_host[:port] http_proxy_host[:
689 port]
690    
691
692 If http_proxy_host is ".", then requests are not forwarded to a HTTP proxy but
693 are made directly to the web servers.
694
695 Lines are checked in sequence, and the last match wins.
696
697 There is an implicit line equivalent to the following, which specifies that
698 anything not finding a match on the list is to go out without forwarding or
699 gateway protocol, like so:
700
701   forward .* . # implicit
702    
703
704 In the following common configuration, everything goes to Lucent's LPWA, except
705 SSL on port 443 (which it doesn't handle):
706
707  forward .* lpwa.com:8000
708  forward :443 .
709    
710
711 See the FAQ for instructions on how to automate the login procedure for LPWA.
712 Some users have reported difficulties related to LPWA's use of "." as the last
713 element of the domain, and have said that this can be fixed with this:
714
715   forward lpwa. lpwa.com:8000
716    
717
718 (NOTE: the syntax for specifiying target_domain has changed since the previous
719 paragraph was written -- it will not work now. More information is welcome.)
720
721 In this fictitious example, everything goes via an ISP's caching proxy, except
722 requests to that ISP:
723
724  forward .* caching.myisp.net:8000
725  forward myisp.net .
726    
727
728 For the @home network, we're told the forwarding configuration is this:
729
730   forward .* proxy:8080
731    
732
733 Also, we're told they insist on getting cookies and JavaScript, so you should
734 add home.com to the cookie file. We consider JavaScript a security risk. Java
735 need not be enabled.
736
737 In this example direct connections are made to all "internal" domains, but
738 everything else goes through Lucent's LPWA by way of the company's SOCKS
739 gateway to the Internet.
740
741  forward-socks4 .* lpwa.com:8000 firewall.my_company.com:1080
742  forward my_company.com .
743    
744
745 This is how you could set up a site that always uses SOCKS but no forwarders:
746
747   forward-socks4a .* . firewall.my_company.com:1080
748    
749
750 An advanced example for network administrators:
751
752 If you have links to multiple ISPs that provide various special content to
753 their subscribers, you can configure forwarding to pass requests to the
754 specific host that's connected to that ISP so that everybody can see all of the
755 content on all of the ISPs.
756
757 This is a bit tricky, but here's an example:
758
759 host-a has a PPP connection to isp-a.com. And host-b has a PPP connection to
760 isp-b.com. host-a can run a Junkbuster proxy with forwarding like this:
761
762  forward .* .
763  forward isp-b.com host-b:8000
764    
765
766 host-b can run a Junkbuster proxy with forwarding like this:
767
768  forward .* .
769  forward isp-a.com host-a:8000
770    
771
772 Now, anyone on the Internet (including users on host-a and host-b) can set
773 their browser's proxy to either host-a or host-b and be able to browse the
774 content on isp-a or isp-b.
775
776 Here's another practical example, for University of Kent at Canterbury students
777 with a network connection in their room, who need to use the University's Squid
778 web cache.
779
780  forward *. ssbcache.ukc.ac.uk:3128  # Use the proxy, except for:
781  forward .ukc.ac.uk .  # Anything on the same domain as us
782  forward * .  # Host with no domain specified
783  forward 129.12.*.* .  # A dotted IP on our /16 network.
784  forward 127.*.*.* .  # Loopback address
785  forward localhost.localdomain .  # Loopback address
786  forward www.ukc.mirror.ac.uk .  # Specific host
787    
788
789 If you intend to chain Junkbuster and squid locally, then chain as browser ->
790 squid -> junkbuster is the recommended way.
791
792 Your squid configuration could then look like this:
793
794   # Define junkbuster as parent cache 
795   
796   cache_peer 127.0.0.1 parent 8000 0 no-query
797   
798   # Define ACL for protocol FTP 
799   acl FTP proto FTP 
800
801   # Do not forward ACL FTP to junkbuster 
802   always_direct allow FTP 
803
804   # Do not forward ACL CONNECT (https) to junkbuster 
805   always_direct allow CONNECT 
806
807   # Forward the rest to junkbuster 
808   never_direct allow all 
809    
810
811 -------------------------------------------------------------------------------
812
813 3.1.5. Windows GUI Options
814
815 Junkbuster has a number of options specific to the Windows GUI interface:
816
817 If "activity-animation" is set to 1, the Junkbuster icon will animate when
818 "Junkbuster" is active. To turn off, set to 0.
819
820   activity-animation 1
821    
822
823 If "log-messages" is set to 1, Junkbuster will log messages to the console
824 window:
825
826   log-messages 1
827    
828
829 If "log-buffer-size" is set to 1, the size of the log buffer, i.e. the amount
830 of memory used for the log messages displayed in the console window, will be
831 limited to "log-max-lines" (see below).
832
833 Warning: Setting this to 0 will result in the buffer to grow infinitely and eat
834 up all your memory!
835
836   log-buffer-size 1
837    
838
839 log-max-lines is the maximum number of lines held in the log buffer. See above.
840
841   log-max-lines 200
842    
843
844 If "log-highlight-messages" is set to 1, Junkbuster will highlight portions of
845 the log messages with a bold-faced font:
846
847   log-highlight-messages 1
848    
849
850 The font used in the console window:
851
852   log-font-name Comic Sans MS
853    
854
855 Font size used in the console window:
856
857   log-font-size 8
858    
859
860 "show-on-task-bar" controls whether or not Junkbuster will appear as a button
861 on the Task bar when minimized:
862
863   show-on-task-bar 0
864    
865
866 If "close-button-minimizes" is set to 1, the Windows close button will minimize
867 Junkbuster instead of closing the program (close with the exit option on the
868 File menu).
869
870   close-button-minimizes 1
871    
872
873 The "hide-console" option is specific to the MS-Win console version of
874 JunkBuster. If this option is used, Junkbuster will disconnect from and hide
875 the command console.
876
877   #hide-console
878    
879
880 -------------------------------------------------------------------------------
881
882 3.2. The Actions File
883
884 The "ijb.action" file (formerly actionsfile) is used to define what actions
885 Junkbuster takes, and thus determines how images, cookies and various other
886 aspects of HTTP content and transactions are handled. Images can be anything
887 you want, including ads, banners, or just some obnoxious image that you would
888 rather not see. Cookies can be accepted or rejected, or accepted only during
889 the current browser session (i.e. not written to disk).
890
891 To determine which actions apply to a request, the URL of the request is
892 compared to all patterns in this file. Every time it matches, the list of
893 applicable actions for the URL is incrementally updated. You can trace this
894 process by visiting http://i.j.b/show-url-info.
895
896 The actions file can be edited with a browser by loading http://i.j.b/, and
897 then select "Edit Actions".
898
899 There are four types of lines in this file: comments (begin with a "#"
900 character), actions, aliases and patterns, all of which are explained below, as
901 well as the configuration file syntax that Junkbuster understands. 
902
903 -------------------------------------------------------------------------------
904
905 3.2.1. URL Domain and Path Syntax
906
907 Generally, a pattern has the form <domain>/<path>, where both the <domain> and
908 <path> part are optional. If you only specify a domain part, the "/" can be
909 left out:
910
911 www.example.com - is a domain only pattern and will match any request to
912 "www.example.com".
913
914 www.example.com/ - means exactly the same.
915
916 www.example.com/index.html - matches only the single document "/index.html" on
917 "www.example.com".
918
919 /index.html - matches the document "/index.html", regardless of the domain.
920
921 index.html - matches nothing, since it would be interpreted as a domain name
922 and there is no top-level domain called ".html".
923
924 The matching of the domain part offers some flexible options: if the domain
925 starts or ends with a dot, it becomes unanchored at that end. For example:
926
927 .example.com - matches any domain that ENDS in ".example.com".
928
929 www. - matches any domain that STARTS with "www".
930
931 Additionally, there are wildcards that you can use in the domain names
932 themselves. They work pretty similar to shell wildcards: "*" stands for zero or
933 more arbitrary characters, "?" stands for any single character. And you can
934 define charachter classes in square brackets and they can be freely mixed:
935
936 ad*.example.com - matches "adserver.example.com", "ads.example.com", etc but
937 not "sfads.example.com".
938
939 *ad*.example.com - matches all of the above, and then some.
940
941 .?pix.com - matches "www.ipix.com", "pictures.epix.com", "a.b.c.d.e.upix.com",
942 etc.
943
944 www[1-9a-ez].example.com - matches "www1.example.com", "www4.example.com",
945 "wwwd.example.com", "wwwz.example.com", etc., but not "wwww.example.com".
946
947 If Junkbuster was compiled with "pcre" support (default), Perl compatible
948 regular expressions can be used. See the pcre/docs/ direcory or "man perlre"
949 (also available on http://www.perldoc.com/perl5.6/pod/perlre.html) for details.
950 A brief discussion of regular expressions is in the Appendix. For instance:
951
952 /.*/advert[0-9]+\.jpe?g - would match a URL from any domain, with any path that
953 includes "advert" followed immediately by one or more digits, then a "." and
954 ending in either "jpeg" or "jpg". So we match "example.com/ads/advert2.jpg",
955 and "www.example.com/ads/banners/advert39.jpeg", but not "www.example.com/ads/
956 banners/advert39.gif" (no gifs in the example pattern).
957
958 Please note that matching in the path is case INSENSITIVE by default, but you
959 can switch to case sensitive at any point in the pattern by using the "(?-i)"
960 switch:
961
962 www.example.com/(?-i)PaTtErN.* - will match only documents whose path starts
963 with "PaTtErN" in exactly this capitalization.
964
965 -------------------------------------------------------------------------------
966
967 3.2.2. Actions
968
969 Actions are enabled if preceded with a "+", and disabled if preceded with a
970 "-". Actions are invoked by enclosing the action name in curly braces (e.g.
971 {+some_action}), followed by a list of URLs to which the action applies. There
972 are three classes of actions:
973
974   * Boolean (e.g. "+/-block"):
975    
976       {+name}        # enable this action
977       {-name}        # disable this action
978          
979    
980   * Parameterized (e.g. "+/-hide-user-agent"):
981    
982       {+name{param}}  # enable action and set parameter to "param"
983       {-name}         # disable action
984          
985    
986   * Multi-value (e.g. "{+/-add-header{Name: value}}", "{+/-wafer{name=value}}
987     "):
988    
989       {+name{param}}   # enable action and add parameter "param"
990       {-name{param}}   # remove the parameter "param"
991       {-name}          # disable this action totally
992          
993    
994 If nothing is specified in this file, no "actions" are taken. So in this case
995 JunkBuster would just be a normal, non-blocking, non-anonymizing proxy. You
996 must specifically enable the privacy and blocking features you need (although
997 the provided default ijb.action file will give a good starting point).
998
999 Later defined actions always over-ride earlier ones. For multi-valued actions,
1000 the actions are applied in the order they are specified.
1001
1002 The list of valid Junkbuster "actions" are:
1003
1004   * Add the specified HTTP header, which is not checked for validity. You may
1005     specify this many times to specify many different headers:
1006    
1007       +add-header{Name: value}
1008          
1009    
1010   * Block this URL totally.
1011    
1012       +block
1013          
1014    
1015   * De-animate all animated GIF images, i.e. reduce them to their last frame.
1016     This will also shrink the images considerably (in bytes, not pixels!). If
1017     the option "first" is given, the first frame of the animation is used as
1018     the replacement. If "last" is given, the last frame of the animation is
1019     used instead, which propably makes more sense for most banner animations,
1020     but also has the risk of not showing the entire last frame (if it is only a
1021     delta to an earlier frame).
1022    
1023       +deanimate-gifs{last}
1024       +deanimate-gifs{first}
1025          
1026    
1027   * "+downgrade" will downgrade HTTP/1.1 client requests to HTTP/1.0 and
1028     downgrade the responses as well. Use this action for servers that use HTTP/
1029     1.1 protocol features that Junkbuster doesn't handle well yet. HTTP/1.1 is
1030     only partially implemented. Default is not to downgrade requests.
1031    
1032       +downgrade
1033          
1034    
1035   * Many sites, like yahoo.com, don't just link to other sites. Instead, they
1036     will link to some script on their own server, giving the destination as a
1037     parameter, which will then redirect you to the final target. URLs resulting
1038     from this scheme typically look like: http://some.place/some_script?http://
1039     some.where-else.
1040    
1041     Sometimes, there are even multiple consecutive redirects encoded in the
1042     URL. These redirections via scripts make your web browing more traceable,
1043     since the server from which you follow such a link can see where you go to.
1044     Apart from that, valuable bandwidth and time is wasted, while your browser
1045     ask the server for one redirect after the other. Plus, it feeds the
1046     advertisers.
1047    
1048     The "+fast-redirects" option enables interception of these requests by
1049     Junkbuster, who will cut off all but the last valid URL in the request and
1050     send a local redirect back to your browser without contacting the remote
1051     site.
1052    
1053       +fast-redirects
1054          
1055    
1056   * Filter the website through the re_filterfile:
1057    
1058      +filter{filename}
1059          
1060    
1061   * Block any existing X-Forwarded-for header, and do not add a new one:
1062    
1063       +hide-forwarded
1064          
1065    
1066   * If the browser sends a "From:" header containing your e-mail address, this
1067     either completely removes the header ("block"), or changes it to the
1068     specified e-mail address.
1069    
1070       +hide-from{block}
1071       +hide-from{spam@sittingduck.xqq}
1072          
1073    
1074   * Don't send the "Referer:" (sic) header to the web site. You can block it,
1075     forge a URL to the same server as the request (which is preferred because
1076     some sites will not send images otherwise) or set it to a constant string
1077     of your choice.
1078    
1079       +hide-referer{block}
1080       +hide-referer{forge}
1081       +hide-referer{http://nowhere.com}
1082          
1083    
1084   * Alternative spelling of "+hide-referer". It has the same parameters, and
1085     can be freely mixed with, "+hide-referer". ("referrer" is the correct
1086     English spelling, however the HTTP specification has a bug - it requires it
1087     to be spelled "referer".)
1088    
1089       +hide-referrer{...}
1090          
1091    
1092   * Change the "User-Agent:" header so web servers can't tell your browser
1093     type. Warning! This breaks many web sites. Specify the user-agent value you
1094     want. Example, pretend to be using Netscape on Linux:
1095    
1096       +hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)}
1097          
1098    
1099   * Treat this URL as an image. This only matters if it's also "+block"ed, in
1100     which case a "blocked" image can be sent rather than a HTML page. See
1101     "+image-blocker{}" below for the control over what is actually sent.
1102    
1103       +image
1104          
1105    
1106   * Decides what to do with URLs that end up tagged with "{+block +image}".
1107     There are 4 options. "-image-blocker" will send a HTML "blocked" page,
1108     usually resulting in a "broken image" icon. "+image-blocker{logo}" will
1109     send a "JunkBuster" image. "+image-blocker{blank}" will send a 1x1
1110     transparent GIF image. And finally, "+image-blocker{http://xyz.com}" will
1111     send a HTTP temporary redirect to the specified image. This has the
1112     advantage of the icon being being cached by the browser, which will speed
1113     up the display.
1114    
1115       +image-blocker{logo}
1116       +image-blocker{blank}
1117       +image-blocker{http://i.j.b/send-banner}
1118          
1119    
1120   * By default (i.e. in the absence of a "+limit-connect" action), Junkbuster
1121     will only allow CONNECT requests to port 443, which is the standard port
1122     for https as a precaution.
1123    
1124     The CONNECT methods exists in HTTP to allow access to secure websites
1125     (https:// URLs) through proxies. It works very simply: the proxy connects
1126     to the server on the specified port, and then short-circuits its
1127     connections to the client and to the remote proxy. This can be a big
1128     security hole, since CONNECT-enabled proxies can be abused as TCP relays
1129     very easily.
1130    
1131     If you want to allow CONNECT for more ports than this, or want to forbid
1132     CONNECT altogether, you can specify a comma separated list of ports and
1133     port ranges (the latter using dashes, with the minimum defaulting to 0 and
1134     max to 65K):
1135    
1136       +limit-connect{443} # This is the default and need no be specified.
1137       +limit-connect{80,443} # Ports 80 and 443 are OK.
1138       +limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100
1139        #and above 500 are OK.
1140          
1141    
1142   * "+no-compression" prevents the website from compressing the data. Some
1143     websites do this, which can be a problem for Junkbuster, since "+filter",
1144     "+no-popup" and "+gif-deanimate" will not work on compressed data. This
1145     will slow down connections to those websites, though. Default is
1146     "nocompression" is turned on.
1147    
1148       +nocompression
1149          
1150    
1151   * If the website sets cookies, "no-cookies-keep" will make sure they are
1152     erased when you exit and restart your web browser. This makes profiling
1153     cookies useless, but won't break sites which require cookies so that you
1154     can log in for transactions. Default: on.
1155    
1156       +no-cookies-keep
1157          
1158    
1159   * Prevent the website from reading cookies:
1160    
1161       +no-cookies-read
1162          
1163    
1164   * Prevent the website from setting cookies:
1165    
1166       +no-cookies-set
1167          
1168    
1169   * Filter the website through a built-in filter to disable those obnoxious
1170     JavaScript pop-up windows via window.open(), etc. The two alternative
1171     spellings are equivalent.
1172    
1173       +no-popup
1174       +no-popups
1175          
1176    
1177   * This action only applies if you are using a jarfile for saving cookies. It
1178     sends a cookie to every site stating that you do not accept any copyright
1179     on cookies sent to you, and asking them not to track you. Of course, this
1180     is a (relatively) unique header they could use to track you.
1181    
1182       +vanilla-wafer
1183          
1184    
1185   * This allows you to add an arbitrary cookie. It can be specified multiple
1186     times in order to add as many cookies as you like.
1187    
1188       +wafer{name=value}
1189          
1190    
1191 The meaning of any of the above is reversed by preceding the action with a "-",
1192 in place of the "+".
1193
1194 Some examples:
1195
1196 Turn off cookies by default, then allow a few through for specified sites:
1197
1198  # Turn off all persistant cookies
1199  { +no-cookies-read }
1200  { +no-cookies-set }
1201  # Allow cookies for this browser session ONLY
1202  { +no-cookies-keep }
1203
1204  # Execeptions to the above, sites that benefit from persistant cookies
1205  { -no-cookies-read }
1206  { -no-cookies-set }
1207  { -no-cookies-keep }
1208  .javasoft.com
1209  .sun.com
1210  .yahoo.com
1211  .msdn.microsoft.com
1212  .redhat.com
1213
1214  # Alternative way of saying the same thing
1215  {-no-cookies-set -no-cookies-read -no-cookies-keep}
1216  .sourceforge.net
1217  .sf.net
1218    
1219
1220 Now turn off "fast redirects", and then we allow two exceptions:
1221
1222  # Turn them off!
1223  {+fast-redirects}
1224  
1225  # Reverse it for these two sites, which don't work right without it.
1226  {-fast-redirects}
1227  www.ukc.ac.uk/cgi-bin/wac\.cgi\?
1228  login.yahoo.com
1229    
1230
1231 Turn on page filtering, with one exception for sourceforge:
1232
1233  # Run everything through the default filter file (re_filterfile):
1234  {+filter}
1235  
1236  # But please don't re_filter code from sourceforge!
1237  {-filter}
1238  .cvs.sourceforge.net
1239    
1240
1241 Now some URLs that we want "blocked", ie we won't see them. Many of these use
1242 regular expressions that will expand to match multiple URLs:
1243
1244   # Blocklist:
1245   {+block}
1246   /.*/(.*[-_.])?ads?[0-9]?(/|[-_.].*|\.(gif|jpe?g))
1247   /.*/(.*[-_.])?count(er)?(\.cgi|\.dll|\.exe|[?/])
1248   /.*/(ng)?adclient\.cgi
1249   /.*/(plain|live|rotate)[-_.]?ads?/
1250   /.*/(sponsor)s?[0-9]?/
1251   /.*/_?(plain|live)?ads?(-banners)?/
1252   /.*/abanners/
1253   /.*/ad(sdna_image|gifs?)/
1254   /.*/ad(server|stream|juggler)\.(cgi|pl|dll|exe)
1255   /.*/adbanners/
1256   /.*/adserver
1257   /.*/adstream\.cgi
1258   /.*/adv((er)?ts?|ertis(ing|ements?))?/
1259   /.*/banner_?ads/
1260   /.*/banners?/
1261   /.*/banners?\.cgi/
1262   /.*/cgi-bin/centralad/getimage
1263   /.*/images/addver\.gif
1264   /.*/images/marketing/.*\.(gif|jpe?g)
1265   /.*/popupads/
1266   /.*/siteads/
1267   /.*/sponsor.*\.gif
1268   /.*/sponsors?[0-9]?/
1269   /.*/advert[0-9]+\.jpg
1270   /Media/Images/Adds/
1271   /ad_images/
1272   /adimages/
1273   /.*/ads/
1274   /bannerfarm/
1275   /grafikk/annonse/
1276   /graphics/defaultAd/
1277   /image\.ng/AdType
1278   /image\.ng/transactionID
1279   /images/.*/.*_anim\.gif # alvin brattli
1280   /ip_img/.*\.(gif|jpe?g)
1281   /rotateads/
1282   /rotations/ 
1283   /worldnet/ad\.cgi
1284   /cgi-bin/nph-adclick.exe/
1285   /.*/Image/BannerAdvertising/
1286   /.*/ad-bin/
1287   /.*/adlib/server\.cgi
1288   /autoads/
1289    
1290
1291 -------------------------------------------------------------------------------
1292
1293 3.2.3. Aliases
1294
1295 Custom "actions", known to Junkbuster as "aliases", can be defined by combining
1296 other "actions". These can in turn be invoked just like the built-in "actions".
1297 Currently, an alias can contain any character except space, tab, "=", "{" or "}
1298 ". But please use only "a"- "z", "0"-"9", "+", and "-". Alias names are not
1299 case sensitive, and must be defined before anything else in the ijb.actionfile
1300 ! And there can only be one set of "aliases" defined.
1301
1302 Now let's define a few aliases:
1303
1304  # Useful customer aliases we can use later. These must come first!
1305  {{alias}}
1306  +no-cookies = +no-cookies-set +no-cookies-read
1307  -no-cookies = -no-cookies-set -no-cookies-read
1308  fragile     =
1309  -block -no-cookies -filter -fast-redirects -hide-referer -no-popups
1310  shop        = -no-cookies -filter -fast-redirects
1311  +imageblock = +block +image
1312
1313  #For people who don't like to type too much:  ;-)
1314  c0 = +no-cookies
1315  c1 = -no-cookies
1316  c2 = -no-cookies-set +no-cookies-read
1317  c3 = +no-cookies-set -no-cookies-read
1318  #... etc.  Customize to your heart's content.
1319    
1320
1321 Some examples using our "shop" and "fragile" aliases from above:
1322
1323  # These sites are very complex and require
1324  # minimal interference.
1325  {fragile}
1326  .office.microsoft.com
1327  .windowsupdate.microsoft.com
1328  .nytimes.com
1329
1330  # Shopping sites - still want to block ads.
1331  {shop}
1332  .quietpc.com
1333  .worldpay.com   # for quietpc.com
1334  .jungle.com
1335  .scan.co.uk
1336
1337  # These shops require pop-ups
1338  {shop -no-popups}
1339  .dabs.com
1340  .overclockers.co.uk
1341    
1342
1343 -------------------------------------------------------------------------------
1344
1345 3.3. The Filter File
1346
1347 The filter file defines what filtering of web pages Junkbuster does. The
1348 default filter file is re_filterfile, located in the config directory. In this
1349 file, any document content, whether viewable text or embedded non-visible
1350 content, can be changed.
1351
1352 This file uses regular expressions to alter or remove any string in the target
1353 page. Some examples from the included default re_filterfile:
1354
1355 Stop web pages from displaying annoying messages in the status bar by deleting
1356 such references:
1357
1358  # The status bar is for displaying link targets, not pointless buzzwords.
1359  # Again, check it out on http://www.airport-cgn.de/.
1360  s/status='.*?';*//ig
1361    
1362
1363 Just for kicks, replace any occurrence of "Microsoft" with "MicroSuck":
1364
1365  s/microsoft(?!.com)/MicroSuck/ig
1366    
1367
1368 Kill those auto-refresh tags:
1369
1370  # Kill refresh tags. I like to refresh myself. Manually.
1371  # check it out on http://www.airport-cgn.de/ and go to the arrivals page.
1372  #
1373  s/<meta[^>]*http-equiv[^>]*refresh.*URL=([^>]*?)"?>/<link rev="x-refresh" href
1374 =$1>/i
1375  s/<meta[^>]*http-equiv="?page-enter"?[^>]*content=[^>]*>/<!
1376 --no page enter for me-->/i
1377    
1378
1379 -------------------------------------------------------------------------------
1380
1381 4. Quickstart to Using Junkbuster
1382
1383 Install package, then run and enjoy! Junbuster accepts only one command line
1384 option -- the configuration file to be used. Example Unix startup command:
1385
1386                                                                                
1387  # /usr/sbin/junkbuster /etc/junkbuster/config                                 
1388                                                                                
1389                                                                                
1390
1391 An init script is provided for SuSE and Redhat.
1392
1393 For for SuSE: /etc/rc.d/junkbuster start
1394
1395 For RedHat: /etc/rc.d/init.d/junkbuster start
1396
1397 If no configuration file is specified on the command line, Junkbuster will look
1398 for a file named config in the current directory. Except on Amiga where it will
1399 look for AmiTCP:db/junkbuster/config and Win32 where it will try config.txt. If
1400 no file is specified on the command line and no default configuration file can
1401 be found, Junkbuster will fail to start.
1402
1403 Be sure your browser is set to use the proxy which is by default at localhost,
1404 port 8000. With Netscape (and Mozilla), this can be set under Edit ->
1405 Preferences -> Advanced -> Proxies -> HTTP Proxy. For Internet Explorer: Tools
1406 > Internet Properties -> Connections -> LAN Setting. Then, check "Use Proxy"
1407 and fill in the appropriate info (Address: localhost, Port: 8000). Include if
1408 HTTPS proxy support too.
1409
1410 The included default configuration files should give a reasonable starting
1411 point, though may be somewhat aggressive in blocking junk. You will probably
1412 want to keep an eye out for sites that require persistant cookies, and add
1413 these to ijb.action as needed. By default, most of these will be accepted only
1414 during the current browser session, until you add them to the configuration. If
1415 you want the browser to handle this instead, you will need to edit ijb.action
1416 and disable this feature. If you use more than one browser, it would make more
1417 sense to let Junkbuster handle this. In which case, the browser(s) should be
1418 set to accept all cookies.
1419
1420 If a particular site shows problems loading properly, try adding it to the
1421 {fragile} section of ijb.action. This will turn off most actions for this site.
1422
1423 HTTP/1.1 support is not fully implemented. If browsers that support HTTP/1.1
1424 (like Mozilla or recent versions of I.E.) experience problems, you might try to
1425 force HTTP/1.0 compatiblity. For Mozilla, look under Edit -> Preferences ->
1426 Debug -> Networking. Or set the "+downgrade" config option in ijb.action.
1427
1428 After running Junkbuster for a while, you can start to fine tune the
1429 configuration to suit your personal, or site, preferences and requirements.
1430 There are many, many aspects that can be customized. "Actions" (as specified in
1431 ijb.action) can be adjusted by pointing your browser to http://i.j.b/, and then
1432 follow the link to "edit the actions list". (This is an internal page and does
1433 not require Internet access.)
1434
1435 In fact, various aspects of Junkbuster configuration can be viewed from this
1436 page, including current configuration parameters, source code version numbers,
1437 the browser's request headers, and "actions" that apply to a given URL. In
1438 addition to the ijb.action file editor mentioned above, Junkbuster can also be
1439 turned "on" and "off" from this page.
1440
1441 If you encounter problems, please verify it is a Junkbuster bug, by disabling
1442 Junkbuster, and then trying the same page. Also, try another browser if
1443 possible to eliminate browser or site problems. Before reporting it as a bug,
1444 see if there is not a configuration option that is enabled that is causing the
1445 page not to load. You can then add an exception for that page or site. If a
1446 bug, please report it to the developers (see below).
1447
1448 -------------------------------------------------------------------------------
1449
1450 5. Contact the Developers
1451
1452 Feature requests and other questions should be posted to the Feature request
1453 page at SourceForge. There is also an archive there.
1454
1455 Anyone interested in actively participating in development and related
1456 discussions can join the appropriate mailing list here. Archives are available
1457 here too.
1458
1459 Please report bugs, using the form at Sourceforge. Please try to verify that it
1460 is a Junkbuster bug, and not a browser or site bug first. Also, check to make
1461 sure this is not already a known bug.
1462
1463 -------------------------------------------------------------------------------
1464
1465 6. Copyright and History
1466
1467 6.1. License
1468
1469 Internet Junkbuster is free software; you can redistribute it and/or modify it
1470 under the terms of the GNU General Public License as published by the Free
1471 Software Foundation; either version 2 of the License, or (at your option) any
1472 later version.
1473
1474 This program is distributed in the hope that it will be useful, but WITHOUT ANY
1475 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1476 PARTICULAR PURPOSE. See the GNU General Public License for more details, which
1477 is available from the Free Software Foundation, Inc, 59 Temple Place - Suite
1478 330, Boston, MA 02111-1307, USA.
1479
1480 -------------------------------------------------------------------------------
1481
1482 6.2. History
1483
1484 Junkbuster was originally written by Anonymous Coders and JunkBusters
1485 Corporation, and was released as free open-source software under the GNU GPL. 
1486 Stefan Waldherr made many improvements, and started the SourceForge project to
1487 rekindle development. The last stable release was v2.0.2, which has now grown
1488 whiskers ;-).
1489
1490 -------------------------------------------------------------------------------
1491
1492 7. See also
1493
1494   http://sourceforge.net/projects/ijbswa
1495
1496   http://ijbswa.sourceforge.net/
1497
1498   http://i.j.b/
1499
1500   http://www.junkbusters.com/ht/en/cookies.html
1501
1502   http://www.waldherr.org/junkbuster/
1503
1504   http://privacy.net/analyze/
1505
1506  http://www.squid-cache.org/
1507
1508  
1509
1510 -------------------------------------------------------------------------------
1511
1512 8. Appendix
1513
1514 8.1. Regular Expressions
1515
1516 Junkbuster can use "regular expressions" in various config files. Assuming
1517 support for "pcre" (Perl Compatible Regular Expressions) is compiled in, which
1518 is the default. Such configuration directives do not require regular
1519 expressions, but they can be used to increase flexibility by matching a pattern
1520 with wildcards against URLs.
1521
1522 If you are reading this, you probably don't understand what "regular
1523 expressions" are, or what they can do. So this will be a very brief
1524 introduction only. A full explanation would require a book ;-)
1525
1526 "Regular expressions" is a way of matching one character expression against
1527 another to see if it matches or not. One of the "expressions" is a literal
1528 string of readable characters (letter, numbers, etc), and the other is a
1529 complex string of literal characters combined with wildcards, and other special
1530 characters, called metacharacters. The "metacharacters" have special meanings
1531 and are used to build the complex pattern to be matched against. Perl
1532 Compatible Regular Expressions is an enhanced form of the regular expression
1533 language with backward compatibility.
1534
1535 To make a simple analogy, we do something similar when we use wildcard
1536 characters when listing files with the dir command in DOS. *.* matches all
1537 filenames. The "special" character here is the asterik which matches any and
1538 all characters. We can be more specific and use ? to match just individual
1539 characters. So "dir file?.text" would match "file1.txt", "file2.txt", etc. We
1540 are pattern matching, using a similar technique to "regular expressions"!
1541
1542 Regular expressions do essentially the same thing, but are much, much more
1543 powerful. There are many more "special characters" and ways of building complex
1544 patterns however. Let's look at a few of the common ones, and then some
1545 examples:
1546
1547 . - Matches any single character, e.g. "a", "A", "4", ":", or "@".
1548
1549 ? - The preceding character or expression is matched ZERO or ONE times. Either/
1550 or.                                                                            
1551
1552 + - The preceding character or expression is matched ONE or MORE times.
1553
1554 * - The preceding character or expression is matched ZERO or MORE times.
1555
1556 \ - The "escape" character denotes that the following character should be taken
1557 literally. This is used where one of the special characters (e.g. ".") needs to
1558 be taken literally and not as a special metacharacter.                         
1559
1560 [] - Characters enclosed in brackets will be matched if any of the enclosed    
1561 characters are encountered.                                                    
1562
1563 () - Pararentheses are used to group a sub-expression, or multiple             
1564 sub-expressions.                                                               
1565
1566 | - The "bar" character works like an "or" conditional statement. A match is   
1567 successful if the sub-expression on either side of "|" matches.                
1568
1569 s/string1/string2/g - This is used to rewrite strings of text. "string1" is    
1570 replaced by "string2" in this example.                                         
1571
1572 These are just some of the ones you are likely to use when matching URLs with
1573 Junkbuster, and is a long way from a definitive list. This is enough to get us
1574 started with a few simple examples which may be more illuminating:
1575
1576 /.*/banners/.* - A simple example that uses the common combination of "." and "
1577 *" to denote any character, zero or more times. In other words, any string at
1578 all. So we start with a literal forward slash, then our regular expression
1579 pattern (".*") another literal forward slash, the string "banners", another
1580 forward slash, and lastly another ".*". We are building a directory path here.
1581 This will match any file with the path that has a directory named "banners" in
1582 it. The ".*" matches any characters, and this could conceivably be more forward
1583 slashes, so it might expand into a much longer looking path. For example, this
1584 could match: "/eye/hate/spammers/banners/annoy_me_please.gif", or just "/
1585 banners/annoying.html", or almost an infinite number of other possible
1586 combinations, just so it has "banners" in the path somewhere.
1587
1588 A now something a little more complex:
1589
1590 /.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have several literal forward
1591 slashes again ("/"), so we are building another expression that is a file path
1592 statement. We have another ".*", so we are matching against any conceivable
1593 sub-path, just so it matches our expression. The only true literal that must
1594 match our pattern is adv, together with the forward slashes. What comes after
1595 the "adv" string is the interesting part.
1596
1597 Remember the "?" means the preceding expression (either a literal character or
1598 anything grouped with "(...)" in this case) can exist or not, since this means
1599 either zero or one match. So "((er)?ts?|ertis(ing|ements?))" is optional, as
1600 are the individual sub-expressions: "(er)", "(ing|ements?)", and the "s". The "
1601 |" means "or". We have two of those. For instance, "(ing|ements?)", can expand
1602 to match either "ing" OR "ements?". What is being done here, is an attempt at
1603 matching as many variations of "advertisement", and similar, as possible. So
1604 this would expand to match just "adv", or "advert", or "adverts", or
1605 "advertising", or "advertisement", or "advertisements". You get the idea. But
1606 it would not match "advertizements" (with a "z"). We could fix that by changing
1607 our regular expression to: "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/", which
1608 would then match either spelling.
1609
1610 /.*/advert[0-9]+\.(gif|jpe?g) - Again another path statement with forward
1611 slashes. Anything in the square brackets "[]" can be matched. This is using
1612 "0-9" as a shorthand expression to mean any digit one through nine. It is the
1613 same as saying "0123456789". So any digit matches. The "+" means one or more of
1614 the preceding expression must be included. The preceding expression here is
1615 what is in the square brackets -- in this case, any digit one through nine.
1616 Then, at the end, we have a grouping: "(gif|jpe?g)". This includes a "|", so
1617 this needs to match the expression on either side of that bar character also. A
1618 simple "gif" on one side, and the other side will in turn match either "jpeg"
1619 or "jpg", since the "?" means the letter "e" is optional and can be matched
1620 once or not at all. So we are building an expression here to match image GIF or
1621 JPEG type image file. It must include the literal string "advert", then one or
1622 more digits, and a "." (which is now a literal, and not a special character,
1623 since it is escaped with "\"), and lastly either "gif", or "jpeg", or "jpg".
1624 Some possible matches would include: "//advert1.jpg", "/nasty/ads/
1625 advert1234.gif", "/banners/from/hell/advert99.jpg". It would not match
1626 "advert1.gif" (no leading slash), or "/adverts232.jpg" (the expression does not
1627 include an "s"), or "/advert1.jsp" ("jsp" is not in the expression anywhere).
1628
1629 s/microsoft(?!.com)/MicroSuck/i - This is a substitution. "MicroSuck" will
1630 replace any occurence of "microsoft". The "i" at the end of the expression
1631 means ignore case. The "(?!.com)" means the match should fail if "microsoft" is
1632 followed by ".com". In other words, this acts like a "NOT" modifier. In case
1633 this is a hyperlink, we don't want to break it ;-).
1634
1635 We are barely scratching the surface of regular expressions here so that you
1636 can understand the default Junkbuster configuration files, and maybe use this
1637 knowledge to customize your own installation. There is much, much more that can
1638 be done with regular expressions. Now that you know enough to get started, you
1639 can learn more on your own :/
1640
1641 More reading on Perl Compatible Regular expressions: http://www.perldoc.com/
1642 perl5.6/pod/perlre.html
1643