我将LitteProxy配置为反向代理并尝试实现过滤器。当我发送HTTP GET时,会调用clientToProxyRequest过滤器适配器两次。使用 DefaultHttpRequest 作为 httpObject ,第二次使用 LastHttpContent 。它可能与块有关吗?我该怎么做?
HttpProxyServerBootstrap bs = DefaultHttpProxyServer.bootstrap();
//reverse proxy
bs.withAllowRequestToOriginServer(true);
过滤器创建为:
new HttpFiltersAdapter(originalRequest) {
@Override
public HttpResponse clientToProxyRequest(HttpObject httpObject) {
//doing filtering here..
return null;
}
}