现象为大部分玩家可以正常登录, 但部分ios用户无法连接websocket, socket连接后立即收到onSocketError回调, res为 {"errMsg":"Invalid HTTP status."}
使用体验版并开启调试模式后, 依然报同样的错误. 若将wss后面的域名换成IP地址, 则改为报 {"errMsg":"TLS handshake failed"}
wx.onSocketError((res) => { console.log( 'onSocketError ' + JSON.stringify(res)); }) wx.onSocketClose((res) => { console.log( 'onSocketClose code: ' + res.code + ' reason: ' + res.reason); }) this ._task = wx.connectSocket({ url: this ._url, success: () => {console.log( 'WechatWS success' )}, fail: () => {console.log( 'WechatWS fail' )}, complete: () => {console.log( 'WechatWS complete' )}, }) this ._task.onError = function (res) { console.log( 'WechatWS onError ' + res.errMsg); } this ._task.onClose = function (res) { console.log( 'WechatWS onClose code: ' + res.code + ' reason: ' + res.reason); } this ._task.onMessage = function (res) { console.log( 'WechatWS onMessage ' + res); } this ._task.onOpen = function (res) { console.log( 'WechatWS onOpen ' + JSON.stringify(res.header)); } |
这些出问题的IOS用户, 手机上登录其他人的微信号, 可以正常连接, 换回自己的微信号, 依然不能连接
麻烦在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点并提供下代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
微信号: Shuollyin
上传时间: 2019/10/10 15:45-15:51之间