The basicweb Java package provides a very simple server, client, and proxy. These agents serve as a testbed for prototyping and demonstrating protocols like PEP.
Server.main takes creates a basic web server.
Server has the following security measures:
Proxy.main creates a web proxy that reads a proxy request from a client and passes the request to the server. The request is of the form:
method url HTTP/version
This differs from a standard request in the second field as it has a full URL where standard requests don't have the method://server:port portion.
I would like to take a moment to brag about the code re-use for the proxy. The ProxyServer is a standard Server that reads ProxyRequests instead of Requests. The ProxyRequest has a single purpose method dispatcher. The executed method is a ProxyClient that contacts the real server.
The client is a very simple single document retriever. The data disappears into a NullOutputStream.
Client.main interates through the input creating a new Client for each request. Requests are of the form
[-method] URL
If the method is not -get or -put, the argument is assumed to be a URL and the method is assumed to be a get. You may also enter a default proxy:
-proxy URL
which will serve the remaining reuqests until another -proxy argument is encountered