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