Runner.useProxy Method

Specifies the proxy server used in your local network to access the Internet. Allows TestCafe to bypass the proxy when it accesses specific resources.

async useProxy(host [, bypassRules]) → this
Parameter Type Description
host String The proxy server host.
bypassRules (optional) String | Array A set of rules that specify which resources TestCafe should access directly.

If you access the Internet through a proxy server, use the useProxy method to specify its host.

When you use a proxy server, you may still need to access local or external resources directly. In this instance, provide their URLs in the bypassRules option.

The bypassRules parameter takes one or several URLs that require direct access. You can replace parts of the URL with the * wildcard that corresponds to a string of any length. Wildcards at the beginning and end of the rules can be omitted (* and have the same effect).

Related configuration file properties:


The following example shows how to use the proxy server at


In the example below, the proxy server address is and two resources at localhost:8080 and are accessed directly.

runner.useProxy('', ['localhost:8080', '']);

The * proxy bypass rule means that all URLs in subdomains are accessed directly.

runner.useProxy('', '*');

You can also use the proxy host to specify authentication credentials.