From Agentgroup
Revision as of 08:39, 29 May 2008 by Cynthia Emilia Villalba Cardozo (Talk | contribs) (Download the PROOF (formerly ProWeb) code v1)

Jump to: navigation, search

Download the PROOF (formerly ProWeb) code v1

The PROOF code was developed by Marco Massari during his thesis work at the University of Modena.

Download code



Guide to the installation of the framework


PROOF (formerly ProWeb) is a proxy server that can change its behaviour depending on the installed software module (called Proxy Module). PROOF is implemented as a general-purpose proxy framework that can embody an application-specific module. Users can exploit the services provided by the module using browsers which

Both the Proxy application and the Proxy Modules are implemented in Java; the classes and interfaces are grouped in the proxy package.

2.Requirements and Terminology

Two or more hosts are needed to let the application work. Only one of them executes the proxy application, and becomes the proxy server for the other hosts, which are the clients where users run the browsers. In the following, the host executing the proxy application is called Proxy-host, while the other hosts are called Client-hosts. Note that a user can run a browser also on the Proxy-host; in this case, the Proxy-host is also a Client-host. The proxy application requires a Java Virtual Machine 1.1.4 or later running on the Proxy-host. On the client side, a Java 1.1 enabled browser is required on the Client-host.

The following table summarises the above requirements:


  • Operating System for which the JDK 1.1.4 or later is available (i.e., Windows 9x, Unix);
  • JDK 1.1.4 or later.


  • Browser Java 1.1 enabled (i.e., Netscape o Communicator 4.04 or later, Internet Explorer 4.0x)

  =====3.Configuration of the Proxy-host=====
     First of all, creating a "container" directory could be useful. Such directory is called BASE_DIR in the following, and will contain all the directories created during the configuration process. We assume that the absolute path, including the BASE_DIR directory, is called BASE_PATH.
     For example, on a Unix box you can create the directory marcomas in the path /export/home; the corresponding BASE_PATH is:

3.1 Installation of the Proxy application
     To install the proxy application, you need:
        1. Being sure that on the Proxy-host the JDK 1.1.4 or later is available.
        2. Creating a directory in the BASE_DIR one. Let PROXY_APP_DIR be the name of such directory.
        3. Copying in the directory PROXY_APP_DIR the following files that compose the Proxy application:

ProxyMain.class GenericServer.class ProxyServer.class MessageServer.class ProxyConnection.class AppletConnection.class The main class (i.e., the class that contains the main() method) is in the file ProxyMain.class.

