scruz-denodo opened a new issue, #577:
URL: https://github.com/apache/arrow-java/issues/577

   ### Describe the enhancement requested
   
   **Describe the enhancement requested**
   
   Hi, I was making some tests for checking the support of proxies with the 
Flight-SQL JDBC driver.
   
   GRPC supports the [JVM 
properties](https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html)
 for indicating the default http proxy to use. Nevertheless, I tested with 
Flight-SQL JDBC driver without luck. The driver is ignoring them.
   I mean these ones:
   `-Dhttps.proxyHost=<host> -Dhttps.proxyPort=<port>`
   
   Checking the reason, I arrived to these lines where the Netty channel is 
opened:
   
https://github.com/apache/arrow-java/blob/bd2173c59c52983a9e1a6cadffb8345294960949/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightClient.java#L854-L862
   
   Using method 
`io.grpc.netty.NettyChannelBuilder#forAddress(java.net.SocketAddress)` makes 
GRPC to create the channel using a direct connection to the `host:port` 
specified at connection uri, ignoring the proxy.
   This happens on this code from 
[ManagedChannelImplBuilder](https://github.com/grpc/grpc-java/blob/90aefb26e71fcc8d3f45fa5580dd3131b262db27/core/src/main/java/io/grpc/internal/ManagedChannelImplBuilder.java#L346)
   ```
     public ManagedChannelImplBuilder(SocketAddress directServerAddress, String 
authority,
         @Nullable ChannelCredentials channelCreds, @Nullable CallCredentials 
callCreds,
         ClientTransportFactoryBuilder clientTransportFactoryBuilder,
         @Nullable ChannelBuilderDefaultPortProvider 
channelBuilderDefaultPortProvider) {
       this.target = makeTargetStringForDirectAddress(directServerAddress);
       this.channelCredentials = channelCreds;
       this.callCredentials = callCreds;
   ```
   
   I am not sure if there is a special reason for not opening the connection 
with the host and port values, instead of the `java.net.SocketAddress`:
   ```
   builder = NettyChannelBuilder.forAddress(
                       location.getUri().getHost(), 
location.getUri().getPort());
   ```
   But opening the channel in the previous way makes GRPC to follow the 
specified proxy at JVM properties.
   `-Dhttps.proxyHost=<host> -Dhttps.proxyPort=<port>`
   
   Could this be a valid enhancement request?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to