带有用于Progressive Web App的缓存清单的socket.io“net :: ERR_FAILED”
问题描述:
我正在开发一个使用.manifest文件来缓存客户端上所有文件的Progressive Web App。我修改了其在这里找到socket.io聊天例如:带有用于Progressive Web App的缓存清单的socket.io“net :: ERR_FAILED”
https://github.com/socketio/chat-example
我的修改可以在这里找到:
https://github.com/TennisVisuals/socket.io.manifest.errors
在客户端代码中的第一个变化是:
- 外部资源(jquery和socket.io客户端库)在本地访问,而不是通过远程URL访问。
一切按预期工作。
但与第二个变化:
-
<html>
被替换<html manifest="index.manifest">
申请失败,在JavaScript控制台给这个错误:
http://localhost:3000/socket.io/?EIO=3&transport=polling&t=Lij1LRo net::ERR_FAILED
初始修复
我已经能够使其通过添加以下行本地工作:
enter var connectionOptions = {
"force new connection" : true,
"reconnectionAttempts": "Infinity",
"timeout" : 10000,
};
var socket = io(connectionOptions);
的CloudFlare和Nginx的
但现在我看到陌生人的行为,当我的CloudFlare运行和Nginx。
没有清单声明我得到一个错误,但一切仍然有效!
socket.io-1.7.2.js:7370 WebSocket connection to 'wss://hiveeye.net/socket.io/?EIO=3&transport=websocket&sid=rM2LKvCGJwaFx7RrAAAf' failed: Error during WebSocket handshake: Unexpected response code: 400
加入舱单申报后,它的工作原理恰好一次,然后失败,出现以下错误:
socket.io-1.7.2.js:4948 GET https://hiveeye.net/socket.io/?EIO=3&transport=polling&t=Lik5SC5&sid=rM2LKvCGJwaFx7RrAAAf net::ERR_FAILED
GET https://hiveeye.net/socket.io/?EIO=3&transport=polling&t=Lik5STN net::ERR_FAILED
GET https://hiveeye.net/socket.io/?EIO=3&transport=polling&t=Lik5STN net::ERR_FAILED
我怀疑,如果我能得到最初的错误,但不运行时消失清单,这可能会诀窍...但我一直无法找到任何东西来帮助我解决这个问题...
答
好吧,这是非常简单的,一旦我发现如何问右q题目了
添加:
NETWORK:
*
在清单文件的底部,使一切工作。
是的,“应用程序缓存”已经过时: https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache
但我还是想让它工作!