org.mortbay.servlet
public class ProxyServlet extends java.lang.Object implements Servlet
Forward requests to another server either as a standard web proxy (as defined by RFC2616) or as a transparent proxy.
| Modifier and Type | Class and Description |
|---|---|
static class |
ProxyServlet.Transparent
Transparent Proxy.
|
| Modifier and Type | Field and Description |
|---|---|
protected ServletConfig |
_config |
protected ServletContext |
_context |
protected java.util.HashSet |
_DontProxyHeaders |
| Constructor and Description |
|---|
ProxyServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
ServletConfig |
getServletConfig() |
java.lang.String |
getServletInfo() |
void |
handleConnect(HttpServletRequest request,
HttpServletResponse response) |
void |
init(ServletConfig config) |
protected java.net.URL |
proxyHttpURL(java.lang.String scheme,
java.lang.String serverName,
int serverPort,
java.lang.String uri)
Resolve requested URL to the Proxied URL
|
void |
service(ServletRequest req,
ServletResponse res) |
protected java.util.HashSet _DontProxyHeaders
protected ServletConfig _config
protected ServletContext _context
public void init(ServletConfig config) throws ServletException
init in interface ServletServletExceptionpublic ServletConfig getServletConfig()
getServletConfig in interface Servletpublic void service(ServletRequest req, ServletResponse res) throws ServletException, java.io.IOException
service in interface ServletServletExceptionjava.io.IOExceptionprotected java.net.URL proxyHttpURL(java.lang.String scheme,
java.lang.String serverName,
int serverPort,
java.lang.String uri)
throws java.net.MalformedURLException
scheme - The scheme of the received request.serverName - The server encoded in the received request(which
may be from an absolute URL in the request line).serverPort - The server port of the received request (which
may be from an absolute URL in the request line).uri - The URI of the received request.java.net.MalformedURLExceptionpublic void handleConnect(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getServletInfo()
getServletInfo in interface ServletCopyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.