@@ -147,18 +147,9 @@ public ProxySelector get() {
147147 }
148148 };
149149
150- /**
151- * Experimental environment variable name for enabling proxy support.
152- *
153- * @deprecated Use the standard Java proxy configuration instead with flags such as:
154- * -Dhttps.proxyHost=HOST -Dhttps.proxyPort=PORT
155- */
156- @ Deprecated
157- private static final String GRPC_PROXY_ENV_VAR = "GRPC_PROXY_EXP" ;
158150 // Do not hard code a ProxySelector because the global default ProxySelector can change
159151 private final Supplier <ProxySelector > proxySelector ;
160152 private final AuthenticationProvider authenticationProvider ;
161- private final InetSocketAddress overrideProxyAddress ;
162153
163154 // We want an HTTPS proxy, which operates on the entire data stream (See IETF rfc2817).
164155 static final String PROXY_SCHEME = "https" ;
@@ -168,21 +159,15 @@ public ProxySelector get() {
168159 * {@link ProxyDetectorImpl.AuthenticationProvider} to detect proxy parameters.
169160 */
170161 public ProxyDetectorImpl () {
171- this (DEFAULT_PROXY_SELECTOR , DEFAULT_AUTHENTICATOR , System . getenv ( GRPC_PROXY_ENV_VAR ) );
162+ this (DEFAULT_PROXY_SELECTOR , DEFAULT_AUTHENTICATOR );
172163 }
173164
174165 @ VisibleForTesting
175166 ProxyDetectorImpl (
176167 Supplier <ProxySelector > proxySelector ,
177- AuthenticationProvider authenticationProvider ,
178- @ Nullable String proxyEnvString ) {
168+ AuthenticationProvider authenticationProvider ) {
179169 this .proxySelector = checkNotNull (proxySelector );
180170 this .authenticationProvider = checkNotNull (authenticationProvider );
181- if (proxyEnvString != null ) {
182- overrideProxyAddress = overrideProxy (proxyEnvString );
183- } else {
184- overrideProxyAddress = null ;
185- }
186171 }
187172
188173 @ Nullable
@@ -191,12 +176,6 @@ public ProxiedSocketAddress proxyFor(SocketAddress targetServerAddress) throws I
191176 if (!(targetServerAddress instanceof InetSocketAddress )) {
192177 return null ;
193178 }
194- if (overrideProxyAddress != null ) {
195- return HttpConnectProxiedSocketAddress .newBuilder ()
196- .setProxyAddress (overrideProxyAddress )
197- .setTargetAddress ((InetSocketAddress ) targetServerAddress )
198- .build ();
199- }
200179 return detectProxy ((InetSocketAddress ) targetServerAddress );
201180 }
202181
@@ -272,27 +251,6 @@ private ProxiedSocketAddress detectProxy(InetSocketAddress targetAddr) throws IO
272251 .build ();
273252 }
274253
275- /**
276- * GRPC_PROXY_EXP is deprecated but let's maintain compatibility for now.
277- */
278- private static InetSocketAddress overrideProxy (String proxyHostPort ) {
279- if (proxyHostPort == null ) {
280- return null ;
281- }
282-
283- String [] parts = proxyHostPort .split (":" , 2 );
284- int port = 80 ;
285- if (parts .length > 1 ) {
286- port = Integer .parseInt (parts [1 ]);
287- }
288- log .warning (
289- "Detected GRPC_PROXY_EXP and will honor it, but this feature will "
290- + "be removed in a future release. Use the JVM flags "
291- + "\" -Dhttps.proxyHost=HOST -Dhttps.proxyPort=PORT\" to set the https proxy for "
292- + "this JVM." );
293- return new InetSocketAddress (parts [0 ], port );
294- }
295-
296254 /**
297255 * This interface makes unit testing easier by avoiding direct calls to static methods.
298256 */
0 commit comments