|
|
@ -42,9 +42,13 @@ class SourceDebugWebSocket(handshakeRequest: NanoHTTPD.IHTTPSession) : |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onMessage(message: NanoWSD.WebSocketFrame) { |
|
|
|
override fun onMessage(message: NanoWSD.WebSocketFrame) { |
|
|
|
if (!message.textPayload.isJson()) return |
|
|
|
|
|
|
|
launch(IO) { |
|
|
|
launch(IO) { |
|
|
|
kotlin.runCatching { |
|
|
|
kotlin.runCatching { |
|
|
|
|
|
|
|
if (!message.textPayload.isJson()) { |
|
|
|
|
|
|
|
send("数据必须为Json格式") |
|
|
|
|
|
|
|
close(NanoWSD.WebSocketFrame.CloseCode.NormalClosure, "调试结束", false) |
|
|
|
|
|
|
|
return@launch |
|
|
|
|
|
|
|
} |
|
|
|
val debugBean = GSON.fromJsonObject<Map<String, String>>(message.textPayload) |
|
|
|
val debugBean = GSON.fromJsonObject<Map<String, String>>(message.textPayload) |
|
|
|
if (debugBean != null) { |
|
|
|
if (debugBean != null) { |
|
|
|
val tag = debugBean["tag"] |
|
|
|
val tag = debugBean["tag"] |
|
|
|