onShow(){
wx.connectSocket({
url: 'wss://bx.xxxxx.com',
})
wx.onSocketOpen(res=>{
console.log(res)
wx.sendSocketMessage({data:'xcx12345678'})
})
wx.onSocketMessage(res=>{
console.log(res)
})
}
突出结果是 VM3350 asdebug.js:1 WebSocket connection to 'wss://bx.xxxxx.com/' failed: Error during WebSocket handshake: Unexpected response code: 200
200?? 这是成功了还是失败了?
失败了。
建议检查后端代码。