Package net.targetr.wtm3.net.http.proxy
Class ProxyResponse
java.lang.Object
net.targetr.wtm3.net.http.HttpResponse
net.targetr.wtm3.net.http.proxy.ProxyResponse
- Direct Known Subclasses:
CachingProxyResponse
Streams a response to a client from another connection.
- Author:
- Dr Michael Gardiner
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HeadersThe headers intercepted from the proxy response.protected OutputStreamThe output stream where the response body is intercepted.protected final ProxyThe proxy instance associated with this response.Fields inherited from class net.targetr.wtm3.net.http.HttpResponse
bytesWritten, code, headerLength, headers, info, version, writeErrorHandler -
Constructor Summary
ConstructorsConstructorDescriptionProxyResponse(Proxy proxy) Builds a new ProxyResponse suitable for streaming a response from a proxied connection to the client. -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(HttpRequest request, OutputStream out) Streams data from the proxied connection to the client.Methods inherited from class net.targetr.wtm3.net.http.HttpResponse
getBodyInputStream, getContentLength, parseResponse, toString
-
Field Details
-
proxy
The proxy instance associated with this response. -
interceptedHeaders
The headers intercepted from the proxy response. -
interceptedOutput
The output stream where the response body is intercepted.
-
-
Constructor Details
-
ProxyResponse
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
Streams data from the proxied connection to the client.- Overrides:
writein classHttpResponse- Parameters:
request- Request associated with response.out- The OutputStream to write the response.- Throws:
Exception- If an error occurs while writing the response.
-