@ -156,11 +156,15 @@ public class DesignerSocketIO {
private static String [ ] getSocketUri ( ) throws IOException {
private static String [ ] getSocketUri ( ) throws IOException {
Workspace current = WorkContext . getCurrent ( ) ;
Workspace current = WorkContext . getCurrent ( ) ;
URL url = new URL ( current . getPath ( ) ) ;
URL url = new URL ( current . getPath ( ) ) ;
Integer [ ] ports = current . get ( SocketInfoOperator . class ) . getPort ( ) ;
Integer [ ] ports = WebSocketConfig . getInstance ( ) . getAvailable Ports ( ) ;
WorkspaceConnection connection = current . getConnection ( ) ;
WorkspaceConnection connection = current . getConnection ( ) ;
// 服务器配置https webSocket可能是wss也可能是ws webSocket的协议可以单独配置
// 服务器配置https webSocket可能是wss也可能是ws webSocket的协议可以单独配置
WebSocketProtocol webSocketProtocol = WebSocketConfig . getInstance ( ) . getProtocol ( ) ;
WebSocketProtocol webSocketProtocol = WebSocketConfig . getInstance ( ) . getProtocol ( ) ;
currentProtocol = webSocketProtocol = = WebSocketProtocol . PLAIN ? HTTP : HTTPS ;
currentProtocol = webSocketProtocol = = WebSocketProtocol . PLAIN ? HTTP : HTTPS ;
if ( WebSocketConfig . getInstance ( ) . isUsingProxy ( ) ) {
// 如果配置了代理服务器跟随服务器协议
currentProtocol = url . getProtocol ( ) ;
}
String [ ] result = new String [ ports . length ] ;
String [ ] result = new String [ ports . length ] ;
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" ,