V
V
vetsmen2017-02-14 00:28:36
JavaScript
vetsmen, 2017-02-14 00:28:36

Error in logs due to socket.io?

When connecting to the socket server, I see an error in the browser console:

WebSocket connection to 'ws://......./socket.io/?EIO=3&transport=websocket&sid=j-0_lBVNns0EDS73AAAJ' failed: Error during WebSocket handshake: Unexpected response code: 400

What could be the problem? If I use a domain when connecting, then such an error pops up, if I use IP, then it does not exist. It is necessary to use the domain.
Thus in both cases sockets work.
In nginx I edited the config like this:
server {
  listen   80;

  server_name ***.**.**.***;

  location / {
        proxy_pass http://***.**.**.***:8000;
        proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
  }

    location ^~ /public/ {
        root /srv/webapp;
    }
}

0 returns

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question