Configuration of RabbIT2

Basically RabbIT uses one file for its configuration, normally it is conf/rabbit.conf.

The structure of this file is quite simple: it has sections and key-value pairs. Comments are allowed and everything from '#' to the line end is considered a comment.

Here is the standard configuration with explaining comments.

This file is partioned in several sections. # A section starts with [<name of section>] # If two (or more) sections are found with the same name they are # merged into one. [rabbit.proxy.Proxy] # This section holds the basic stuff needed for the proxy. # This is how many things RabbIT will log in the errorlog. # one of DEBUG, ALL, INFO, WARN, MSG, ERROR, FATAL (in that order) # Setting a level means you get that one and the one above: # The default is WARN wich will give you WARN, MSG, ERROR and FATAL. loglevel=WARN # This is the port the proxy listens on. # Use any port available (over 1024 unless you run as root). port=9666 # This is where RabbIT logs its errors and accesses # quite usefull if you want statistics. accesslog=logs/access_log errorlog=logs/error_log # This is the proxy that RabbIT should use when getting its files. # Leave it blank to dont have a proxy. # Both of these need to be set, or they will be ignored. proxyhost= proxyport= # If you want RabbIT to authenticate itself against another proxy # fill this in. # This is a string on the format "myuserid:mypassword" proxyauth= # This is the maximum number of simmultanius connections. maxconnections=500 # This is the small logo to use. # It is used in meta pages and other places. # Use $proxy to have RabbIT serve the image. logo=http://$proxy/FileSender/public/smallRabbIT2.gif # Are we allowed to proxy SSL? # We dont check the data so this is not recomended. # yes, no, portnumber are allowed options. allowSSL=443,444,445 # allow to these ports. #allowSSL=yes # allow to all ports. #allowSSL=no # dont allow sslproxying. #allowSSL=no # What do you want your proxy to identify itself as? # Server identy can be seen in HTTP header responses # in the Server-value. #serverIdentity=..__-My own super proxy-__.. [Handlers] # This section sets up the content handlers. # Each mime type can have its own handler. # Ok, we want regexp matching on these in the future. # Handle images by conversion to low quality jpegs. image/gif=rabbit.handler.ImageHandler image/jpeg=rabbit.handler.ImageHandler image/png=rabbit.handler.ImageHandler # Filter these streams. text/html=rabbit.handler.FilterHandler text/html; charset\=iso-8859-1=rabbit.handler.FilterHandler text/html; charset\=ISO-8859-1=rabbit.handler.FilterHandler # Seems Netscape and IE have problems with this one although # they both say it is ok, disabled for now.... #application/x-javascript=rabbit.handler.FilterHandler # Compress these streams. text/plain=rabbit.handler.GZIPHandler [CacheHandlers] # This section sets up the content handlers for the resourses in the # cache. Each mime type can have its own handler. For more info see # the Handlers section. # Note! dont use ImageHandler, FilterHandler or GZIPHandler in # both Handlers and CacheHandlers section since they write the # modified page to the cache. # Handle images by conversion to low quality jpegs. #image/gif=rabbit.handler.ImageHandler #image/jpeg=rabbit.handler.ImageHandler #image/png=rabbit.handler.ImageHandler # Filter these streams. #text/html=rabbit.handler.FilterHandler #text/html; charset\=iso-8859-1=rabbit.handler.FilterHandler # Seems Netscape and IE have problems with this one although # they both say it is ok, disabled for now.... #application/x-javascript=rabbit.handler.FilterHandler # Compress these streams. #text/plain=rabbit.handler.GZIPHandler [rabbit.cache.NCache] # This section sets up the cache. # The base directory for the cache. directory=/tmp/rcache # The time in hours to cache files, unless specified otherwise (in the # http header that is). cachetime=24 # The maximal size of the proxy in MB. # The cache sweeps at regular intervalls and if the cache is bigger # some stuff is cleaned out. maxsize=12 [rabbit.io.ConnectionHandler] # This section sets up the connection handler. # The maximal time to keepalive toward external hosts. # Note! if we fail to write to a connection, we retry so # It should be safe to have a high value. # Time is in miliseconds. keepalivetime=15000 [Filters] # This section sets up the filters to use. # A filter is one that may block/close the connection or just modifies # the request. # Accessfilters are based on the socket only. # These filters should have an # public static boolean doIPFiltering(Socket s) # method that returns false if connection should be closed directly # (before anything is read from the socket). accessfilters=rabbit.filter.AccessFilter # Here we filter the HTTP header, these filters should have an # public static HTTPHeader doHTTPInFiltering (Socket, HTTPHeader, # Connection) # method that may modify the incomming request. If a HTTPHeader is # returned it is sent to the client and the request is finished. (this # is an easy way to block some ads and other bad stuff). # # Available filters today are: # HTTPBaseFilter this is basically needed, use it. # DontFilterFilter stop the proxy from filtering certain pages. # DontCacheFilter stop the proxy from cacheing certain pages. # BlockFilter Dont allow access to certain pages. # HTTPSnoop Print the HTTP headers out on System.out. # ProxyAuth Perform proxy authentication on all users. httpinfilters=rabbit.filter.HTTPBaseFilter # This works as the httpinfilters except that the method is called # doHTTPOutFiltering instead # The available filters are the same as for httpinfilters but they # need not be. httpoutfilters=rabbit.filter.HTTPBaseFilter [rabbit.filter.AccessFilter] # This is a filter to allow simple accesscontrol. # this file store the available ip-ranges that can use the proxy. accessfile=conf/access [rabbit.filter.HTTPBaseFilter] # This is a basic filter (which _SHOULD_ be used). Basically RabbIT # is depending on this filter being used. # Remove these hop-headers. remove=Connection,Proxy-Connection,Keep-Alive,Public,Transfer-Encoding,Upgrade,Proxy-Authorization,TE,Proxy-Authenticate,Trailer # authenticate users (basic method only) with this user-password file. # this is used for meta/admin access... userfile=conf/users [rabbit.filter.ProxyAuth] # allowed user.. userfile=conf/allowed [rabbit.filter.BlockFilter] # This is a filter that blocks access to resources. # return a 304 forbidden for these requests. blockURLmatching=.sex.,.ad.,.ads.,/ad. [rabbit.handler.ImageHandler] # This handler converts images into low quality jpegs instead of high # quality gifs/pngs. # This is the program used to convert the images. convert=/usr/bin/convert # $filename is expanded to the right name(the cachefile) during # runtime convertargs=-quality 10 $filename[0] jpeg:$filename.c [rabbit.handler.FilterHandler] # This is the basic HTML page filter. It uses a few other HTMLFilters. # Note! if this filter is to compress the pages sent you need to set # GZIPHandler compress value to true (which is default). # use these HTMLFilters. available filters are: # BodyFilter This filter inserts a noproxy link at the top of the page. # BackgroundFilter This filter removes background images. # AdFilter This filter removes advertising from pages. # BlinkFilter This filter removes the <blink> tags. # LowresImageFilter This filter removes the lowres-attributes from <img> tags. filters=rabbit.filter.BodyFilter,rabbit.filter.BackgroundFilter,rabbit.filter.AdFilter,rabbit.filter.BlinkFilter,rabbit.filter.LowresImageFilter [rabbit.handler.GZIPHandler] # Use compress on data sent? # Seems to work well with both Netscape and IE. # Should we compress data streams? # valid values are "false" and everything else is considered true compress=true #compress=false [rabbit.filter.BackgroundFilter] # A Filter to remove background images. # This filter has no configuration options. [rabbit.filter.BodyFilter] # A Filter to insert a noproxy link at the start of each page. # This text before the link prefix=<center><font size=-2><a href="http://rabbit-proxy.sf.net/" target="_top">RabbIT</a> filtered this page. # And this text after. postfix=</font></center><br> # should we insert a link. unfilteredlink=true # visible name of the link link=unfiltered page [rabbit.filter.DontFilterFilter] # This filter stops filtering certain pages that otherwise would be # handled in a strange way (due to strange HTML that we parse # (in)correctly). # Match URL's, comma separated list. #dontFilterURLmatching=skribofont.se/prislistan/toolbar.asp [rabbit.filter.DontCacheFilter] # This filter stops cacheing of certain pages. It could be good for never # cacheing chat sites that dont send correct cache-control directives. # This filter can match on either URL or mime type. Remember that not # all sites supply correct mimes... # To match on URL append this class to the httpinfilters... # To match on mime type append this class to the httpoutfilters... # You may of course use both methods if wanted/needed. # All matching is done in lower case (of the URL/mime) so use that below. # Some examples: # Match URL's comma separated list. # This example dont cache any html or asp pages (this is probably stupid to do). #dontCacheURLmatching=.html,.asp # This example dont cache a certain site and page.. #dontCacheURLmatching=www.chat.com/index.html # This example only caches resources with .gif or .jpeg in it.. #onlyCacheURLmatching=.gif,.jpeg # dont cahce ordinary web pages. #dontCacheMimematching=text/html # dont cache text files (text/html, text/plain...) #dontCacheMimematching=text/ # Only cache gif images #onlyCacheMimematching=image/gif # Only cache images #onlyCacheMimematching=image [rabbit.filter.AdFilter] # A filter to remove advertising from pages. # The list of evils. Comma separated. adlinks=/ad/,/ads/,/ads2/,/netadsrv.,/ad.,/ads.,/ads2.,.ad.,.ads.,/ads1.,.ads1.,/adv/,/cadv/,/adserver.,/adlog.,.adbannercenter.,/nsads.,adclick.,/banner.,/banner/,/adverts/,.linkexchange.,/acc_clickthru,/adfinity,event.ng,/surfad,/redirect.,/gen_addframe,/m=,/ad=,/adclick.,/adfu.,?adnum=,.adzerver.,?advert=,?adname=,adforce.,/site_id=,copyleft.net,support.net,valinux.com,/ad_click,/redir.,?assoc= # The image to replace ads with. # Use $proxy to let the RabbIT serve the image. adreplacer=http://$proxy/FileSender/public/NoAd.gif [rabbit.filter.LowresImageFilter] # A filter that removes the lowres attributes from the img-tags. # This filter (currently) has no configuration options.