public interface HttpFilters
Interface for objects that filter HttpObjects, including both
requests and responses.
Multiple methods are defined, corresponding to different steps in the request processing lifecycle. Each of these methods is given the current object (request, response or chunk) and is allowed to modify it in place.
Because HTTP transfers can be chunked, for any given request or response, the
filter methods may be called multiple times, once for the initial
HttpRequest or HttpResponse, and once for each subsequent
HttpContent. The last chunk will always be a LastHttpContent
and can be checked for being last using
ProxyUtils.isLastChunk(HttpObject).
HttpFiltersSource.getMaximumRequestBufferSizeInBytes() and
HttpFiltersSource.getMaximumResponseBufferSizeInBytes() can be used
to instruct the proxy to buffer the HttpObjects sent to all of its
request/response filters, in which case it will buffer up to the specified
limit and then send either complete HttpRequests or
HttpResponses to the filter methods. When buffering, if the proxy
receives more data than fits in the specified maximum bytes to buffer, the
proxy will stop processing the request and respond with a 502 Bad Gateway
error.
A new instance of HttpFilters is created for each request, so these
objects can be stateful.
| Modifier and Type | Method and Description |
|---|---|
io.netty.handler.codec.http.HttpResponse |
requestPost(io.netty.handler.codec.http.HttpObject httpObject)
Filters requests on their way from the proxy to the server.
|
io.netty.handler.codec.http.HttpResponse |
requestPre(io.netty.handler.codec.http.HttpObject httpObject)
Filters requests on their way from the client to the proxy.
|
io.netty.handler.codec.http.HttpObject |
responsePost(io.netty.handler.codec.http.HttpObject httpObject)
Filters responses on their way from the proxy to the client.
|
io.netty.handler.codec.http.HttpObject |
responsePre(io.netty.handler.codec.http.HttpObject httpObject)
Filters responses on their way from the server to the proxy.
|
io.netty.handler.codec.http.HttpResponse requestPre(io.netty.handler.codec.http.HttpObject httpObject)
httpObject - io.netty.handler.codec.http.HttpResponse requestPost(io.netty.handler.codec.http.HttpObject httpObject)
httpObject - io.netty.handler.codec.http.HttpObject responsePre(io.netty.handler.codec.http.HttpObject httpObject)
httpObject - io.netty.handler.codec.http.HttpObject responsePost(io.netty.handler.codec.http.HttpObject httpObject)
httpObject - Copyright © 2009-2013 LittleShoot. All Rights Reserved.