If you need to connect to the Google Ads API through an HTTP or HTTPS proxy server, you
can configure the proxy setting in your `google_ads_php.ini` file or
programmatically when building the client.

## Configure with google_ads_php.ini

Set the `proxy` property in the `CONNECTION` section of your
[`google_ads_php.ini`](https://github.com/googleads/google-ads-php/blob/HEAD/examples/Authentication/google_ads_php.ini) file:

    [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"

For example, you can specify `http://user:pass@localhost:8082` as a proxy.

> [!NOTE]
> **Note:** If your proxy username or password contains special characters (such as `@`, `:`, or `/`), ensure they are URL-encoded before adding them to the proxy URL. Avoid committing configuration files containing plain-text credentials to source control.

## Configure programmatically

Alternatively, you can configure the proxy setting programmatically on
`GoogleAdsClientBuilder`:

    $googleAdsClient = (new GoogleAdsClientBuilder())
        // ...
        ->withProxy('http://user:pass@localhost:8082')
        ->build();