From bc0aee15e1948b6fc6ce395cd54c70fcb2c1547e Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 31 Aug 2021 20:21:46 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-55048=20websocket=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E7=9A=84=E6=83=85=E5=86=B5=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 0c71e9488..fba15b043 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -156,11 +156,15 @@ public class DesignerSocketIO { private static String[] getSocketUri() throws IOException { Workspace current = WorkContext.getCurrent(); URL url = new URL(current.getPath()); - Integer[] ports = current.get(SocketInfoOperator.class).getPort(); + Integer[] ports = WebSocketConfig.getInstance().getAvailablePorts(); WorkspaceConnection connection = current.getConnection(); // 服务器配置https webSocket可能是wss也可能是ws webSocket的协议可以单独配置 WebSocketProtocol webSocketProtocol = WebSocketConfig.getInstance().getProtocol(); currentProtocol = webSocketProtocol == WebSocketProtocol.PLAIN ? HTTP : HTTPS; + if (WebSocketConfig.getInstance().isUsingProxy()) { + // 如果配置了代理服务器跟随服务器协议 + currentProtocol = url.getProtocol(); + } String[] result = new String[ports.length]; for (int i = 0; i < ports.length; i++) { result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s",