Class ProxyResponse

java.lang.Object
net.targetr.wtm3.net.http.HttpResponse
net.targetr.wtm3.net.http.proxy.ProxyResponse
Direct Known Subclasses:
CachingProxyResponse

public class ProxyResponse extends HttpResponse
Streams a response to a client from another connection.
Author:
Dr Michael Gardiner
  • Field Details

    • proxy

      protected final Proxy proxy
      The proxy instance associated with this response.
    • interceptedHeaders

      protected Headers interceptedHeaders
      The headers intercepted from the proxy response.
    • interceptedOutput

      protected OutputStream interceptedOutput
      The output stream where the response body is intercepted.
  • Constructor Details

    • ProxyResponse

      public ProxyResponse(Proxy proxy) throws IOException
      Builds a new ProxyResponse suitable for streaming a response from a proxied connection to the client.
      Parameters:
      proxy - The proxy including remote connection to relay the response.
      Throws:
      IOException - If an error occurs while reading from the proxied connection or relaying to client.
  • Method Details

    • write

      public void write(HttpRequest request, OutputStream out) throws Exception
      Streams data from the proxied connection to the client.
      Overrides:
      write in class HttpResponse
      Parameters:
      request - Request associated with response.
      out - The OutputStream to write the response.
      Throws:
      Exception - If an error occurs while writing the response.