Skip to main content

Proxy Settings in Downloader

Legacy Documentation
You're viewing legacy documentation for API Fortress (deployed via an on-premises container). To view documentation for the new SaaS version of API Fortress — now known as Sauce Labs API Testing and Monitoring (with Sauce Connect tunnels) — see API Testing on the Sauce Labs Cloud.

If you need your downloader to go through a proxy to reach your API follow the below steps to configure the proxy settings.

warning

This is for Self-Hosted/On-Premises deployments only!

Downloader Configuration

You will need to modify the downloader config file, by adding an environment field for proxy settings.

Docker

  • Navigate to the “downloader” folder within your installation files, and find the file named docker-compose.yml

  • Locate the environment field at the end of the file

  • Add a field in this section called proxy_configuration. See example below:

    proxy_configuration: '{"*":
    {
    "address":"10.10.10.10",
    "port":3128,
    "authentication":"basic",
    "username":"foo",
    "password":"bar"
    }
    }'

Kubernetes

  • Navigate to the file named downloader.yml.
  • You will find a section named env, add a field to this section called proxy_configuration.

See example below:

name: proxy_configuration
value: '{
"*":
{
"address":"10.10.10.10",
"port":3128,
"authentication":"basic",
"username":"foo",
"password":"bar"
}
}'

Where address and port are, respectively, the addresses and port of the proxy. Authentication is optional.

Proxy Configuration Syntax

The proxy configuration syntax is as below (multiple proxy configurations should be comma separated):

{
"foo.com": {
"address": "172.18.0.1",
"port": 3128,
"username": "proxyuser",
"password": "password"
},
"bar.com": {
"address": "172.18.0.1",
"port": 3128,
"username": "proxyuser",
"password": "password"
}
}

There is also a catch-all syntax:

{
"*": {
"address": "172.18.0.1",
"port": 3128,
"username": "proxyuser",
"password": "password"
}
}

In addition, you can use a wildcard in place of the lowest level of the domain, as in:

{
"*.google.com": {
"address": "172.18.0.1",
"port": 3128,
"username": "proxyuser",
"password": "password"
}
}

Priority

The proxy configuration now has a priority sequence, the entries at the beginning of the configuration block have higher priority, the ones at the ending have lower priority.

The "*" entry is not involved in the priority verification, and is always the last to be used, regardless of where it appears.

Wildcards

In the previous versions of the downloader, the wildcards only cover the level of the domain. For example *.domain.com covered sub1.domain.com and sub2.domain.com but not third.sub1.domain.com

This is not the case anymore with the current version of the downloader. The wildcard will cover all the lower levels of the domain. This makes the priority essential.

Negative Selection

It is now possible to deactivate proxy settings for specific selectors.

Simply add one entry looking like this: "sub3.domain.com":{"address":"NONE"}

If sub3.domain.com is matched, then no proxy will be selected and the priority rundown will stop. Wildcards can also apply here, as in "*.domain.com": {"address":"NONE"}

Again, check the order of appearance for priority!

Examples

Only sub.domain.com will go through proxy1.com. Other requests will go through no proxy.
{
"sub.domain.com": {
"address": "http://proxy1.com/",
"port": 2255
}
}