html52.com
我爱小程序-开发者交流社区

wss请求被拦截,ios,开发者工具上都可以,但是Android不行

问题模块 框架类型 问题类型 操作系统 操作系统版本 手机型号 微信版本
客户端 小程序 Bug Android miui9.5 红米note4x 6.6.7

在红米note4x上请求被拦截,Provisional headers are shown。

在红米note4上 wss请求都没有,绝望。

希望官方给个解决方案。


代码如下:

testWebSocket() {

let _this = this;

let url = _this.data.wsUri + _this.data.WsToken + "&tid=" + Math.floor(Math.random() * 11);

url = encodeURI(url).replace(/\+/g, '%2B'); //将加号转义  成%2B

wx.connectSocket({

url: url,

header: {

'content-type': 'application/json'

},

method: "GET",

success: function(res) {

console.log(res)

_this.SocketOpen();

_this.closeSocket();

},

fail: function(res) {

console.log(res);

_this.testWebSocket();

}

});

},



网友回复

一点一滴:

其他Android手机还没试过,不知道有没有这个问题

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付