org.mortbay.servlet
Class ProxyServlet
java.lang.Object
org.mortbay.servlet.ProxyServlet
- All Implemented Interfaces:
- Servlet
- Direct Known Subclasses:
- ProxyServlet.Transparent
public class ProxyServlet
- extends Object
- implements Servlet
Proxy Servlet.
Forward requests to another server either as a standard web proxy (as defined by
RFC2616) or as a transparent proxy.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_DontProxyHeaders
protected HashSet _DontProxyHeaders
_config
protected ServletConfig _config
_context
protected ServletContext _context
ProxyServlet
public ProxyServlet()
init
public void init(ServletConfig config)
throws ServletException
- Specified by:
init
in interface Servlet
- Throws:
ServletException
getServletConfig
public ServletConfig getServletConfig()
- Specified by:
getServletConfig
in interface Servlet
service
public void service(ServletRequest req,
ServletResponse res)
throws ServletException,
IOException
- Specified by:
service
in interface Servlet
- Throws:
ServletException
IOException
proxyHttpURL
protected URL proxyHttpURL(String scheme,
String serverName,
int serverPort,
String uri)
throws MalformedURLException
- Resolve requested URL to the Proxied URL
- Parameters:
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.
- Returns:
- The URL to which the request should be proxied.
- Throws:
MalformedURLException
handleConnect
public void handleConnect(HttpServletRequest request,
HttpServletResponse response)
throws IOException
- Throws:
IOException
getServletInfo
public String getServletInfo()
- Specified by:
getServletInfo
in interface Servlet
destroy
public void destroy()
- Specified by:
destroy
in interface Servlet
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.