public class ProxyServlet extends AbstractProxyServlet
HttpClient
instance is set as context attribute,
prefixed with the servlet's name and exposed by the mechanism provided by
ServletContext.setAttribute(String, Object)
.
The following init parameters may be used to configure the servlet:
AbstractProxyServlet.createHttpClient()
for init parameters used to configure
the HttpClient
instance.ConnectHandler
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected class |
ProxyServlet.ProxyInputStreamContentProvider |
protected class |
ProxyServlet.ProxyResponseListener |
static class |
ProxyServlet.Transparent
Convenience extension of
ProxyServlet that offers transparent proxy functionalities. |
AbstractProxyServlet.TransparentDelegate
_log, HOP_HEADERS
Constructor and Description |
---|
ProxyServlet() |
addProxyHeaders, addViaHeader, addXForwardedHeaders, copyRequestHeaders, createHttpClient, createLogger, destroy, findConnectionHeaders, getBlackListHosts, getHostHeader, getHttpClient, getRequestId, getTimeout, getViaHost, getWhiteListHosts, hasContent, init, newHttpClient, onClientRequestFailure, onProxyResponseFailure, onProxyResponseSuccess, onProxyRewriteFailed, onServerResponseHeaders, rewriteTarget, sendProxyRequest, setTimeout, validateDestination
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
service
in class HttpServlet
ServletException
IOException
@Deprecated protected void copyHeaders(HttpServletRequest clientRequest, Request proxyRequest)
AbstractProxyServlet.copyRequestHeaders(HttpServletRequest, Request)
insteadprotected ContentProvider proxyRequestContent(Request proxyRequest, HttpServletRequest request) throws IOException
IOException
protected Response.Listener newProxyResponseListener(HttpServletRequest request, HttpServletResponse response)
newProxyResponseListener
in class AbstractProxyServlet
protected void onClientRequestFailure(Request proxyRequest, HttpServletRequest request, Throwable failure)
@Deprecated protected void onRewriteFailed(HttpServletRequest request, HttpServletResponse response) throws IOException
IOException
@Deprecated protected void onResponseHeaders(HttpServletRequest request, HttpServletResponse response, Response proxyResponse)
protected String filterServerResponseHeader(HttpServletRequest clientRequest, Response serverResponse, String headerName, String headerValue)
filterServerResponseHeader
in class AbstractProxyServlet
protected void onResponseContent(HttpServletRequest request, HttpServletResponse response, Response proxyResponse, byte[] buffer, int offset, int length, Callback callback)
@Deprecated protected void onResponseSuccess(HttpServletRequest request, HttpServletResponse response, Response proxyResponse)
@Deprecated protected void onResponseFailure(HttpServletRequest request, HttpServletResponse response, Response proxyResponse, Throwable failure)
@Deprecated protected URI rewriteURI(HttpServletRequest request)
AbstractProxyServlet.rewriteTarget(HttpServletRequest)
@Deprecated protected void customizeProxyRequest(Request proxyRequest, HttpServletRequest request)
@Deprecated protected String filterResponseHeader(HttpServletRequest request, String headerName, String headerValue)
filterServerResponseHeader(HttpServletRequest, Response, String, String)
insteadheaderName
- the header nameheaderValue
- the header valuerequest
- the request to proxyCopyright © 1995-2015 Webtide. All Rights Reserved.