This document introduces WebSocket in the following aspects.
1. The reasons to configure WebSocket
2. The consequences of not configuring WebSocket
3. The steps of configuring WebSocket
4. The troubleshooting steps when the WebSocket configuration does not take effect
WebSocket allows the server to actively push data to the client.
In the WebSocket API, the client and server only need to complete a handshake to establish a persistent connection for bidirectional data transmission.
WebSocket is primarily used for refreshing tokens, instantly notifying user session termination, pushing platform messages, displaying updates of memory and CPU usage, pushing execution logs of scheduled tasks, and synchronizing the editing status of data connections.
FineDataLink has the WebSocket port and WebSocket forwarding port configured by default.
The activation sequence of these two ports varies with project environments. The system will attempt to listen on the ports according to the activation sequence. If the system successfully listens on one port, no further attempts will be made on other ports.
WebSocket port
WebSocketConfig.port
["58888", "59888"]
Supported
WebSocket forwarding port
WebSocketConfig.requestPorts
58889
You can choose the appropriate WebSocket port configuration method according to your project's situation. For details, see the following table.
Scheme
Scenario
Configuration Method
Container-Based WebSocket Solution
FineDataLink has a built-in container-based WebSocket solution.
Without any user intervention, the system can automatically utilize the WebSocket capability provided by the Web container to establish connections and reuse the HTTP port.
Once your environment meets the required conditions, the solution will be automatically used.
If your environment does not meet the conditions, you can consider configuring the Socket.IO solution as an alternative.
Socket.IO solution
You want to configure the WebSocket port in a standalone environment.
WebSocket Port Configuration for Standalone Deployment
You want to configure the WebSocket port in the HTTPS environment.
WebSocket Port Configuration in an HTTPS Environment
Only one port is open to the public.
Opening No Additional Ports for WebSocket
Troubleshooting is needed if the WebSocket connection still fails after configuration according to the WebSocket port configuration method in the "Configuration Method" section. For details, see WebSocket Connection Failure.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy