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 []
# 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