Search in sources :

Example 1 with Http2StreamFrameToHttpObjectCodec

use of io.netty.handler.codec.http2.Http2StreamFrameToHttpObjectCodec in project zuul by Netflix.

the class Http2StreamInitializer method addHttp2StreamSpecificHandlers.

protected void addHttp2StreamSpecificHandlers(ChannelPipeline pipeline) {
    pipeline.addLast("h2_metrics_inbound", http2MetricsChannelHandlers.inbound());
    pipeline.addLast("h2_metrics_outbound", http2MetricsChannelHandlers.outbound());
    pipeline.addLast("h2_max_requests_per_conn", connectionExpiryHandler);
    pipeline.addLast("h2_conn_close", connectionCloseHandler);
    pipeline.addLast(http2ResetFrameHandler);
    pipeline.addLast("h2_downgrader", new Http2StreamFrameToHttpObjectCodec(true));
    pipeline.addLast(http2StreamErrorHandler);
    pipeline.addLast(http2StreamHeaderCleaner);
    pipeline.addLast(new Http2ContentLengthEnforcingHandler());
}
Also used : Http2StreamFrameToHttpObjectCodec(io.netty.handler.codec.http2.Http2StreamFrameToHttpObjectCodec)

Example 2 with Http2StreamFrameToHttpObjectCodec

use of io.netty.handler.codec.http2.Http2StreamFrameToHttpObjectCodec in project reactor-netty by reactor.

the class HttpServerConfig method addStreamHandlers.

static void addStreamHandlers(Channel ch, boolean accessLogEnabled, @Nullable Function<AccessLogArgProvider, AccessLog> accessLog, @Nullable BiPredicate<HttpServerRequest, HttpServerResponse> compressPredicate, ServerCookieDecoder decoder, ServerCookieEncoder encoder, HttpServerFormDecoderProvider formDecoderProvider, @Nullable BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler, ConnectionObserver listener, @Nullable BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>> mapHandle, int minCompressionSize, ChannelOperations.OnSetup opsFactory) {
    ChannelPipeline pipeline = ch.pipeline();
    if (accessLogEnabled) {
        pipeline.addLast(NettyPipeline.AccessLogHandler, AccessLogHandlerFactory.H2.create(accessLog));
    }
    pipeline.addLast(NettyPipeline.H2ToHttp11Codec, new Http2StreamFrameToHttpObjectCodec(true)).addLast(NettyPipeline.HttpTrafficHandler, new Http2StreamBridgeServerHandler(compressPredicate, decoder, encoder, formDecoderProvider, forwardedHeaderHandler, listener, mapHandle));
    boolean alwaysCompress = compressPredicate == null && minCompressionSize == 0;
    if (alwaysCompress) {
        pipeline.addLast(NettyPipeline.CompressionHandler, new SimpleCompressionHandler());
    }
    ChannelOperations.addReactiveBridge(ch, opsFactory, listener);
    if (log.isDebugEnabled()) {
        log.debug(format(ch, "Initialized HTTP/2 stream pipeline {}"), pipeline);
    }
}
Also used : Http2StreamFrameToHttpObjectCodec(io.netty.handler.codec.http2.Http2StreamFrameToHttpObjectCodec) ChannelPipeline(io.netty.channel.ChannelPipeline)

Aggregations

Http2StreamFrameToHttpObjectCodec (io.netty.handler.codec.http2.Http2StreamFrameToHttpObjectCodec)2 ChannelPipeline (io.netty.channel.ChannelPipeline)1