Package org.eclipse.jetty.proxy
Class BalancerServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.eclipse.jetty.proxy.AbstractProxyServlet
-
- org.eclipse.jetty.proxy.ProxyServlet
-
- org.eclipse.jetty.proxy.BalancerServlet
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class BalancerServlet extends ProxyServlet
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.proxy.ProxyServlet
ProxyServlet.ProxyInputStreamContentProvider, ProxyServlet.ProxyResponseListener, ProxyServlet.Transparent
-
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
Constructors Constructor Description BalancerServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
filterServerResponseHeader(javax.servlet.http.HttpServletRequest request, Response serverResponse, java.lang.String headerName, java.lang.String headerValue)
void
init()
protected java.lang.String
rewriteTarget(javax.servlet.http.HttpServletRequest request)
boolean
validateDestination(java.lang.String host, int port)
Checks the givenhost
andport
against whitelist and blacklist.-
Methods inherited from class org.eclipse.jetty.proxy.ProxyServlet
newProxyResponseListener, onContinue, onResponseContent, proxyRequestContent, service
-
Methods inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet
addProxyHeaders, addViaHeader, addViaHeader, addXForwardedHeaders, clientRequestStatus, copyRequestHeaders, createHttpClient, createLogger, destroy, expects100Continue, findConnectionHeaders, getBlackListHosts, getHostHeader, getHttpClient, getRequestId, getTimeout, getViaHost, getWhiteListHosts, hasContent, newHttpClient, newProxyRequest, onClientRequestFailure, onProxyResponseFailure, onProxyResponseSuccess, onProxyRewriteFailed, onServerResponseHeaders, proxyResponseStatus, sendProxyRequest, sendProxyResponseError, setTimeout
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Method Detail
-
init
public void init() throws javax.servlet.ServletException
- Overrides:
init
in classAbstractProxyServlet
- Throws:
javax.servlet.ServletException
-
rewriteTarget
protected java.lang.String rewriteTarget(javax.servlet.http.HttpServletRequest request)
- Overrides:
rewriteTarget
in classAbstractProxyServlet
-
filterServerResponseHeader
protected java.lang.String filterServerResponseHeader(javax.servlet.http.HttpServletRequest request, Response serverResponse, java.lang.String headerName, java.lang.String headerValue)
- Overrides:
filterServerResponseHeader
in classAbstractProxyServlet
-
validateDestination
public boolean validateDestination(java.lang.String host, int port)
Description copied from class:AbstractProxyServlet
Checks the givenhost
andport
against whitelist and blacklist.- Overrides:
validateDestination
in classAbstractProxyServlet
- Parameters:
host
- the host to checkport
- the port to check- Returns:
- true if it is allowed to be proxy to the given host and port
-
-