修复不能正确解析来自服务器的切断ws消息

This commit is contained in:
MrZ626
2021-05-12 22:14:37 +08:00
parent 0f61c8db8b
commit ef2346efa0
2 changed files with 4 additions and 5 deletions

View File

@@ -188,8 +188,7 @@ while true do--Running
readCHN:push(op)
SOCK:close()
if type(res)=='string'then
res=JSON.decode(res)
readCHN:push(res and res.reason or"WS Error")
readCHN:push(res)--Warning: with 2 bytes close code
else
readCHN:push("WS Error")
end