Skip to main content

Is client object

Checks that the value is an object of the WebSocket client external component

Function IsClientObject(Val Value) Export

ParameterCLI optionTypeRequiredDescription
Value-ArbitraryValue to check
Returns

Boolean - Is connector

Caution

NOCLI: this method is not available in CLI version

1C:Enterprise/OneScript code example
Address = "wss://127.0.0.1:8443";
NeedProxy = True;
NeedTLS = True;

Headers = New Map;
Headers.Insert("X-Trace-Id", "OPI-WS-TEST");

If NeedTls Then
TLSSettings = OPI_WebSocket.GetTlsSettings(True);
EndIf;

If NeedProxy Then

ProxyAddress = "127.0.0.1";
ProxyPort = "8071";
ProxyType = "http";

ProxtUser = "proxyuser";
ProxyPassword = "12we...";

ProxySettings = OPI_AddIns.GetProxySettings(ProxyAddress
, ProxyPort
, ProxyType
, ProxtUser
, ProxyPassword);

EndIf;

Connection = OPI_WebSocket.CreateConnection(Address, TLSSettings, ProxySettings, Headers);
Result = OPI_WebSocket.IsClientObject(Connection);
Result
true