公司的 dev 环境采用 https协议, 所以我用的 ws 协议
公司的 sit 环境采用 https协议, 所以我用的 wss 协议调用dev 环境的websocket url, WebSocket调用在开发者工具上一切正常(代码片段无法验证, 因为只有连公司内网才能访问 websocket url). 但是无论是 ws 还是 wss 在 iPhone 和 Android 都不起作用, 都监听不到 onSocketOpen, onSocketMessageiPhone版本信息截图:

iPhone WebSocket console截图(Timed out connecting to server):

Android版本信息截图:

iPhone WebSocket console截图(exception onOpen fail code: 9, msg: Timer Expired):

附上代码片段(公司的 dev, sit 环境的 websocket url 只有内网才能访问): https://developers.weixin.qq.com/s/wWAVDvmv7cco请热心的腾讯开发同学帮忙解答一下疑惑, 多谢! 我的邮箱 [email protected] 微信号 gnc18709268394