In workflows

This provider can be used in workflows.

As “step” to query data, example:

steps:
    - name: Query websocket
      provider: websocket
      config: "{{ provider.my_provider_name }}"
      with:
        socket_url: {value}  # The websocket URL to query.
        timeout: {value}  # Connection Timeout. Defaults to None.
        data: {value}  # Data to send through the websocket. Defaults to None.

If you need workflow examples with this provider, please raise a GitHub issue.

Outputs

The query function of WebsocketProvider outputs the following format:

{
  "connection": true,
  "data": "Received data from the websocket"
}

The connection field indicates whether the websocket connection was successful (true) or not (false). The data field contains the received data from the websocket. If the connection field indicates unsuccessful connection (false) then the object will also include an error field with details about the failed connection.

Authentication Parameters

The Websocket provider does not require any specific authentication parameters.

Connecting with the Provider

To connect with the Websocket provider and perform queries, follow these steps:

Initialize the provider and provider configuration in your system. Use the query function of the WebsocketProvider to interact with the websocket.

See documentation for more information.