Websocket 在ios真机下测试出错

具体错误如下:
In the destructor of WebSocket (0x15eeee9b0)
[WebSocket::init] _host: 192.168.168.58, _port: 8002, _path: /
WebSocket thread start, helper instance: 0x15efb59d0
NOTICE: Initial logging level 967

NOTICE: Libwebsockets version: 1.6.0 3ca4bac

NOTICE: IPV6 compiled in and enabled

NOTICE: libev support not compiled in

NOTICE: mem: platform fd map: 2048 bytes

NOTICE: mem: per-conn: 336 bytes + protocol rx buf

WebSocket (0x15eeee9b0) onConnectionError …
Ready state is closing or was closed, code=2, quit websocket thread!
NOTICE: lws_context_destroy

WebSocket (0x15eeee9b0) onConnectionClosed …
WebSocket thread exit, helper instance: 0x15efb59d0
JS: server error

有碰到谁同问题人吗,是如何解决的

@minggo 小明他们正在修复这个问题。

什么版本的呀,能公布一下测试环境么

这是哪个版本的BUG???

@linshun websocket正在修复的错误是不支持wss的问题。
@weixin_zmqq.com 怎么重现这个错误?引擎版本是多少?

@minggo 你好! 我们也遇到同样的错误,自己调查了几天了,还没有什么头绪。看到这个帖子。 提供一些我们的信息,希望给我们指点一个方向。

具体信息,如下:

  1. 我们是一个cocos2d-js项目,coco版本为3.13。 因为是H5项目,所以用websocket和服务器通信。目前在mobile 和PC web上都很正常。
  2. 现在我们想做native android版本。 用cocos new -l js 的命令产生项目;用cocos run命令执行后,然后用Android studio的android 真机上debug,就发现以下错误:
    01-11 09:32:18.303 15967-16010/com.hookoo.ndemo D/cocos2d-x debug info: JS: KBEngineApp start connect to ws://192.168.1.111:18888!
    01-11 09:32:18.303 15967-16010/com.hookoo.ndemo D/WebSocket.cpp: [WebSocket::init] _host: 192.168.1.111, _port: 18888, _path: /
    01-11 09:32:18.303 15967-16010/com.hookoo.ndemo D/WebSocket.cpp: In the destructor of WebSocket (0x7cdd7680)
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/WebSocket.cpp: WebSocket thread start, helper instance: 0x7cde1460
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/libwebsockets: NOTICE: Initial logging level 967
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/libwebsockets: NOTICE: Libwebsockets version: 1.6.0 3ca4bac
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/libwebsockets: NOTICE: IPV6 compiled in and enabled
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/libwebsockets: NOTICE: libev support not compiled in
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/libwebsockets: NOTICE: mem: platform fd map: 4096 bytes
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/libwebsockets: NOTICE: mem: per-conn: 268 bytes + protocol rx buf
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/WebSocket.cpp: WebSocket (0x7cde8be8) onConnectionError …
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/WebSocket.cpp: Ready state is closing or was closed, code=2, quit websocket thread!
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/libwebsockets: NOTICE: lws_context_destroy
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/WebSocket.cpp: WebSocket (0x7cde8be8) onConnectionClosed …
    01-11 09:32:18.303 15967-16098/com.hookoo.ndemo D/WebSocket.cpp: WebSocket thread exit, helper instance: 0x7cde1460

3, 我们自己抓了一下包,发现客户端并没有发websocket协议包出去。说明不是协议的问题。可能是程序代码问题。
4. 我们是第一次做JS的原生包,所以除了上面说的coco 命令还外,就是在项目里添加我们的js代码。没有对CPP代码做过任何修改。

我们基本的信息就是这样。如果需要其他更细节的信息或其他测试之类的,请告知,我会立即配合。
谢谢!

楼主解决这个问题了么?

我也遇见这个问题了
WebSocket thread start, helper instance: 0x6080000b5900
NOTICE: Initial logging level 967

NOTICE: Libwebsockets version: 1.6.0 3ca4bac

NOTICE: IPV6 compiled in and enabled

NOTICE: libev support not compiled in

NOTICE: mem: platform fd map: 20480 bytes

NOTICE: mem: per-conn: 336 bytes + protocol rx buf
WebSocket (0x6040001d6ad0) onConnectionError …
WebSocket (0x6040001d6ad0) onConnectionError …
Ready state is closing or was closed, code=2, quit websocket thread!
NOTICE: lws_context_destroy

WebSocket (0x6040001d6ad0) onConnectionClosed …
WebSocket thread exit, helper instance: 0x6080000b5900
帮忙解决一下,着急 在线等

请问修复了吗?