Search in sources :

Example 1 with WebSocket08FrameDecoder

use of io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder in project async-http-client by AsyncHttpClient.

the class ChannelManager method upgradePipelineForWebSockets.

public void upgradePipelineForWebSockets(ChannelPipeline pipeline) {
    pipeline.addAfter(HTTP_CLIENT_CODEC, WS_ENCODER_HANDLER, new WebSocket08FrameEncoder(true));
    pipeline.addAfter(WS_ENCODER_HANDLER, WS_DECODER_HANDLER, new WebSocket08FrameDecoder(false, config.isEnableWebSocketCompression(), config.getWebSocketMaxFrameSize()));
    if (config.isAggregateWebSocketFrameFragments()) {
        pipeline.addAfter(WS_DECODER_HANDLER, WS_FRAME_AGGREGATOR, new WebSocketFrameAggregator(config.getWebSocketMaxBufferSize()));
    }
    pipeline.remove(HTTP_CLIENT_CODEC);
}
Also used : WebSocketFrameAggregator(io.netty.handler.codec.http.websocketx.WebSocketFrameAggregator) WebSocket08FrameDecoder(io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder) WebSocket08FrameEncoder(io.netty.handler.codec.http.websocketx.WebSocket08FrameEncoder)

Aggregations

WebSocket08FrameDecoder (io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder)1 WebSocket08FrameEncoder (io.netty.handler.codec.http.websocketx.WebSocket08FrameEncoder)1 WebSocketFrameAggregator (io.netty.handler.codec.http.websocketx.WebSocketFrameAggregator)1