setProxy method

Class: ConfigurationPlatform: NightwatchLanguage: JavaScript SDK:

Use this method to configure Eyes so that it will interact with the Eyes server via a proxy.

By default, the SDK interacts directly with the Eyes server. If necessary, you can define a proxy server so that the SDK will interact with the proxy server, and the proxy server will relay the interaction to the Eyes server.

Syntax

let configval = config.setProxy(proxy);

let configval = config.setProxy(url, username, password, isHttpOnly);

let configval = config.setProxy(url, username, password);

let configval = config.setProxy(url, username);

let configval = config.setProxy(url);

let configval = config.setProxy(isEnabled);
config.proxy = configval;
configval = config.proxy;

Note that this feature is available as both a method and a property.

Parameters

proxy
Type:ProxySettingsPlain
An object created from the ProxySettings class that contains the user name, password, URI and port.
url
Type:string
The proxy URL to be used by the serverConnector. If it has a value of null then no proxy is set.
username
Type:string [Optional ]
The string to pass as the username.
password
Type:string [Optional ]
The string to pass as the password.
isHttpOnly
Type:boolean [Optional ]
A value of true specifies that the SDK should communicate with the server using an http tunnel. Use this if your http proxy blocks https communication.
isEnabled
Type:false
If this parameter is provided, then it must have a value of false and it means that use of the proxy is disabled.

Return value

Type: Configuration
The value returned is the object that called the method. This allows you to use a fluent style to call the setXXXX methods of the Configuration class.