获得过 0 次赞
回答过的问题获得 0 次赞
分享过的文章/案例获得 0 次赞
评论与回复获得 0 次赞
- 首页功能太简陋,能否区分本地开发地址和正式地址?
[图片]
2021-06-18 - websocket的send问题,在“真机调试”中提示“无效的data type”,实际在真机上可用
因为客户端 是用cocos写的小游戏 let ws = new WebSocket("wss://abc.com"); ws.onopen = this.onopen.bind(this); ws.onerror = this.onerror.bind(this); ws.onmessage = this.onmessage.bind(this); ws.onclose = this.onclose.bind(this); ws.binaryType = "arraybuffer"; let uint8Array = new Uint8Array([1,0,2,0,1]); // 以下可以发送成功(在 “真机调试”里面不行) ws.send(uint8Array.buffer.slice(uint8Array.byteOffset, uint8Array.byteLength + uint8Array.byteOffset)) // 为什么用上面这么麻烦的代码,就上面这个能通过真机,其他的如ws.send(uint8Array.buffer)都不行
2021-01-26