Class ProxyServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.eclipse.jetty.ee9.proxy.AbstractProxyServlet
org.eclipse.jetty.ee9.proxy.ProxyServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable
- Direct Known Subclasses:
AsyncProxyServlet, BalancerServlet, ProxyServlet.Transparent
Servlet 3.0 asynchronous proxy servlet.
The request processing is asynchronous, but the I/O is blocking.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classstatic classConvenience extension ofProxyServletthat offers transparent proxy functionalities.Nested classes/interfaces inherited from class AbstractProxyServlet
AbstractProxyServlet.TransparentDelegate -
Field Summary
Fields inherited from class AbstractProxyServlet
_log, CLIENT_REQUEST_ATTRIBUTE, HOP_HEADERSFields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Response.ListenernewProxyResponseListener(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected RunnableonContinue(jakarta.servlet.http.HttpServletRequest clientRequest, Request proxyRequest) Returns the action to perform when the proxy receives a 100 Continue response from the server.protected voidonResponseContent(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Response proxyResponse, byte[] buffer, int offset, int length, Callback callback) protected Request.ContentproxyRequestContent(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Request proxyRequest) Wraps the client-to-proxy request content in aRequest.Contentfor the proxy-to-server request.protected voidservice(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Methods inherited from class 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, validateDestinationMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, serviceMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
-
Constructor Details
-
ProxyServlet
public ProxyServlet()
-
-
Method Details
-
service
protected void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException - Overrides:
servicein classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletExceptionIOException
-
proxyRequestContent
protected Request.Content proxyRequestContent(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Request proxyRequest) throws IOException Wraps the client-to-proxy request content in aRequest.Contentfor 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(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) - Specified by:
newProxyResponseListenerin classAbstractProxyServlet
-
onResponseContent
-
onContinue
protected Runnable onContinue(jakarta.servlet.http.HttpServletRequest clientRequest, Request proxyRequest) Description copied from class:AbstractProxyServletReturns the action to perform when the proxy receives a 100 Continue response from the server.
- Overrides:
onContinuein classAbstractProxyServlet- Parameters:
clientRequest- the client requestproxyRequest- the request being proxied- Returns:
- the 100 Continue action to run
-