Wenn Sie über einen HTTP- oder HTTPS-Proxyserver eine Verbindung zur Google Ads API herstellen müssen, können Sie die Proxyeinstellung in Ihrer Datei google_ads_php.ini oder programmatisch beim Erstellen des Clients konfigurieren.
Mit google_ads_php.ini konfigurieren
Legen Sie das Attribut proxy im Abschnitt CONNECTION der Datei google_ads_php.ini fest:
[CONNECTION]
; Optional proxy settings to be used by requests.
; If you don't have username and password, just specify host and port.
proxy = "http://user:pass@host:port"
Sie können beispielsweise http://user:pass@localhost:8082 als Proxy angeben.
Programmatisch konfigurieren
Alternativ können Sie die Proxyeinstellung programmatisch unter GoogleAdsClientBuilder konfigurieren:
$googleAdsClient = (new GoogleAdsClientBuilder())
// ...
->withProxy('http://user:pass@localhost:8082')
->build();