Since PROXY_APP_DIR is a subdirectory of BASE_DIR, the absolute path of the directory containing the .class files of the Proxy application is: BASE_PATH<DirSep>PROXY_APP_DIR Where <DirSep> is the directory separator of the used file-system (the slash "/" on Unix, the back-slash "\" on Windows 9x).

For example, you can chose the directory ProxyMain as PROXY_APP_DIR. Following the previous example, the absolute path becomes:


3.2 Installation of the "proxy" package

The Proxy application needs the classes and the interfaces of the "proxy" package to work correctly. To install such package act as follows:

  1. Create a new subdirectory of the BASE_DIR one. The name of this new directory MUST be proxy, since it contains the files of the classes belonging to the package proxy.
  2. Copy in the directory PROXY_APP_DIR the following files that belong to the "proxy" package:
     AppletMsg.class 	HTTPRequest.class
     AppletMsgBuffer.class 	HTTPResponse.class
     AppletMsgListener.class 	IllegalMethodCallException.class
     AppletMsgProtocol.class 	InvalidFrameTagException.class
     AppletMsgStatement.class 	MalformedAppletMsgException.class
     AppletMsgSupport.class 	MimeContent.class
     BadProxyModuleException.class 	ProxyEnvironment.class
     BinaryContent.class 	ProxyService.class
     ControlAppletTag.class 	ProxyServiceMain.class
     EncodedUrlContent.class 	ProxyServiceMsgManager.class
     Frame.class 	TextContent.class
     FrameSet.class 	ThisProxy.class
     HTMLParser.class 	UnexpectedFrameException.class
     HTMLTag.class 	User.class
     HTTPConnection.class 	UserAlreadyLoggedException.class
     HTTPMessage.class 	URLFile.class
     Since proxy is a subdirectory of BASE_DIR, the absolute path of the directory containing the .class files of the "proxy" package is:
           BASE_PATH<DirSep>proxy Following the previous example, the absolute path becomes:
  3. To let the application use the classes and the interfaces of the "proxy" package, the BASE_PATH must be added to the system variable CLASSPATH. Note that the directory containing the subdirectory proxy must be added to the CLASSPATH variable, NOT the directory proxy itself!

3.3 Installation of a Proxy Module in the Proxy Application

A Proxy Module must be installed in the Proxy application to make the application work. For each Proxy Module you must:

  1. Create a new subdirectory of BASE_DIR where all the .class files of the Proxy Module will be stored. Let call such directory PROXY_MOD_DIR.
  2. Copy in the directory PROXY_MOD_DIR all the .class files of the Proxy Module, except those ones that contain the byte-code of the Control Applet of the Proxy Module.
     Since PROXY_MOD_DIR is a subdirectory of BASE_DIR, the absolute path of the directory containing the .class files of the "proxy" package is:
           BASE_PATH<DirSep>PROXY_MOD_DIR Copy the files that define the Control Applet in the directory PROXY_APP_DIR (par. 3.1).

3. 4. To let the Proxy application use the classes of the Proxy Module, add the directory PROXY_MOD_DIR to the CLASSPATH variable.

  5. Add a line in the ASCII file proxyconfig.txt, to tell the Proxy which is the name (without the .class extension) of the main class that implement the Main Component of the Proxy Module. If the proxyconfig.txt file does not exist (you are installing the first ), it must be created in the PROXY_APP_DIR (par. 3.1) directory.

In the downloadable file with the code you can find two Proxy Module examples:

   * Cache Module;
   * SynchBrowsing Module;

Following the previous Unix example, to install the Cache Module, you must:

  1. Create the directory CacheModule as subdirectory of
  2. /export/home/marcomas Copy in the directory CacheModule the following files:
  3. CacheFile.class Copy the file:
     in the directory /export/home/marcomas
  4. Add /export/home/marcomas/CacheModule in the CLASSPATH variable.
  5. Add the following line to the proxyconfig.txt file:


To install the SynchBrowsing Module the needed actions are similar:

  1. Create the directory SynchBrowsingModule as subdirectory of /export/home/marcomas.
  2. Copy the following files in the SynchBrowsingModule directory:
  3. Copy the file:
     in the directory /export/home/marcomas
  4. Add /export/home/marcomas/SynchBrowsingModule in the CLASSPATH variable.
  5. Add the following line to the proxyconfig.txt file:


3.4 Execution of the Proxy application

You can now execute the Proxy application, by the command

java ProxyMain

Remember that the ProxyMain.class is the class containing the main() method.

On a Unix box, you can define the following Shell script: CLASSPATH=/usr/local/jdk/lib/ export CLASSPATH cd /export/home/marcomas/ProxyMain java ProxyMain

Where the JDK library file is assumed to be set in :


  1. Configuration of the Client-hosts

Disregarding the Operating System, on each Client-host there must be a browser Java 1.1 enabled. Such browser must be configured to use the Proxy-host as the proxy server.

In each HTML page, the Proxy application inserts the Control Applet provided by the installed Proxy Module. There are two ways the browser can load the .class files of the Control Applet:

  1. Retrieving all files from the Proxy itself
  2. Finding a local copy of the "proxy" package. i.e., a copy installed on the Client-host.

In the case a) the Client-host does not need configuring.

In the case b) the "proxy" package must be installed on the Client-host as done on the Proxy-host (par. 3.2). In particular, you must take care about the CLASSPATH variable, because the browser must be able to retrieve the .class files of the package.

In the following we assume to use the browser Netscape Communicator 4.05 on a Unix box and that the absolute path of the file java40.jar (which contains the JVM classes for the browser), is the following:


The following Shell script can be useful to run the browser:

CLASSPATH=/usr/local/communicator405/java40.jar:/export/home/marcomas/ export CLASSPATH /usr/local/communicator405/netscape &

We have assumed that the "proxy" package is installed in the directory /export/home/marcomas/. Note that the path of the classes of Communicator (java40.jar) must precede the other ones in the CLASSPATH variable.

  1. Test Configuration

Our first test is based on 2 host. The Proxy-host is used also as Client-host, to have 2 Client-hosts.