Overview
The WebSocket Data Source in eZintegrations enables real-time, two-way communication between a client and a server using a single, persistent connection.
Unlike REST APIs, which establish a new connection for each request-response cycle, WebSocket maintains an open connection that allows continuous data exchange without interruption.
This makes WebSocket suitable for applications that require instant updates and live data streaming.
When to Use
Use WebSocket as a Data Source when continuous and real-time data communication is required.
- Streaming real-time system events
- Receiving live notifications
- Integrating chat or messaging systems
- Monitoring real-time dashboards
- Processing IoT or sensor data
How It Works
WebSocket establishes a persistent connection between the client and the server.
Once the connection is established, data can be sent and received at any time without creating new connections.
The connection remains active until either the client or server closes it.
WebSocket Communication Model
The WebSocket protocol supports full-duplex communication.
- The client and server communicate over a single connection.
- Messages are exchanged continuously.
- No repeated handshakes are required.
- Latency is minimized.
- Connection remains active during data exchange.
Parameters Used for WebSocket
The following parameters are required when configuring a WebSocket Data Source.
Request URL
Defines the WebSocket endpoint used for the connection.
The URL must use the following formats:
- ws:// – For unencrypted connections
- wss:// – For encrypted SSL/TLS connections
Example:
wss://ezintegration.ai
Message
Specifies the message that will be sent from the client to the WebSocket API.
The message must be provided in string format.
Example:
{“message”:”Hello world”}
Params
Allows users to pass additional information as parameters.
Parameters are provided in key-value format along with optional descriptions.
These values are used for contextual or filtering purposes.
Headers
Headers are used to pass additional metadata such as authentication credentials.
They are defined in key-value format.
Example:
| Key | Value |
|---|---|
| api-key | {api-key value} |
How to Configure WebSocket Data Source
Follow these steps to configure a WebSocket Data Source in eZintegrations.
- Open the Integration Bridge configuration.
- Select WebSocket as the Data Source type.
- Enter the Request URL.
- Define the message content.
- Add required parameters.
- Configure headers for authorization if needed.
- Save the configuration.
- Test the connection.
Benefits
Using WebSocket as a Data Source provides several operational advantages.
- Real-time data exchange
- Persistent connection
- Low latency communication
- Reduced network overhead
- Improved performance for live applications
Frequently Asked Questions
What is a WebSocket Data Source in eZintegrations?
It is a data source that uses the WebSocket protocol to receive and send data through a persistent, real-time connection.
How is WebSocket different from REST API?
WebSocket maintains a continuous connection for real-time communication, while REST API creates a new connection for each request.
Which URL format should I use?
Use ws:// for unencrypted connections and wss:// for encrypted SSL/TLS connections.
Can I send custom messages through WebSocket?
Yes. Custom messages can be sent in string format through the Message parameter.
Is authentication supported in WebSocket Data Source?
Yes. Authentication details can be passed using headers such as API keys or tokens.
Notes
- Use wss:// for secure production environments.
- Ensure the WebSocket server supports persistent connections.
- Configure headers properly for authentication.
- Validate message formats before deployment.
- Test WebSocket connections in staging environments.