artiya4u / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

proxy parameters aren't read from system property #161

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-http-java-client: 1.11.0-beta

Java environment: Java 6

Describe the problem.

The library doesn't follow the convention to read the proxy parameters from the 
system properties. The google-http-java-client is used by the adwords java 
library, in the readme of adwords java library is explained how to set the 
proxy(http://google-api-adwords-java.googlecode.com/svn/trunk/README):

   It is recommended that the user set JVM arguments to configure this application
   for their proxy.
    http.proxyHost      Hostname of proxy server                      web-proxy
    http.proxyPort      Port on server of proxy                       8080 

But this doesn't work in every situation. F.e. when ClientLogin is used.

How would you expect it to be fixed?

The system properties http.proxyHost, http.proxyPort are checked, and the proxy 
is configured according the previous properties values.    

Original issue reported on code.google.com by fe...@venere.com on 26 Oct 2012 at 2:16

GoogleCodeExporter commented 9 years ago
See also https://code.google.com/p/google-api-ads-java/issues/detail?id=32

Original comment by fe...@venere.com on 29 Oct 2012 at 11:35

GoogleCodeExporter commented 9 years ago
Google APIs should all be using https instead of http.  So instead of setting 
http.proxyHost and http.proxyPort I think you should be setting https.proxyHost 
and https.proxyPort.  See:

http://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html#
Proxies

Looking at your diff:

http://code.google.com/r/ferro-google-api-ads-java/source/diff?spec=svn449e1fdac
1c5f6de663de9cd3b725e70b70d44ff&name=proxy&r=449e1fdac1c5f6de663de9cd3b725e70b70
d44ff&format=side&path=/examples/adwords_axis/README

It appears to be working for you.

Based on that, I'm closing this as by design.  Please let me know if I'm 
missing something.

See also:

http://code.google.com/p/google-http-java-client/issues/detail?id=87

Original comment by yan...@google.com on 3 Nov 2012 at 2:19