Class BalancerServlet

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class BalancerServlet
    extends ProxyServlet
    See Also:
    Serialized Form
    • Constructor Detail

      • BalancerServlet

        public BalancerServlet()
    • Method Detail

      • init

        public void init()
                  throws javax.servlet.ServletException
        Overrides:
        init in class AbstractProxyServlet
        Throws:
        javax.servlet.ServletException
      • rewriteTarget

        protected java.lang.String rewriteTarget​(javax.servlet.http.HttpServletRequest request)
        Overrides:
        rewriteTarget in class AbstractProxyServlet
      • filterServerResponseHeader

        protected java.lang.String filterServerResponseHeader​(javax.servlet.http.HttpServletRequest request,
                                                              Response serverResponse,
                                                              java.lang.String headerName,
                                                              java.lang.String headerValue)
        Overrides:
        filterServerResponseHeader in class AbstractProxyServlet
      • validateDestination

        public boolean validateDestination​(java.lang.String host,
                                           int port)
        Description copied from class: AbstractProxyServlet
        Checks the given host and port against whitelist and blacklist.
        Overrides:
        validateDestination in class AbstractProxyServlet
        Parameters:
        host - the host to check
        port - the port to check
        Returns:
        true if it is allowed to be proxy to the given host and port