foxy.proxy

This is the core package of the application. It contains the server classes as well as sub-packages for special functionalities (filter, transform, connection) which are further explained in the following sections.

ProxyServer

This class represents the server-daemon. It listens at the server's TCP-port and starts a request-handling thread (called ProxyHandler) for any incoming connection. The server is usually started via the foxy.Shell-class (the only class in the root foxy package), which provides a text-based interface to view or change server-options as well as a clean way to shutdown the server.

ProxyHandler

After a connection has been delegated to the ProxyHandler, this thread takes responsibility for the incoming request. It first tries to find a pattern-definition according to the web server's host-name defined in the request. If a pattern-definition has been found, the PatternMatcher (see below) compares the request-data to it and - if a match occurred - delivers back a set of transformation-rules. The handler-thread then contacts the web server (note: the forwarded request to this server can also be modified by the proxy) and reads in the HTTP-response. Afterwards, the transformation-process itself is done (mostly) with the help of the transform- and filter- (sub-)packages. At the end, the ProxyHandler delivers the ''filtered'' (i.e. modified) response-data back to the client and stops.

Figure 2.8 shows a simplified diagram of this process. Simplified, because it does - due to readability-reasons - neither contain representations of the filter- and transformer-classes involved in the transformation-process nor the abstractions of the HTTP-connections (interface ProxyConnection) mentioned in the foxy.proxy.connection-package (see section 2.3.2).

PatternMatcher

This class is an enhanced representation of the pattern-element in the patterns-configuration-file. A hash table of PatternMatcher-objects (unique for every host) is stored in the server's environment (class ProxyEnvironment, see section 2.3.2) to ensure a quick and efficient way to match incoming requests against stored patterns.

ProxyEnvironment

This class holds important information about the running server. This involves the definitions of rules and rule-groups (stored in hash tables), a map of PatternMatcher-objects (see @@@), information about the server's status (port..) and logger-functionality.

root 2006-05-22