Skip to content

Commit 1a0db54

Browse files
Snow Pettersenzpencer
authored andcommitted
core: Resolve address of GRPC_PROXY_EXP hostname
Since this address is never resolved gRPC fails to connect with an UnresolvedAddressException when the env variable is specified. This should resolve the address before we attempt to proxy to it.
1 parent 9f07887 commit 1a0db54

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core/src/main/java/io/grpc/internal/ProxyDetectorImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ private static InetSocketAddress overrideProxy(String proxyHostPort) {
184184
+ "be removed in a future release. Use the JVM flags "
185185
+ "\"-Dhttps.proxyHost=HOST -Dhttps.proxyPort=PORT\" to set the https proxy for "
186186
+ "this JVM.");
187-
// Return an unresolved InetSocketAddress to avoid DNS lookup
188-
return InetSocketAddress.createUnresolved(parts[0], port);
187+
return new InetSocketAddress(parts[0], port);
189188
}
190189

191190
/**

0 commit comments

Comments
 (0)