Search in sources :

Example 1 with SpdySessionHandler

use of io.netty.handler.codec.spdy.SpdySessionHandler in project netty by netty.

the class SpdyOrHttpHandler method configureSpdy.

private static void configureSpdy(ChannelHandlerContext ctx, SpdyVersion version) throws Exception {
    ChannelPipeline p = ctx.pipeline();
    p.addLast(new SpdyFrameCodec(version));
    p.addLast(new SpdySessionHandler(version, true));
    p.addLast(new SpdyHttpEncoder(version));
    p.addLast(new SpdyHttpDecoder(version, MAX_CONTENT_LENGTH));
    p.addLast(new SpdyHttpResponseStreamIdHandler());
    p.addLast(new SpdyServerHandler());
}
Also used : SpdyHttpDecoder(io.netty.handler.codec.spdy.SpdyHttpDecoder) SpdyFrameCodec(io.netty.handler.codec.spdy.SpdyFrameCodec) SpdySessionHandler(io.netty.handler.codec.spdy.SpdySessionHandler) SpdyHttpEncoder(io.netty.handler.codec.spdy.SpdyHttpEncoder) SpdyHttpResponseStreamIdHandler(io.netty.handler.codec.spdy.SpdyHttpResponseStreamIdHandler) ChannelPipeline(io.netty.channel.ChannelPipeline)

Example 2 with SpdySessionHandler

use of io.netty.handler.codec.spdy.SpdySessionHandler in project netty by netty.

the class SpdyClientInitializer method initChannel.

@Override
public void initChannel(SocketChannel ch) {
    ChannelPipeline pipeline = ch.pipeline();
    pipeline.addLast("ssl", sslCtx.newHandler(ch.alloc()));
    pipeline.addLast("spdyFrameCodec", new SpdyFrameCodec(SPDY_3_1));
    pipeline.addLast("spdyFrameLogger", new SpdyFrameLogger(INFO));
    pipeline.addLast("spdySessionHandler", new SpdySessionHandler(SPDY_3_1, false));
    pipeline.addLast("spdyHttpEncoder", new SpdyHttpEncoder(SPDY_3_1));
    pipeline.addLast("spdyHttpDecoder", new SpdyHttpDecoder(SPDY_3_1, MAX_SPDY_CONTENT_LENGTH));
    pipeline.addLast("spdyStreamIdHandler", new SpdyClientStreamIdHandler());
    pipeline.addLast("httpHandler", httpResponseHandler);
}
Also used : SpdyHttpDecoder(io.netty.handler.codec.spdy.SpdyHttpDecoder) SpdyFrameCodec(io.netty.handler.codec.spdy.SpdyFrameCodec) SpdySessionHandler(io.netty.handler.codec.spdy.SpdySessionHandler) SpdyHttpEncoder(io.netty.handler.codec.spdy.SpdyHttpEncoder) ChannelPipeline(io.netty.channel.ChannelPipeline)

Aggregations

ChannelPipeline (io.netty.channel.ChannelPipeline)2 SpdyFrameCodec (io.netty.handler.codec.spdy.SpdyFrameCodec)2 SpdyHttpDecoder (io.netty.handler.codec.spdy.SpdyHttpDecoder)2 SpdyHttpEncoder (io.netty.handler.codec.spdy.SpdyHttpEncoder)2 SpdySessionHandler (io.netty.handler.codec.spdy.SpdySessionHandler)2 SpdyHttpResponseStreamIdHandler (io.netty.handler.codec.spdy.SpdyHttpResponseStreamIdHandler)1