WebSocket connection failed: One or more reserved bits are on: reserved1 = 0, reserved2 = 1, reserved3 = 1

一笑奈何 提交于 2019-12-06 08:42:33

Found the answer at the bottom of an Nginx blogpost: I needed to upgrade my Nginx version to a 1.3.13+. I installed the 1.10 (latest stable) using the right Nginx Debian repository (see instructions), which fixed the issue.

Here is my browser output after setting localStorage.debug = '*':

socket.io-client:url parse https://api.tribeez.net +0ms
socket.io-client new io instance for https://api.tribeez.net +5ms
socket.io-client:manager readyState closed +2ms
socket.io-client:manager opening https://api.tribeez.net +1ms
engine.io-client:socket creating transport "polling" +2ms
engine.io-client:polling polling +2ms
engine.io-client:polling-xhr xhr poll +1ms
engine.io-client:polling-xhr xhr open GET: https://api.tribeez.net/socket.io/?EIO=3&transport=polling&t=LI4PaE9 +2ms
engine.io-client:polling-xhr xhr data null +2ms
engine.io-client:socket setting transport polling +1ms
socket.io-client:manager connect attempt will timeout after 20000 +3ms
socket.io-client:manager readyState opening +3ms
engine.io-client:polling polling got data ArrayBuffer +468ms
engine.io-client:socket socket receive: type "open", data "{"sid":"0BCyhfQm--8uOQYUAAAb","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":60000}" +5ms
engine.io-client:socket socket open +1ms
socket.io-client:manager open +0ms
socket.io-client:manager cleanup +1ms
socket.io-client:socket transport is open - connecting +0ms
engine.io-client:socket starting upgrade probes +1ms
engine.io-client:socket probing transport "websocket" +1ms
engine.io-client:socket creating transport "websocket" +0ms
engine.io-client:polling polling +2ms
engine.io-client:polling-xhr xhr poll +0ms
engine.io-client:polling-xhr xhr open GET: https://api.tribeez.net/socket.io/?EIO=3&transport=polling&t=LI4PaLo&sid=0BCyhfQm--8uOQYUAAAb +1ms
engine.io-client:polling-xhr xhr data null +0ms
engine.io-client:polling polling got data ArrayBuffer +252ms
engine.io-client:socket socket receive: type "message", data "0" +1ms
socket.io-parser decoded 0 as {"type":0,"nsp":"/"} +0ms
engine.io-client:polling polling +2ms
engine.io-client:polling-xhr xhr poll +0ms
engine.io-client:polling-xhr xhr open GET: https://api.tribeez.net/socket.io/?EIO=3&transport=polling&t=LI4PaPo&sid=0BCyhfQm--8uOQYUAAAb +0ms
engine.io-client:polling-xhr xhr data null +1ms
engine.io-client:socket probe transport "websocket" opened +441ms
engine.io-client:socket probe transport "websocket" pong +252ms
engine.io-client:socket pausing current transport "polling" +1ms
engine.io-client:polling we are currently polling - waiting to pause +1ms
engine.io-client:polling polling got data ArrayBuffer +98ms
engine.io-client:socket socket receive: type "noop", data "undefined" +1ms
engine.io-client:polling pre-pause polling complete +0ms
engine.io-client:polling paused +1ms
engine.io-client:socket changing transport and sending upgrade packet +0ms
engine.io-client:socket setting transport websocket +0ms
engine.io-client:socket clearing existing transport polling +1ms
engine.io-client:polling ignoring poll - transport state "paused" +0ms

Socket.io seems to be opening a polling connection anyway, but pauses it to prefer the websocket once the latter is working (I suppose...)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!