Package org.eclipse.jetty.proxy
Class ProxyServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.eclipse.jetty.proxy.AbstractProxyServlet
org.eclipse.jetty.proxy.ProxyServlet
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
- Direct Known Subclasses:
AsyncProxyServlet
,BalancerServlet
,ProxyServlet.Transparent
Servlet 3.0 asynchronous proxy servlet.
The request processing is asynchronous, but the I/O is blocking.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
static class
Convenience extension ofProxyServlet
that offers transparent proxy functionalities.Nested classes/interfaces inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet
AbstractProxyServlet.TransparentDelegate
-
Field Summary
Fields inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet
_log, CLIENT_REQUEST_ATTRIBUTE, HOP_HEADERS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Response.Listener
newProxyResponseListener
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) protected void
onContinue
(javax.servlet.http.HttpServletRequest clientRequest, Request proxyRequest) protected void
onResponseContent
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Response proxyResponse, byte[] buffer, int offset, int length, Callback callback) protected Request.Content
proxyRequestContent
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Request proxyRequest) Wraps the client-to-proxy request content in aRequest.Content
for the proxy-to-server request.protected void
service
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Methods inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet
addProxyHeaders, addViaHeader, addViaHeader, addXForwardedHeaders, clientRequestStatus, copyRequestHeaders, createHttpClient, createLogger, destroy, expects100Continue, filterServerResponseHeader, findConnectionHeaders, getBlackListHosts, getHostHeader, getHttpClient, getRequestId, getTimeout, getViaHost, getWhiteListHosts, hasContent, init, newClientConnector, newHttpClient, newHttpClient, newProxyRequest, onClientRequestFailure, onProxyResponseFailure, onProxyResponseSuccess, onProxyRewriteFailed, onServerResponseHeaders, proxyResponseStatus, rewriteTarget, sendProxyRequest, sendProxyResponseError, setTimeout, validateDestination
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
ProxyServlet
public ProxyServlet()
-
-
Method Details
-
service
protected void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException - Overrides:
service
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
proxyRequestContent
protected Request.Content proxyRequestContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Request proxyRequest) throws IOException Wraps the client-to-proxy request content in aRequest.Content
for the proxy-to-server request.- Parameters:
request
- the client-to-proxy requestresponse
- the proxy-to-client responseproxyRequest
- the proxy-to-server request- Returns:
- a proxy-to-server request content
- Throws:
IOException
- if the proxy-to-server request content cannot be created
-
newProxyResponseListener
protected Response.Listener newProxyResponseListener(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) - Specified by:
newProxyResponseListener
in classAbstractProxyServlet
-
onResponseContent
-
onContinue
protected void onContinue(javax.servlet.http.HttpServletRequest clientRequest, Request proxyRequest) - Overrides:
onContinue
in classAbstractProxyServlet
-