Reference
Nodes
Resources
WebSocket

WebSocket Resource

The WebSocket Resource provides methods to manage a connection to a WebSocket server for realtime communciation

Properties

Environment Profiles

Propprofiles
Typearray
Default[ { 'URL': '', 'environment': '' } ]

The profiles configured for this resource in an environment

Environment Profile

Propprofiles[]
Typeobject
Defaultundefined

A profile of this resource for an environment

Server URL

Propprofiles[].URL
Typestring
Defaultundefined

The URL of the WebSocket Server. Must start with ws:// or wss://

Socket

Propprofiles[].socket
Typeunknown
Defaultundefined

The current opened socket, if any

Environment

Propprofiles[].environment
Typestring
Defaultundefined

The name of the environment with which this profile is associated

Actions

Open a connection

Creates a new WebSocket connection to the specified server, or returns an existing connection.

ParameterTypeDefault
onOpen({ function: { ref: string } } | null)undefined
onClose({ function: { ref: string } } | null)undefined
onMessage({ function: { ref: string } } | null)undefined
onError({ function: { ref: string } } | null)undefined

Send a message

Sends a message on the WebSocket connection associated with this resource, if it exists.

ParameterTypeDefault
messageunknownundefined

Close the connection

Closes the WebSocket connection associated with this resource, if it exists.

ParameterTypeDefault