If you need to connect to the Google Ads API through a proxy server, you can configure
the Perl client library using your `googleads.properties` file or
programmatically in your application code.

## Use googleads.properties

You can set the `proxy` property in the `Network Connection` section of your
[`googleads.properties`](https://github.com/googleads/google-ads-perl/blob/HEAD/googleads.properties) file:

```properties
### 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
```

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

> [!CAUTION]
> **Caution:** If your proxy password contains special characters (such as `@`, `:`, or `/`), you must URL-encode those characters before adding them to the proxy URL. Avoid committing configuration files containing plain-text credentials to source control.

## Programmatic configuration

Alternatively, you can configure the proxy setting programmatically just like
any other configuration setting:

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

You can also set the `GOOGLE_ADS_PERL_PROXY` environment variable and load it
using `$api_client->configure_from_environment_variables()`:

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