@@ -398,8 +398,10 @@ public static boolean isSslHandlerConfigured(ChannelPipeline pipeline) {
398
398
}
399
399
400
400
public void upgradeProtocol (ChannelPipeline pipeline , Uri requestUri ) throws SSLException {
401
- if (pipeline .get (HTTP_CLIENT_CODEC ) != null )
402
- pipeline .remove (HTTP_CLIENT_CODEC );
401
+ if (pipeline .get ("HttpClientCodec$Decoder#0" ) != null ) {
402
+ pipeline .remove ("HttpClientCodec$Decoder#0" );
403
+ pipeline .remove ("HttpClientCodec$Encoder#0" );
404
+ }
403
405
404
406
if (requestUri .isSecured ())
405
407
if (isSslHandlerConfigured (pipeline )) {
@@ -447,8 +449,13 @@ public Bootstrap getBootstrap(Uri uri, ProxyServer proxy) {
447
449
}
448
450
449
451
public void upgradePipelineForWebSockets (ChannelPipeline pipeline ) {
450
- pipeline .addAfter (HTTP_CLIENT_CODEC , WS_ENCODER_HANDLER , new WebSocket08FrameEncoder (true ));
451
- pipeline .remove (HTTP_CLIENT_CODEC );
452
+
453
+ // HttpClientCodec$Decoder#0
454
+ // HttpClientCodec$Encoder#0
455
+
456
+ pipeline .addAfter ("HttpClientCodec$Encoder#0" , WS_ENCODER_HANDLER , new WebSocket08FrameEncoder (true ));
457
+ pipeline .remove ("HttpClientCodec$Decoder#0" );
458
+ pipeline .remove ("HttpClientCodec$Encoder#0" );
452
459
pipeline .addBefore (AHC_WS_HANDLER , WS_DECODER_HANDLER , new WebSocket08FrameDecoder (false , false , config .getWebSocketMaxFrameSize ()));
453
460
pipeline .addAfter (WS_DECODER_HANDLER , WS_FRAME_AGGREGATOR , new WebSocketFrameAggregator (config .getWebSocketMaxBufferSize ()));
454
461
}
0 commit comments