use of io.netty.handler.codec.http2.Http2Connection in project zuul by Netflix.
the class Http2OrHttpHandler method configureHttp2.
private void configureHttp2(ChannelPipeline pipeline) {
// setup the initial stream settings for the server to use.
Http2Settings settings = new Http2Settings().maxConcurrentStreams(maxConcurrentStreams).initialWindowSize(initialWindowSize).headerTableSize(maxHeaderTableSize).maxHeaderListSize(maxHeaderListSize);
Http2FrameCodec frameCodec = Http2FrameCodecBuilder.forServer().frameLogger(FRAME_LOGGER).initialSettings(settings).validateHeaders(true).build();
Http2Connection conn = frameCodec.connection();
// Use the uniform byte distributor until https://github.com/netty/netty/issues/10525 is fixed.
conn.remote().flowController(new DefaultHttp2RemoteFlowController(conn, new UniformStreamByteDistributor(conn)));
Http2MultiplexHandler multiplexHandler = new Http2MultiplexHandler(http2StreamHandler);
// The frame codec MUST be in the pipeline.
pipeline.addBefore("codec_placeholder", /* name= */
null, frameCodec);
pipeline.replace("codec_placeholder", HTTP_CODEC_HANDLER_NAME, multiplexHandler);
}
Aggregations