nxt.http

## Class APIProxyServlet

- java.lang.Object
- - javax.servlet.GenericServlet
  - - javax.servlet.http.HttpServlet
    - - org.eclipse.jetty.proxy.AbstractProxyServlet
      - - org.eclipse.jetty.proxy.AsyncMiddleManServlet
        - - nxt.http.APIProxyServlet

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

      public final class APIProxyServlet
      extends org.eclipse.jetty.proxy.AsyncMiddleManServlet

  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.jetty.proxy.AsyncMiddleManServlet

      `org.eclipse.jetty.proxy.AsyncMiddleManServlet.ContentTransformer, org.eclipse.jetty.proxy.AsyncMiddleManServlet.GZIPContentTransformer, org.eclipse.jetty.proxy.AsyncMiddleManServlet.ProxyReader, org.eclipse.jetty.proxy.AsyncMiddleManServlet.ProxyResponseListener, org.eclipse.jetty.proxy.AsyncMiddleManServlet.ProxyWriter, org.eclipse.jetty.proxy.AsyncMiddleManServlet.Transparent`

    - ### Nested classes/interfaces inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet

      `org.eclipse.jetty.proxy.AbstractProxyServlet.TransparentDelegate`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet

      `_log, CLIENT_REQUEST_ATTRIBUTE, HOP_HEADERS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `APIProxyServlet()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addProxyHeaders(javax.servlet.http.HttpServletRequest clientRequest, org.eclipse.jetty.client.api.Request proxyRequest)`
    `void` | `init(javax.servlet.ServletConfig config)`
    `protected org.eclipse.jetty.proxy.AsyncMiddleManServlet.ContentTransformer` | `newClientRequestContentTransformer(javax.servlet.http.HttpServletRequest clientRequest, org.eclipse.jetty.client.api.Request proxyRequest)`
    `protected org.eclipse.jetty.client.HttpClient` | `newHttpClient()`
    `protected org.eclipse.jetty.client.api.Response.Listener` | `newProxyResponseListener(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`
    `protected void` | `onClientRequestFailure(javax.servlet.http.HttpServletRequest clientRequest, org.eclipse.jetty.client.api.Request proxyRequest, javax.servlet.http.HttpServletResponse proxyResponse, java.lang.Throwable failure)`
    `protected java.lang.String` | `rewriteTarget(javax.servlet.http.HttpServletRequest clientRequest)`
    `protected void` | `service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`

    - ### Methods inherited from class org.eclipse.jetty.proxy.AsyncMiddleManServlet

      `newProxyContentProvider, newProxyReadListener, newProxyWriteListener, newServerResponseContentTransformer, onContinue`

    - ### Methods inherited from class org.eclipse.jetty.proxy.AbstractProxyServlet

      `addViaHeader, addXForwardedHeaders, clientRequestStatus, copyRequestHeaders, createHttpClient, createLogger, destroy, expects100Continue, filterServerResponseHeader, findConnectionHeaders, getBlackListHosts, getHostHeader, getHttpClient, getRequestId, getTimeout, getViaHost, getWhiteListHosts, hasContent, init, onProxyResponseFailure, onProxyResponseSuccess, onProxyRewriteFailed, onServerResponseHeaders, proxyResponseStatus, sendProxyRequest, sendProxyResponseError, setTimeout, validateDestination`

    - ### 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, getServletInfo, getServletName, log, log`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### APIProxyServlet

          public APIProxyServlet()

  - ### Method Detail

    - #### init

          public void init(javax.servlet.ServletConfig config)
                    throws javax.servlet.ServletException

      Specified by:
        `init` in interface `javax.servlet.Servlet`
      Overrides:
        `init` in class `javax.servlet.GenericServlet`
      Throws:
        `javax.servlet.ServletException`

    - #### service

          protected void service(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws javax.servlet.ServletException,
                                 java.io.IOException

      Overrides:
        `service` in class `org.eclipse.jetty.proxy.AsyncMiddleManServlet`
      Throws:
        `javax.servlet.ServletException`
        `java.io.IOException`

    - #### addProxyHeaders

          protected void addProxyHeaders(javax.servlet.http.HttpServletRequest clientRequest,
                                         org.eclipse.jetty.client.api.Request proxyRequest)

      Overrides:
        `addProxyHeaders` in class `org.eclipse.jetty.proxy.AbstractProxyServlet`

    - #### newHttpClient

          protected org.eclipse.jetty.client.HttpClient newHttpClient()

      Overrides:
        `newHttpClient` in class `org.eclipse.jetty.proxy.AbstractProxyServlet`

    - #### rewriteTarget

          protected java.lang.String rewriteTarget(javax.servlet.http.HttpServletRequest clientRequest)

      Overrides:
        `rewriteTarget` in class `org.eclipse.jetty.proxy.AbstractProxyServlet`

    - #### onClientRequestFailure

          protected void onClientRequestFailure(javax.servlet.http.HttpServletRequest clientRequest,
                                                org.eclipse.jetty.client.api.Request proxyRequest,
                                                javax.servlet.http.HttpServletResponse proxyResponse,
                                                java.lang.Throwable failure)

      Overrides:
        `onClientRequestFailure` in class `org.eclipse.jetty.proxy.AbstractProxyServlet`

    - #### newProxyResponseListener

          protected org.eclipse.jetty.client.api.Response.Listener newProxyResponseListener(javax.servlet.http.HttpServletRequest request,
                                                                                            javax.servlet.http.HttpServletResponse response)

      Overrides:
        `newProxyResponseListener` in class `org.eclipse.jetty.proxy.AsyncMiddleManServlet`

    - #### newClientRequestContentTransformer

          protected org.eclipse.jetty.proxy.AsyncMiddleManServlet.ContentTransformer newClientRequestContentTransformer(javax.servlet.http.HttpServletRequest clientRequest,
                                                                                                                        org.eclipse.jetty.client.api.Request proxyRequest)

      Overrides:
        `newClientRequestContentTransformer` in class `org.eclipse.jetty.proxy.AsyncMiddleManServlet`