Websocket Client (httpClient-WebsocketClient)

This component has similar functionality to the standalone http client component. A WebSocket is a persistent connection to an endpoint allowing full-duplex communications, where either the client or server side sends a message at any time.

The WebSocketClient contains many configuration features similar to the HTTP client components, such as an Address, a Headers folder, Authenticator and Request Body for defining the message content. The main difference is that the WebSocketClient has a Connected property to indicate whether the persistent connection is currently active, and slots to hold both the last sent and received messages.

Figure 44.   Websocket Client properties
Image

To access these properties, drag this component to a location in the station, then double-click it in the station.

In addition to the standard properties (Enabled and Health), this component provides these properties.

Property Value Description
Address additional properties
Defines the address of the endpoint to which this client sends requests.

For property descriptions, refer to “Address (httpClient-HttpAddress)”.

Headers additional properties
Contains additional information about an HTTP request or response sent between a client and server.

For property descriptions, refer to “Headers (httpClient-HttpHeaders)”.

Config additional properties
Contains additional configuration items.

For property descriptions, refer to “Config (httpClient-WebsocketConfig)”.

Authenticator additional properties
Configures the authentication method.

For property descriptions, refer to “Authenticator (httpClient-Http Authenticator)”.

Request Body additional properties
Configures the request body content.

For property descriptions, refer to “Request Body (httpRequestBody)”.

Connected read-only Indicates if the component is connected to the client (true) or not (false.
Last Connected read-only Displays the last time the device connected to the server.
Last Sent Message read-only Displays the last message sent to the server.
Last Sent Time read-only Displays when the last message was sent to the server.
Last Received Message read-only Displays the last message received from the server.
Last Received Time read-only Displays when the last message was received by the server.

Actions

  • Connect manually attempts a connection to the WebSocket.
  • Disconnect removes the connection.
  • Send attempts to connect to the WebSocket to deliver the message.