|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.servlets.ProxyServlet
public class ProxyServlet
Asynchronous Proxy Servlet. Forward requests to another server either as a standard web proxy (as defined by RFC2616) or as a transparent proxy.
This servlet needs the jetty-util and jetty-client classes to be available to the web application.
To facilitate JMX monitoring, the "HttpClient", it's "ThreadPool" and the "Logger" are set as context attributes prefixed with the servlet name.
The following init parameters may be used to configure the servlet:
ConnectHandler
Nested Class Summary | |
---|---|
static class |
ProxyServlet.Transparent
Transparent Proxy. |
Field Summary | |
---|---|
protected HostMap<PathMap> |
_black
|
protected HttpClient |
_client
|
protected javax.servlet.ServletConfig |
_config
|
protected javax.servlet.ServletContext |
_context
|
protected java.util.HashSet<java.lang.String> |
_DontProxyHeaders
|
protected java.lang.String |
_hostHeader
|
protected Logger |
_log
|
protected HostMap<PathMap> |
_white
|
Constructor Summary | |
---|---|
ProxyServlet()
|
Method Summary | |
---|---|
void |
destroy()
|
java.lang.String |
getHostHeader()
Get the hostHeader. |
javax.servlet.ServletConfig |
getServletConfig()
|
java.lang.String |
getServletInfo()
|
void |
handleConnect(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
void |
init(javax.servlet.ServletConfig config)
|
protected HttpURI |
proxyHttpURI(java.lang.String scheme,
java.lang.String serverName,
int serverPort,
java.lang.String uri)
|
void |
service(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res)
|
void |
setHostHeader(java.lang.String hostHeader)
Set the hostHeader. |
boolean |
validateDestination(java.lang.String host,
java.lang.String path)
Check the request hostname and path against white- and blacklist. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Logger _log
protected HttpClient _client
protected java.lang.String _hostHeader
protected java.util.HashSet<java.lang.String> _DontProxyHeaders
protected javax.servlet.ServletConfig _config
protected javax.servlet.ServletContext _context
protected HostMap<PathMap> _white
protected HostMap<PathMap> _black
Constructor Detail |
---|
public ProxyServlet()
Method Detail |
---|
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
javax.servlet.ServletException
public boolean validateDestination(java.lang.String host, java.lang.String path)
host
- hostname to checkpath
- path to check
public javax.servlet.ServletConfig getServletConfig()
getServletConfig
in interface javax.servlet.Servlet
public java.lang.String getHostHeader()
public void setHostHeader(java.lang.String hostHeader)
hostHeader
- the hostHeader to setpublic void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) throws javax.servlet.ServletException, java.io.IOException
service
in interface javax.servlet.Servlet
javax.servlet.ServletException
java.io.IOException
public void handleConnect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
java.io.IOException
protected HttpURI proxyHttpURI(java.lang.String scheme, java.lang.String serverName, int serverPort, java.lang.String uri) throws java.net.MalformedURLException
java.net.MalformedURLException
public java.lang.String getServletInfo()
getServletInfo
in interface javax.servlet.Servlet
public void destroy()
destroy
in interface javax.servlet.Servlet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |