Proxy konfigurieren

Wenn Sie über einen Proxyserver eine Verbindung zur Google Ads API herstellen müssen, können Sie die Perl-Clientbibliothek über die Datei googleads.properties oder programmatisch im Anwendungscode konfigurieren.

googleads.properties verwenden

Sie können das Attribut proxy im Abschnitt Network Connection der Datei googleads.properties festlegen:

### Network Connection ###

# Optional proxy server URL to be used for internet connectivity.
# If your proxy connection requires authentication, make sure to include it in
# the URL, for example: http://user:password@proxy_hostname:8080
proxy=INSERT_PROXY_HERE

Sie können beispielsweise http://user:pass@localhost:8082 als Proxy angeben.

Programmatische Konfiguration

Alternativ können Sie die Proxy-Einstellung wie jede andere Konfigurationseinstellung programmatisch konfigurieren:

my $api_client = Google::Ads::GoogleAds::Client->new({
  proxy => "INSERT_PROXY_HERE",
});

Sie können auch die Umgebungsvariable GOOGLE_ADS_PERL_PROXY festlegen und mit $api_client->configure_from_environment_variables() laden:

export GOOGLE_ADS_PERL_PROXY=http://user:password@proxy_hostname:8080