我也是找的👇的连接。足够了
链接
https://cloud.tencent.com/developer/article/1191083
官方:https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.connectSocket.html
wx.connectSocket({
url: 'wss://xxx.com:4443/websocket',
success:function(res){
if (res.errMsg == "connectSocket:ok"){
console.log("开始建立连接!");
}
else{
console.log("建立连接失败!");
// wx.hideLoading();
}
},
fail:function(res){
console.log(res);
}
})











网友评论