|
|
@ -161,10 +161,6 @@ public class DesignerSocketIO { |
|
|
|
// 服务器配置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", |
|
|
@ -279,7 +275,7 @@ public class DesignerSocketIO { |
|
|
|
for (Object object : objects) { |
|
|
|
for (Object object : objects) { |
|
|
|
if (object instanceof Throwable) { |
|
|
|
if (object instanceof Throwable) { |
|
|
|
Throwable throwable = (Throwable) object; |
|
|
|
Throwable throwable = (Throwable) object; |
|
|
|
printEventLog.printThrowable(throwable.getMessage(), throwable); |
|
|
|
printEventLog.printThrowable(throwable); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
printEventLog.print(prefix, object); |
|
|
|
printEventLog.print(prefix, object); |
|
|
|
} |
|
|
|
} |
|
|
@ -287,15 +283,15 @@ public class DesignerSocketIO { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
interface PrintEventLog { |
|
|
|
interface PrintEventLog { |
|
|
|
void printThrowable(String s, Throwable throwable); |
|
|
|
void printThrowable(Throwable throwable); |
|
|
|
void print(String s, Object ...object); |
|
|
|
void print(String s, Object ...object); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
enum PrintEventLogImpl implements PrintEventLog { |
|
|
|
enum PrintEventLogImpl implements PrintEventLog { |
|
|
|
ERROR { |
|
|
|
ERROR { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void printThrowable(String s, Throwable throwable) { |
|
|
|
public void printThrowable(Throwable throwable) { |
|
|
|
FineLoggerFactory.getLogger().error(s, throwable); |
|
|
|
FineLoggerFactory.getLogger().error(throwable.getMessage(), throwable); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -306,8 +302,8 @@ public class DesignerSocketIO { |
|
|
|
|
|
|
|
|
|
|
|
WARN { |
|
|
|
WARN { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void printThrowable(String s, Throwable throwable) { |
|
|
|
public void printThrowable(Throwable throwable) { |
|
|
|
FineLoggerFactory.getLogger().warn(s, throwable); |
|
|
|
FineLoggerFactory.getLogger().warn(throwable.getMessage(), throwable); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|