我的应用使用Node.js和Socket.io。它工作正常,但当我断开互联网连接时,Socket.io回退到xhr但只是在Firefox上,On chrome它工作正常。
这是我的调试信息:
info - socket.io started
Express server listening on port 3000 development
GET /connexion 200 38ms - 882
POST /connexion 302 5ms - 64
GET /jeu 200 8ms - 583
debug - client authorized
info - handshake authorized UTHMxCJEKx-DC3sSf57M
debug - setting request GET /socket.io/1/xhr-polling/UTHMxCJEKx-DC3sSf57M?t=1365791206086
debug - setting poll timeout
debug - client authorized for
debug - clearing poll timeout
debug - xhr-polling writing 1::
debug - set close timeout for client UTHMxCJEKx-DC3sSf57M
debug - xhr-polling received data packet 1::/jeu/Jeu1
s:B2ZSTca4rYyle+ooJCY5/Z+d.xuW1XrVrU+IG0UpLvs5q88hm6Nr83SOwr7fpOjfPhbM
B2ZSTca4rYyle+ooJCY5/Z+d
debug - client authorized for /jeu/Jeu1
debug - setting request GET /socket.io/1/xhr-polling/UTHMxCJEKx-DC3sSf57M?t=1365791206116
debug - setting poll timeout
debug - clearing poll timeout
debug - xhr-polling writing 1::/jeu/Jeu1
debug - set close timeout for client UTHMxCJEKx-DC3sSf57M
debug - discarding transport
debug - cleared close timeout for client UTHMxCJEKx-DC3sSf57M
newPlayer: hamou92
debug - broadcasting packet
debug - setting request GET /socket.io/1/xhr-polling/UTHMxCJEKx-DC3sSf57M?t=1365791206203
debug - setting poll timeout
debug - discarding transport
debug - cleared close timeout for client UTHMxCJEKx-DC3sSf57M
这就是Firebug向我展示的内容:
Firefox ne peut établir de connexion avec le serveur à l'adresse ws://localhost:3000/socket.io/1/websocket/_uQklvPYeYn-_BNg-WDa.
this.websocket = new Socket(this.prepareUrl() + query); socket.io.js (ligne 2371)