Updated on 2024-09-13 GMT+08:00

Setting Proxy Information

Function

This API is used to set proxy information.

Function Prototype

setProxy(proxyInfo: ProxyInfo, onSetProxyResult?: (ret: SDKERR, reason: string) => void): voidsetProxy(proxyInfo: ProxyInfo, onSetProxyResult?: (ret: SDKERR, reason: string) => void): void

Request Parameters

Table 1 Input parameter description
Parameter Mandatory Type Description
proxyInfo Yes ProxyInfo Proxy information.
onSetProxyResult Yes (ret: SDKERR, reason: string) => void Proxy information callback.
Table 2 ProxyInfo
Parameter Mandatory Type Description
proxyConfigPolicy Yes ProxyConfigPolicy Proxy configuration policy.
server No string Proxy server address.
port No number Proxy server port.
account No string Proxy server account.
password No string Proxy server password.
Table 3 Enumerated values of ProxyConfigPolicy
Enumeration Name Enumerated Value Description
HWM_PROXY_CONFIG_POLICY_CUSTOM 0 Use a proxy with custom configurations.
HWM_PROXY_CONFIG_POLICY_OFF 1 Do not use a proxy.
HWM_PROXY_CONFIG_POLICY_AUTO 2 Use the system proxy.

Return Values

void

Callback Method Parameters

(ret: SDKERR, reason: string) => void

Table 4 Input parameter description
Parameter Type Description
ret For details about SDKERR, see Error Code Reference. Error code.
reason string Error description.