简体   繁体   中英

Java Vert.x Reverse Proxy automatic Netty Decode

I've a small Vert.x implementation of a Reverse proxy that is functionally working fine.

Downstream requests are done with tryUseCompression(true) (gziped), which our servers can answer accordingly.

To avoid additional decompression / compression we would like that when we receive a request asking for compression, and the downstream answers with the same compression (all in gzip for example) then the HTTP Proxy should not try to decompress the downstream result but instead return as is to the upstream response.

As far as I could follow Vertx code, Netty is being allways called to decode the messages that it receives and we only get the result

See Http1xClientHandler::handleMessage:

  HttpObject obj = (HttpObject) msg;
  DecoderResult result = obj.decoderResult();

Also found at the HttpChannelConnector::applyHttp1xConnectionOtions

if (client.getOptions().isTryUseCompression()) {
  pipeline.addLast("inflater", new HttpContentDecompressor(true));
}

Is it possible to tell Vertx / Netty not to decompress the result of an individual call?

Thanks for the help

No it's not possible. Your best option would be to handle compression/decompression in your code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM