4

我的应用程序使用 Node.js 和 Socket.io。它工作正常,但是当我断开与互联网的连接时,Socket.io 回退到 xhr 但只是在 Firefox 上,在 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)
4

0 回答 0