Class ConfigAwareProxyServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.mitre.dsmiley.httpproxy.ProxyServlet
org.craftercms.engine.util.servlet.ConfigAwareProxyServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ConfigAwareProxyServlet extends org.mitre.dsmiley.httpproxy.ProxyServlet
Extension of ProxyServlet that uses the current site configuration
Since:
3.1.7
Author:
joseross
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    protected ExecutorService
     
    static final String
     

    Fields inherited from class org.mitre.dsmiley.httpproxy.ProxyServlet

    asciiQueryChars, connectionRequestTimeout, connectTimeout, doForwardIP, doHandleCompression, doHandleRedirects, doLog, doPreserveCookies, doPreserveHost, doSendUrlFragment, hopByHopHeaders, maxConnections, P_CONNECTIONREQUESTTIMEOUT, P_CONNECTTIMEOUT, P_FORWARDEDFOR, P_HANDLECOMPRESSION, P_HANDLEREDIRECTS, P_LOG, P_MAXCONNECTIONS, P_PRESERVECOOKIES, P_PRESERVEHOST, P_READTIMEOUT, P_TARGET_URI, P_USESYSTEMPROPERTIES, readTimeout, targetHost, targetUri, targetUriObj, useSystemProperties
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    copyResponseHeaders(org.apache.http.HttpResponse proxyResponse, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
    Override how ProxyServlet copy response headers.
    void
     
    void
     
    protected void
     
    protected org.apache.http.HttpRequest
    newProxyRequestWithEntity(String method, String proxyRequestUri, javax.servlet.http.HttpServletRequest request)
     
    protected void
    service(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
     

    Methods inherited from class org.mitre.dsmiley.httpproxy.ProxyServlet

    buildHttpClient, buildProxyCookiePath, buildRequestConfig, buildSocketConfig, closeQuietly, copyProxyCookie, copyRequestHeader, copyRequestHeaders, copyResponseEntity, copyResponseHeader, createHttpClient, createProxyCookie, doExecute, encodeUriQuery, getConfigParam, getCookieNamePrefix, getHttpClientBuilder, getProxyClient, getProxyCookieName, getRealCookie, getServletInfo, getTargetHost, getTargetUri, getTargetUri, handleRequestException, rewritePathInfoFromRequest, rewriteQueryStringFromRequest, rewriteUrlFromRequest, rewriteUrlFromResponse

    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, getServletName, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ATTR_TARGET_URI

      public static final String ATTR_TARGET_URI
    • ATTR_TARGET_HOST

      public static final String ATTR_TARGET_HOST
    • WEBSOCKET_IDENTIFIER_HEADER

      public static final String WEBSOCKET_IDENTIFIER_HEADER
      See Also:
    • exec

      protected ExecutorService exec
  • Constructor Details

    • ConfigAwareProxyServlet

      public ConfigAwareProxyServlet()
  • Method Details

    • init

      public void init() throws javax.servlet.ServletException
      Overrides:
      init in class org.mitre.dsmiley.httpproxy.ProxyServlet
      Throws:
      javax.servlet.ServletException
    • initTarget

      protected void initTarget()
      Overrides:
      initTarget in class org.mitre.dsmiley.httpproxy.ProxyServlet
    • destroy

      public void destroy()
      Specified by:
      destroy in interface javax.servlet.Servlet
      Overrides:
      destroy in class org.mitre.dsmiley.httpproxy.ProxyServlet
    • newProxyRequestWithEntity

      protected org.apache.http.HttpRequest newProxyRequestWithEntity(String method, String proxyRequestUri, javax.servlet.http.HttpServletRequest request) throws IOException
      Overrides:
      newProxyRequestWithEntity in class org.mitre.dsmiley.httpproxy.ProxyServlet
      Throws:
      IOException
    • copyResponseHeaders

      protected void copyResponseHeaders(org.apache.http.HttpResponse proxyResponse, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
      Override how ProxyServlet copy response headers. If a header is added via HttpProxyFilter, do not add it again
      Overrides:
      copyResponseHeaders in class org.mitre.dsmiley.httpproxy.ProxyServlet
      Parameters:
      proxyResponse -
      servletRequest -
      servletResponse -
    • service

      protected void service(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse) throws IOException, javax.servlet.ServletException
      Overrides:
      service in class org.mitre.dsmiley.httpproxy.ProxyServlet
      Throws:
      IOException
      javax.servlet.ServletException