Skip to content

Commit 9d0f1d7

Browse files
committed
Install missing WebSocketClientCompressionHandler when using HTTP proxy + wss, close #1689
Motivation: WebSocketClientCompressionHandler is only installed on the no proxy path. Modification: Install WebSocketClientCompressionHandler on the proxy path too. Result: WebSocket compression work when using a proxy too.
1 parent 087b41a commit 9d0f1d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

client/src/main/java/org/asynchttpclient/netty/channel/ChannelManager.java

+5
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ public Future<Channel> updatePipelineForHttpTunneling(ChannelPipeline pipeline,
353353

354354
if (requestUri.isWebSocket()) {
355355
pipeline.addAfter(AHC_HTTP_HANDLER, AHC_WS_HANDLER, wsHandler);
356+
357+
if (config.isEnableWebSocketCompression()) {
358+
pipeline.addBefore(AHC_WS_HANDLER, WS_COMPRESSOR_HANDLER, WebSocketClientCompressionHandler.INSTANCE);
359+
}
360+
356361
pipeline.remove(AHC_HTTP_HANDLER);
357362
}
358363
return whenHanshaked;

0 commit comments

Comments
 (0)