小程序用websocket,IOS和开发者工具能连上,安卓连不上
uni.onSocketError(function(res) {
console.log('WebSocket连接打开失败,请检查!');
console.log("res:",res)
that.isSocketConnecting = false
})
1 回复
https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html
看一下官方文档
域名只支持 https
(wx.request、wx.uploadFile、wx.downloadFile) 和 wss
(wx.connectSocket) 协议;