Generic Handler for implementing a simple web proxy.
By default, this is a dumb proxy. This can be extended to "log"
all requests, with possible side effects, and to provide pages
on request. The handler is NOT intended to be a general puupose
proxy handler (KISS). This should be replaced by a more general
purpose http/1.1 proxy
This is split up into more pieces than needed, to make it more
generically sub-classable, at the expense of more complexity.
Properties:
useproxy
The name of the SocketFactory class to use for this handler. If additional
parameters are required to set up the factory, it should be configured elsewhere.
This is here for convenience only.
auth
The value of the proxy-authenticate header (if any) sent to the upstream proxy
proxyHost
If specified, the name of the upstream proxy
proxyPort
The up stream proxys port, if a proxyHost is pecified (defaults to 80)
server - The HTTP server that created this Handler.
Typical Handlers will use Server.props
to obtain run-time configuration information.
prefix - A prefix that this Handler may prepend to all
of the keys that it uses to extract configuration information
from Server.props. This is set (by the Server
and ChainHandler) to help avoid configuration parameter
namespace collisions.
For example, if a Handler uses the property
"account", and the specified prefix is "bank.", then the
Handler should actually examine the property
"bank.account" in Server.props.
Returns:
true if this Handler initialized
successfully, false otherwise. If
false is returned, this Handler
should not be used.