File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
main/java/com/influxdb/v3/client/internal
test/java/com/influxdb/v3/client/internal Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ private void setChannelTypeAndEventLoop(@Nonnull final NettyChannelBuilder netty
272272 }
273273 }
274274
275- private ProxyDetector createProxyDetector (@ Nonnull final String hostUrl , @ Nonnull final String proxyUrl ) {
275+ ProxyDetector createProxyDetector (@ Nonnull final String hostUrl , @ Nonnull final String proxyUrl ) {
276276 URI proxyUri = URI .create (proxyUrl );
277277 URI hostUri = URI .create (hostUrl );
278278 return (targetServerAddress ) -> {
Original file line number Diff line number Diff line change 2121 */
2222package com .influxdb .v3 .client .internal ;
2323
24+ import java .io .IOException ;
25+ import java .net .InetSocketAddress ;
2426import java .net .URISyntaxException ;
2527import java .util .Map ;
2628
29+ import io .grpc .ProxyDetector ;
2730import io .grpc .internal .GrpcUtil ;
2831import org .apache .arrow .flight .CallHeaders ;
2932import org .apache .arrow .flight .CallInfo ;
@@ -272,6 +275,23 @@ public void useParamsFromQueryConfig() throws Exception {
272275 }
273276 }
274277
278+ @ Test
279+ void createProxyDetector () {
280+ ClientConfig clientConfig = new ClientConfig .Builder ()
281+ .host ("https://localhost:80" )
282+ .build ();
283+ try (FlightSqlClient flightSqlClient = new FlightSqlClient (clientConfig )) {
284+ String hostUrl = "https://youtube.com" ;
285+ String proxyUrl = "https://facebook.com" ;
286+ ProxyDetector proxyDetector = flightSqlClient .createProxyDetector (hostUrl , proxyUrl );
287+ Assertions .assertThat (proxyDetector .proxyFor (
288+ new InetSocketAddress ("142.250.198.142" , 80 )
289+ )).isNull ();
290+ } catch (Exception e ) {
291+ throw new RuntimeException (e );
292+ }
293+ }
294+
275295 static class CallHeadersMiddleware implements FlightClientMiddleware .Factory {
276296 CallHeaders headers ;
277297
You can’t perform that action at this time.
0 commit comments