Skip to main content
Version: 8.9.0

proxy

The sos.management.proxy API groups together methods for managing the proxy settings on the device.

Proxy Management Capabilities
| Capability | Description | |:------------|:-------------| | `PROXY` | If device supports Proxy setup connection |
	If you want to check if the device supports this capability, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports).

Methods​

disable()​

The disable() method disables the proxy on the device.

disable(): Promise<void>;

Return value​

A promise that resolves when the proxy is disabled.

Possible errors​

If the device does not support proxy management.

Example​

await sos.management.proxy.disable();

getBypassList()​

The getBypassList() method returns set IPs or addresses which are bypassed for current proxy settings. Those addresses are not fetched via set proxy.

getBypassList(): Promise<string[]>;

Return value​

A promise that resolves to a list of IPs / addresses

Possible errors​

If device does not support setting proxy bypass list

getConnectedTo()​

The getConnectedTo() method returns the current connected proxy server URI on the device.

getConnectedTo(): Promise<string>;

Return value​

A promise that resolves to the URI of the connected proxy server.

Possible errors​

If the device does not support proxy management.

Example​

const uri = await sos.management.proxy.getConnectedTo();
console.log(uri); // 178.62.193.192

isEnabled()​

The isEnabled() method returns whether the proxy is enabled on the device.

isEnabled(): Promise<boolean>;

Return value​

A promise that resolves to a boolean indicating if the proxy is enabled.

Example​

const enabled = await sos.management.proxy.isEnabled();
console.log(`Proxy is enabled: ${enabled}`);

setManual()​

The setManual() allows you to manually configure the proxy settings on the device.

setManual(uri: string, port: number, username?: string, password?: string, bypassList?: string[]): Promise<void>;

Params​

NameTypeRequiredDescription
uristring
Yes
The URI of the proxy server
portnumber
Yes
The port of the proxy server
usernamestring
No
The username for the proxy server
passwordstring
No
The password for the proxy server
bypassListstring[]
No
The list of IP's or addresses to bypass proxy settings

Return value​

A promise that resolves when the proxy is set.

Possible errors​

  • If the proxy settings are invalid.
  • If the device does not support proxy management.
  • If the device does not support setting the proxy bypass list.

Example​

await sos.management.proxy.setManual('178.62.193.192', 1080, 'username', 'password');

// With bypass list example
await sos.management.proxy.setManual('178.62.193.192', 1080, 'username', 'password', [
'127.0.0.1', '*.example.com', 'example.com'
]);