|
|
@ -1,6 +1,5 @@ |
|
|
|
package com.fr.design.mainframe.socketio; |
|
|
|
package com.fr.design.mainframe.socketio; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.decision.webservice.utils.DecisionServiceConstants; |
|
|
|
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.report.RemoteDesignConstants; |
|
|
|
import com.fr.report.RemoteDesignConstants; |
|
|
@ -14,6 +13,7 @@ import com.fr.workspace.Workspace; |
|
|
|
import com.fr.workspace.base.WorkspaceConstants; |
|
|
|
import com.fr.workspace.base.WorkspaceConstants; |
|
|
|
import com.fr.workspace.connect.WorkspaceConnection; |
|
|
|
import com.fr.workspace.connect.WorkspaceConnection; |
|
|
|
import com.fr.workspace.connect.WorkspaceConnectionInfo; |
|
|
|
import com.fr.workspace.connect.WorkspaceConnectionInfo; |
|
|
|
|
|
|
|
import com.fr.workspace.server.socket.SocketVerifierOperator; |
|
|
|
import io.socket.client.IO; |
|
|
|
import io.socket.client.IO; |
|
|
|
import io.socket.engineio.client.transports.Polling; |
|
|
|
import io.socket.engineio.client.transports.Polling; |
|
|
|
import io.socket.engineio.client.transports.WebSocket; |
|
|
|
import io.socket.engineio.client.transports.WebSocket; |
|
|
@ -83,14 +83,17 @@ public abstract class AbstractSocketConfig { |
|
|
|
WorkspaceConnection connection = current.getConnection(); |
|
|
|
WorkspaceConnection connection = current.getConnection(); |
|
|
|
currentProtocol = getCurrentProtocolFromUrl(url); |
|
|
|
currentProtocol = getCurrentProtocolFromUrl(url); |
|
|
|
String[] result = new String[ports.length]; |
|
|
|
String[] result = new String[ports.length]; |
|
|
|
|
|
|
|
// REPORT-89007: websocket 避免url明文传输token。兼容旧版本服务器:旧版传递token,新版传递加密后的wsid
|
|
|
|
|
|
|
|
String verifierPrefix = WorkContext.getCurrent().get(SocketVerifierOperator.class).getVerifierPrefix(); |
|
|
|
|
|
|
|
String verifierCode = WorkContext.getCurrent().get(SocketVerifierOperator.class).getVerifierCode(connection.getToken()); |
|
|
|
for (int i = 0; i < ports.length; i++) { |
|
|
|
for (int i = 0; i < ports.length; i++) { |
|
|
|
result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s", |
|
|
|
result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s", |
|
|
|
currentProtocol, |
|
|
|
currentProtocol, |
|
|
|
url.getHost(), |
|
|
|
url.getHost(), |
|
|
|
ports[i], |
|
|
|
ports[i], |
|
|
|
WorkspaceConstants.WS_NAMESPACE, |
|
|
|
WorkspaceConstants.WS_NAMESPACE, |
|
|
|
DecisionServiceConstants.WEB_SOCKET_TOKEN_NAME, |
|
|
|
verifierPrefix, |
|
|
|
connection.getToken(), |
|
|
|
verifierCode, |
|
|
|
RemoteDesignConstants.USER_LOCK_ID, |
|
|
|
RemoteDesignConstants.USER_LOCK_ID, |
|
|
|
connection.getId()); |
|
|
|
connection.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|