public class HttpFiltersAdapter extends Object implements HttpFilters
HttpFilters.| Modifier and Type | Field and Description |
|---|---|
protected ChannelHandlerContext |
ctx |
static HttpFiltersAdapter |
NOOP_FILTER
A default, stateless, no-op
HttpFilters instance. |
protected HttpRequest |
originalRequest |
| Constructor and Description |
|---|
HttpFiltersAdapter(HttpRequest originalRequest) |
HttpFiltersAdapter(HttpRequest originalRequest,
ChannelHandlerContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
clientToProxyRequest(HttpObject httpObject)
Filters requests on their way from the client to the proxy.
|
HttpObject |
proxyToClientResponse(HttpObject httpObject)
Filters responses on their way from the proxy to the client.
|
void |
proxyToServerConnectionFailed()
Informs filter that proxy to server connection has failed.
|
void |
proxyToServerConnectionQueued()
Informs filter that proxy to server connection is in queue.
|
void |
proxyToServerConnectionSSLHandshakeStarted()
Informs filter that proxy to server ssl handshake is initiating.
|
void |
proxyToServerConnectionStarted()
Informs filter that proxy to server connection is initiating.
|
void |
proxyToServerConnectionSucceeded(ChannelHandlerContext serverCtx)
Informs filter that proxy to server connection has succeeded.
|
HttpResponse |
proxyToServerRequest(HttpObject httpObject)
Filters requests on their way from the proxy to the server.
|
void |
proxyToServerRequestSending()
Informs filter that proxy to server request is being sent.
|
void |
proxyToServerRequestSent()
Informs filter that the HTTP request, including any content, has been sent.
|
void |
proxyToServerResolutionFailed(String hostAndPort)
Informs filter that proxy to server DNS resolution failed for the specified host and port.
|
InetSocketAddress |
proxyToServerResolutionStarted(String resolvingServerHostAndPort)
Filter DNS resolution from proxy to server.
|
void |
proxyToServerResolutionSucceeded(String serverHostAndPort,
InetSocketAddress resolvedRemoteAddress)
Informs filter that proxy to server DNS resolution has happened.
|
HttpObject |
serverToProxyResponse(HttpObject httpObject)
Filters responses on their way from the server to the proxy.
|
void |
serverToProxyResponseReceived()
Informs filter that server to proxy response has been received.
|
void |
serverToProxyResponseReceiving()
Informs filter that server to proxy response is being received.
|
void |
serverToProxyResponseTimedOut()
Informs filter that a timeout occurred before the server response was received by the client.
|
public static final HttpFiltersAdapter NOOP_FILTER
HttpFilters instance.protected final HttpRequest originalRequest
protected final ChannelHandlerContext ctx
public HttpFiltersAdapter(HttpRequest originalRequest, ChannelHandlerContext ctx)
public HttpFiltersAdapter(HttpRequest originalRequest)
public HttpResponse clientToProxyRequest(HttpObject httpObject)
HttpFiltersImportant: When returning a response, you must include a mechanism to allow the client to determine the length of the message (see RFC 7230, section 3.3.3: https://tools.ietf.org/html/rfc7230#section-3.3.3 ). For messages that may contain a body, you may do this by setting the Transfer-Encoding to chunked, setting an appropriate Content-Length, or by adding a "Connection: close" header to the response (which will instruct LittleProxy to close the connection). If the short-circuit response contains body content, it is recommended that you return a FullHttpResponse.
clientToProxyRequest in interface HttpFiltershttpObject - Client to Proxy HttpRequest (and HttpContent, if chunked)public HttpResponse proxyToServerRequest(HttpObject httpObject)
HttpFiltersImportant: When returning a response, you must include a mechanism to allow the client to determine the length of the message (see RFC 7230, section 3.3.3: https://tools.ietf.org/html/rfc7230#section-3.3.3 ). For messages that may contain a body, you may do this by setting the Transfer-Encoding to chunked, setting an appropriate Content-Length, or by adding a "Connection: close" header to the response. (which will instruct LittleProxy to close the connection). If the short-circuit response contains body content, it is recommended that you return a FullHttpResponse.
proxyToServerRequest in interface HttpFiltershttpObject - Proxy to Server HttpRequest (and HttpContent, if chunked)public void proxyToServerRequestSending()
HttpFiltersproxyToServerRequestSending in interface HttpFilterspublic void proxyToServerRequestSent()
HttpFiltersproxyToServerRequestSent in interface HttpFilterspublic HttpObject serverToProxyResponse(HttpObject httpObject)
HttpFiltersserverToProxyResponse in interface HttpFiltershttpObject - Server to Proxy HttpResponse (and HttpContent, if chunked)public void serverToProxyResponseTimedOut()
HttpFiltersHttpProxyServerBootstrap.withIdleConnectionTimeout(int) for information on setting the timeout.serverToProxyResponseTimedOut in interface HttpFilterspublic void serverToProxyResponseReceiving()
HttpFiltersserverToProxyResponseReceiving in interface HttpFilterspublic void serverToProxyResponseReceived()
HttpFiltersserverToProxyResponseReceived in interface HttpFilterspublic HttpObject proxyToClientResponse(HttpObject httpObject)
HttpFiltersproxyToClientResponse in interface HttpFiltershttpObject - Proxy to Client HttpResponse (and HttpContent, if chunked)public void proxyToServerConnectionQueued()
HttpFiltersproxyToServerConnectionQueued in interface HttpFilterspublic InetSocketAddress proxyToServerResolutionStarted(String resolvingServerHostAndPort)
HttpFiltersproxyToServerResolutionStarted in interface HttpFiltersresolvingServerHostAndPort - Server "HOST:PORT"public void proxyToServerResolutionFailed(String hostAndPort)
HttpFiltersproxyToServerResolutionFailed in interface HttpFiltershostAndPort - hostname and port the proxy failed to resolvepublic void proxyToServerResolutionSucceeded(String serverHostAndPort, InetSocketAddress resolvedRemoteAddress)
HttpFiltersproxyToServerResolutionSucceeded in interface HttpFiltersserverHostAndPort - Server "HOST:PORT"resolvedRemoteAddress - Address it was proxyToServerResolutionSucceeded topublic void proxyToServerConnectionStarted()
HttpFiltersproxyToServerConnectionStarted in interface HttpFilterspublic void proxyToServerConnectionSSLHandshakeStarted()
HttpFiltersproxyToServerConnectionSSLHandshakeStarted in interface HttpFilterspublic void proxyToServerConnectionFailed()
HttpFiltersproxyToServerConnectionFailed in interface HttpFilterspublic void proxyToServerConnectionSucceeded(ChannelHandlerContext serverCtx)
HttpFiltersproxyToServerConnectionSucceeded in interface HttpFiltersserverCtx - the ChannelHandlerContext used to connect to the serverCopyright © 2009–2017 LittleShoot. All rights reserved.