The first step of implementing this web filtering system was to consider its goals and determine the programming language features that would be needed to design and implement the system. The following programming language features were found to be essential: networking, threads, exceptions, and regular expressions. Networking support is required since the filtering system is based on communicating over World Wide Web. Threads are needed to handle simultaneous transactions and to execute filters in a fast and efficient manner. Exceptions are needed to effectively handle error conditions that occur when using the network and processing data. Finally, regular expressions are needed to perform pattern matching when processing HTTP and HTML documents.
The language chosen that supported all of the essential features was
the Java programming language developed by Sun Microsystems. Except
for regular expressions which is supported by a Free Software library
written by Wes Biggs
,
the standard Java distribution comes with support for all the
essential features. As an added bonus, Java is based on a Virtual
Machine architecture which allows the resulting application to execute
on any operating system where Java is supported. This includes most
Unix platforms, Windows 95 & NT, and MacOS.
The second step of the implementation was to determine how the filtering system would interface with both web browsers and web servers. Considering that one of the goals of system is to not require any modifications to be made to web browsers or servers, the interface chosen was that of an HTTP proxy server. As a proxy server, the filtering system can act as a gateway between the web browser and server with all transactions between the two passing through the proxy and its filters. The only browser configuration needed is to set the proxy server preference to the address of the server running the filtering system.
The filtering system is implemented as a standalone Java application named Muffin. The Java source code is over 21,000 lines, with 128 classes and 12 interfaces. All that is required to execute Muffin is the single jar archive containing its Java classes and a Java runtime environment. Muffin can be used by almost every web browser since most browsers support the ability to use a proxy server.
This chapter will cover details of the filtering system and its implementation.