Skip to content

Commit 2e197c9

Browse files
authored
Update Resolver when Using a Proxy (Azure#18053)
1 parent 8e3a177 commit 2e197c9

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/NettyAsyncHttpClientBuilder.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,12 @@ public com.azure.core.http.HttpClient build() {
131131
* Configure the request Channel to be initialized with a ProxyHandler. The ProxyHandler is the
132132
* first operation in the pipeline as it needs to handle sending a CONNECT request to the proxy
133133
* before any request data is sent.
134+
*
135+
* And in addition to adding the ProxyHandler update the Bootstrap resolver for proxy support.
134136
*/
135-
tcpClient = tcpClient.bootstrap(bootstrap -> BootstrapHandlers.updateConfiguration(bootstrap,
136-
NettyPipeline.ProxyHandler, new DeferredHttpProxyProvider(handler, proxyChallengeHolder,
137-
buildProxyOptions)));
137+
tcpClient = tcpClient.bootstrap(bootstrap -> BootstrapHandlers.updateResolverForProxySupport(
138+
BootstrapHandlers.updateConfiguration(bootstrap, NettyPipeline.ProxyHandler,
139+
new DeferredHttpProxyProvider(handler, proxyChallengeHolder, buildProxyOptions))));
138140
} else {
139141
tcpClient = tcpClient.proxy(proxy ->
140142
proxy.type(toReactorNettyProxyType(buildProxyOptions.getType(), logger))

sdk/core/azure-core-http-netty/src/main/java/module-info.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
requires transitive com.azure.core;
88
requires reactor.netty;
99
requires io.netty.buffer;
10-
requires io.netty.common;
11-
requires io.netty.transport;
12-
requires io.netty.handler;
1310
requires io.netty.codec;
1411
requires io.netty.codec.http;
12+
requires io.netty.common;
13+
requires io.netty.handler;
1514
requires io.netty.handler.proxy;
15+
requires io.netty.resolver;
16+
requires io.netty.transport;
1617

1718
exports com.azure.core.http.netty;
1819

0 commit comments

Comments
 (0)