Proxy

如要透過 Proxy 連線至 Google Ads API,請在 google_ads_php.ini 檔案的 CONNECTION 區段中設定 proxy 屬性:

[CONNECTION]
; Optional proxy settings to be used by requests.
; If you don't have username and password, just specify host and port.
proxy = "protocol://user:pass@host:port"

舉例來說,您可以將 http://user:pass@localhost:8082 指定為 Proxy。您也可以按照程式的其他配置設定,透過程式配置 Proxy 設定:

$googleAdsClient = (new GoogleAdsClientBuilder())
    ...
    ->withProxy('protocol://user:pass@host:port')
    ->build();