Package org.eclipse.jetty.proxy
Class ProxyServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.eclipse.jetty.proxy.AbstractProxyServlet
org.eclipse.jetty.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.
-
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
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected void
onContinue
(jakarta.servlet.http.HttpServletRequest clientRequest, Request proxyRequest) protected void
onResponseContent
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Response proxyResponse, byte[] buffer, int offset, int length, Callback callback) protected Request.Content
proxyRequestContent
(jakarta.servlet.http.HttpServletRequest request, jakarta.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
(jakarta.servlet.http.HttpServletRequest request, jakarta.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 jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
Methods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, 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:
service
in classjakarta.servlet.http.HttpServlet
- Throws:
jakarta.servlet.ServletException
IOException
-
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.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(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) - Specified by:
newProxyResponseListener
in classAbstractProxyServlet
-
onResponseContent
-
onContinue
protected void onContinue(jakarta.servlet.http.HttpServletRequest clientRequest, Request proxyRequest) - Overrides:
onContinue
in classAbstractProxyServlet
-