|
29 | 29 | import io.netty.handler.codec.http.HttpContentDecompressor;
|
30 | 30 | import io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder;
|
31 | 31 | import io.netty.handler.codec.http.websocketx.WebSocket08FrameEncoder;
|
| 32 | +import io.netty.handler.codec.http.websocketx.WebSocketFrameAggregator; |
32 | 33 | import io.netty.handler.ssl.SslHandler;
|
33 | 34 | import io.netty.handler.stream.ChunkedWriteHandler;
|
34 | 35 | import io.netty.util.Timer;
|
@@ -70,6 +71,7 @@ public class ChannelManager {
|
70 | 71 | public static final String INFLATER_HANDLER = "inflater";
|
71 | 72 | public static final String CHUNKED_WRITER_HANDLER = "chunkedWriter";
|
72 | 73 | public static final String WS_DECODER_HANDLER = "ws-decoder";
|
| 74 | + public static final String WS_FRAME_AGGREGATOR = "ws-aggregator"; |
73 | 75 | public static final String WS_ENCODER_HANDLER = "ws-encoder";
|
74 | 76 |
|
75 | 77 | private final AsyncHttpClientConfig config;
|
@@ -421,6 +423,7 @@ public void upgradePipelineForWebSockets(ChannelPipeline pipeline) {
|
421 | 423 | pipeline.addAfter(HTTP_HANDLER, WS_ENCODER_HANDLER, new WebSocket08FrameEncoder(true));
|
422 | 424 | pipeline.remove(HTTP_HANDLER);
|
423 | 425 | pipeline.addBefore(WS_PROCESSOR, WS_DECODER_HANDLER, new WebSocket08FrameDecoder(false, false, 10 * 1024));
|
| 426 | + pipeline.addAfter(WS_DECODER_HANDLER, WS_FRAME_AGGREGATOR, new WebSocketFrameAggregator(10 * 1024)); |
424 | 427 | }
|
425 | 428 |
|
426 | 429 | public final Callback newDrainCallback(final NettyResponseFuture<?> future, final Channel channel, final boolean keepAlive, final String poolKey) {
|
|
0 commit comments