sunlabs.brazil.handler
public class MultiProxyHandler extends GenericProxyHandler
The {@link GenericProxyHandler} rewrites all of the links in each wepage to point back to the local. machine. Using this handler, if multiple virtual websites are configured, then links in one site that point to other virtual web sites are rewritten to point locally as well.
For example, suppose we have 2 MultiProxyhandlers A and B configured into the server as:
A.prefix=/foo/
A.host=www.foo.com
B.prefix=/bar/
B.host=www.bar.com
.
/foo/bar/test.html
will fetch
http://www.foo.com/bar/test.html
. If the result is
an html page, then any links in that page that resolve to
www.foo.com/...
will be rewritten to the local server
as /foo/...
, and any links that points to
www.bar.com/...
will be rewritten to
/bar/...
.
Version: 2.3, 07/03/21
Field Summary | |
---|---|
static Hashtable | proxies
Holds all proxy -> prefix mappings for this server. |
Method Summary | |
---|---|
boolean | init(Server server, String prefix)
Initialize this handler.
|
boolean | respond(Request request) |