Proxy configuration

  • The Java client library allows setting up proxy configurations for connecting to the API.

  • Standard Java proxy settings are used for configuring proxies.

  • Both HTTPS and HTTP proxies can be configured using system properties.

  • Runtime configuration of proxy settings is possible.

  • Service clients must be recreated after changing proxy settings at runtime.

The Java client library supports proxy settings for connecting to the API.

Settings

The library supports using the standard proxy settings for Java.

For HTTPS proxy set the proxy configuration as:

-Dhttps.proxyHost=HOST -Dhttps.proxyPort=PORT

For HTTP proxy (not recommended unless you're providing your own HTTP endpoint), set the proxy configuration as:

-Dhttp.proxyHost=HOST -Dhttp.proxyPort=PORT

It is possible to configure both HTTP and HTTPS proxy at runtime.

System.setProperty("https.proxyHost", HOST);
System.setProperty("https.proxyPort", PORT);

If you change this setting then you must recreate any service clients provided by GoogleAdsClient.getVersionX().createYServiceClient().