wx.connectSocket({
url: "ws://39.106.224.233:8088/***/****/lh0117/lh0117", //ws协议链接地址
header:{
'content-type': 'application/json'
},
success(res) {
console.log(res,"websocket创建成功");
},
fail(err){
console.log('创建失败',err);
}
});
wx.onSocketOpen(function(res) {
console.log("打开");
})
wx.onSocketError(function(err){
console.log(err,999999);
})
控制台只打印connectSocket 成功后返回的消息 不执行onSocketOpen和onSocketError