Search in sources :

Example 1 with WebSocket08FrameEncoder

use of io.netty.handler.codec.http.websocketx.WebSocket08FrameEncoder 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.addBefore(AHC_WS_HANDLER, WS_DECODER_HANDLER, new WebSocket08FrameDecoder(false, false, config.getWebSocketMaxFrameSize()));
    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