Skip to content

Commit

Permalink
Add a private method to refresh proxy DNS.
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenchickenlove committed Nov 17, 2024
1 parent 18b24ea commit 979e6fd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private void resolveProxyConfig(SessionProtocol protocol, Endpoint endpoint, Cli
if (proxyConfig.proxyAddress() != null) {
final Future<InetSocketAddress> resolveFuture = addressResolverGroup
.getResolver(ctx.eventLoop().withoutContext())
.resolve(proxyConfig.proxyAddress());
.resolve(createUnresolvedAddressForRefreshing(proxyConfig.proxyAddress()));

resolveFuture.addListener(future -> {
if (future.isSuccess()) {
Expand Down Expand Up @@ -302,4 +302,8 @@ private static void doExecute(PooledChannel pooledChannel, ClientRequestContext
res.init(session.inboundTrafficController());
session.invoke(pooledChannel, ctx, req, res);
}

private static InetSocketAddress createUnresolvedAddressForRefreshing(InetSocketAddress previousAddress) {
return new InetSocketAddress(previousAddress.getHostName(), previousAddress.getPort());
}
}

0 comments on commit 979e6fd

Please sign in to comment.