Share this page

# TC.setProxy

Enables you to set a proxy address manually in the script.

    TC.setProxy(option, settings);

## Arguments

Name | Description
--- | ---
option | Specify the type of proxy you want to use. "PROXY_NONE". No proxy "PROXY_SYSTEM". Use system proxy; settingsString will be ignored. "PROXY_MANUAL". Manually set proxy. "PROXY_PAC". Use a proxy auto-config (PAC) file.
settings | (string) The details of the proxy setting.

## Return value

(void) undefined

## Example

- Use system proxy settings. The second argument is ignored, so it can be any string value, usually empty.

  Note: Because schema needs two arguments, the second one cannot be omitted.

  Copy code

      TC.setProxy("PROXY_SYSTEM", "");

- Manually set proxy and set separate proxy for different protocols (HTTP and HTTPS).

  Copy code

      TC.setProxy("PROXY_MANUAL", '{"proxyShare":false,"proxyHttp":" proxy.xxx.com ","proxyHttpPort":8080,"proxySsl":" proxy.yyy.com ","proxySslPort":8080}');

- Manually set proxy and share the proxy settings for all protocols (HTTP, HTTPS, ...).

  Note: If you also specify an address for `proxySsl`, it will be ignored because `proxyShare` is set to true.

  Copy code

      TC.setProxy("PROXY_MANUAL", '{"proxyShare":true,"proxyHttp":"proxy.xxx.com","proxyHttpPort":8080}');

- Use manually set proxy that is already in memory (maybe set previously, or maybe nothing is set).

  Note: If you are not sure which setting is in memory, it is recommended that you explicitly specify the proxy settings you want to use every time.

  Copy code

      TC.setProxy("PROXY_MANUAL ", "");

- Do not use any proxy.

  Note: The proxy address/port that are set in the options sections are not removed. The settings in memory can be activated in another call.

  Copy code

      TC.setProxy("PROXY_NONE", "");

- Use PAC.

  Copy code

      TC.setProxy("PROXY_PAC",'{"proxyPAC":"http://autocache.xyzcorp.net/"}')

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: