public class ProxyServlet extends 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 HashSet |
_DontProxyHeaders |
| Constructor and Description |
|---|
ProxyServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
ServletConfig |
getServletConfig() |
String |
getServletInfo() |
void |
handleConnect(HttpServletRequest request,
HttpServletResponse response) |
void |
init(ServletConfig config) |
protected URL |
proxyHttpURL(String scheme,
String serverName,
int serverPort,
String uri)
Resolve requested URL to the Proxied URL
|
void |
service(ServletRequest req,
ServletResponse res) |
protected 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, IOException
service in interface ServletServletExceptionIOExceptionprotected URL proxyHttpURL(String scheme, String serverName, int serverPort, String uri) throws 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.MalformedURLExceptionpublic void handleConnect(HttpServletRequest request, HttpServletResponse response) throws IOException
IOExceptionpublic String getServletInfo()
getServletInfo in interface ServletCopyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.