To reduce the difficulty of WebSocket configuration, FineDataLink supports the container-native WebSocket solution.
This solution uses the native WebSocket implementation of the Web container for connection, reusing the HTTP port. No additional port opening or manual configuration is required.
When the project supports the container-native WebSocket protocol, the frontend will prioritize this connection scheme. If the connection attempt fails, the old Socket.IO solution will be used for retries.
The implementation of the container-native WebSocket solution requires the following prerequisites.
Only the following containers support the container-native WebSocket solution. (The container environment is usually self-prepared and is not provided by FineDataLink.)
You need to modify the namespace of web.xml, and keep other settings unchanged.
<!--Modify web-app as follows-->
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
JBoss
For JBoss EAP 6.4, you need to modify the configuration:
Add jboss-web.xml in web-inf.
<?xml version="1.0" encoding="UTF-8" ?>
<!--Enable WebSockets -->
<jboss-web>
<enable-websockets>true</enable-websockets>
</jboss-web>
Modify the standalone.xml file in ${hboss_home}/standalone/configuration by changing protocol="HTTP/1.1" to protocol="org.apache.coyote.http11.Http11NioProtocol".
If the current container environment of FineDataLink meets the conditions, the WebSocket Settings will not be displayed on the Management System > System Administration > General page.
Nginx
1. Modify the HTTP configuration.
Add the following statements under each location block:
proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection $http_connection;
2. Check whether Nginx has been configured for WebSocket connections.
Open the nginx.conf file and check if it contains the following content.
server { #This is the WebSocket port. For cluster projects, the FineReport project uses 38889, and the FineBI project uses 48889. listen 38889; server_name 192.168.6.181; location / { proxy_http_version 1.1; proxy_pass http://WBS.com; proxy_connect_timeout proxy_read_timeout 400; proxy_send_timeout 400; #The upgrade target is $http_upgrade, and the actual value is websocket. proxy_set_header Upgrade $http_upgrade; #Upgrade the connection. proxy_set_header Connection "upgrade"; } }
If the above content does not exist, it indicates that Nginx has not been configured for WebSocket connections. You can directly use the container-native WebSocket solution.
If the above content exists, it indicates that Nginx has been configured for WebSocket connections. You need to delete the above content, as shown in the following figure.
Traefik
No additional configuration is required. Retaining or deleting the original WebSocket configuration does not affect the implementation of the container-native WebSocket solution.
F5
The container-native WebSocket solution is supported by browsers, including Google Chrome, Firefox, Microsoft Edge, and Internet Explorer 10 and later versions.
It is not supported by Internet Explorer 9 and earlier versions.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy