ios safari下载进度总是0%
mzz2017 opened this issue · 7 comments
mzz2017 commented
查看https://caniuse.com/#search=XMLHttpRequest 发现并没有什么不妥,不知道是什么原因
mzz2017 commented
已找到问题:
GET https://streamoc.music.tc.qq.com/F000001bqYo71oYI14.flac?vkey=5F6B7C7B2DFD9…9EE851B2BD31B6BC1C3F03B426DF78B90E50&guid=1234567890&uin=1008611&fromtag=8 The certificate for this server is invalid. You might be connecting to a server that is pretending to be “streamoc.music.tc.qq.com” which could put your confidential information at risk.
这是因为在https下访问这个下载链接,xhr必须也要访问https的链接,否则就报错。于是改成访问https,因为对方没有证书,chrome只是警告,但safari就直接拒绝访问,所以僵住了。
mzz2017 commented
解决方法有以下几种:
- 换http,不使用SSL. 于是:要么备案,要么买香港/国外服务器
- 后端做转发。这个用户规模大了之后比较烧流量
- 不使用xhr下载更名。当时使用xhr做下载是因为得到的歌曲文件名字是比较乱的,使用xhr之后才出现的这样的不兼容问题
好吧,没有十全十美的方法。
mzz2017 commented
已经贴了个临时补丁,当出现下载故障时呈现原始链接地址
mzz2017 commented
demo站的解决方法是:换http,摒弃ssl,使用国外服务器并在api中使用国内代理
xuelainiao commented
这个办法好呀,哈哈
xuelainiao commented
奇怪了 dev 是可以的,不过pm2之后使用9000端口就出现
Cannot GET /
mzz2017 commented
你好,生产部署的话使用apache或nginx将9000端口转发到与web端相同的端口的(一般是80)