From 48d45d8ddd46315260c86cf2ab188c0631107f3c Mon Sep 17 00:00:00 2001 From: lvxiao Date: Tue, 3 Dec 2024 17:06:19 +0800 Subject: [PATCH] add patch --- .../service/netty/NettyStreamingService.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java b/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java index e4c22fe6692..1ed03278f27 100644 --- a/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java +++ b/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java @@ -200,14 +200,17 @@ protected Completable openConnection() { eventLoopGroup = new NioEventLoopGroup(2); } - new Bootstrap() + Bootstrap bootstrap = new Bootstrap() .group(eventLoopGroup) .option( ChannelOption.CONNECT_TIMEOUT_MILLIS, - java.lang.Math.toIntExact(connectionTimeout.toMillis())) + Math.toIntExact(connectionTimeout.toMillis())) .option(ChannelOption.SO_KEEPALIVE, true) - .channel(NioSocketChannel.class) - .handler( + .channel(NioSocketChannel.class); + if (socksProxyHost != null) { + bootstrap.disableResolver(); + } + bootstrap.handler( new ChannelInitializer() { @Override protected void initChannel(SocketChannel ch) {