Chrome WebSocket connection failed: WebSocket is closed before the connection is established

Viewed 5084

Why i get this Error but only on Chrome?

WebSocket connection failed: WebSocket is closed before the connection is established.

When i check other browsers, it is working. Also for other users, not everyone get this error but why?

I use NGINX Ubuntu Server, if that is important.

Thats my Socket on Serverside

const app = express();
const server = http.Server(app);
var io = require('socket.io')(server, { wsEngine: 'ws' });

And thats userside

app.website.socket = io({
  secure: true,
  reconnection: 8000
});

And as i said, its working for much users, but much times not for me :/

Thats the nginx config for socket

 location / {
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header Host $http_host;
            proxy_pass http://localhost:2052;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
 }
0 Answers
Related