Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Browser Console Errors Regarding Websocket

Open MuhClaren opened this issue 11 years ago • 1 comments

Happening on 99% of the RocketChat pages, in both Firefox and Opera (linux).

My test results for websocket support: http://websocketstest.com/result/622384

Console output:

GET https://chat.domain.com/changeavatar [HTTP/1.1 200 OK 429ms]
GET https://chat.domain.com/sockjs/info [HTTP/1.1 200 OK 173ms]
GET https://chat.domain.com/sockjs/027/xwub85zj/websocket [HTTP/1.1 400 Bad Request 279ms]
Firefox can't establish a connection to the server at wss://chat.domain.com/sockjs/027/xwub85zj/websocket. ae3cd5865deea8105cc386ef0b95b9d506b9dba9.js:39
The connection to wss://chat.domain.com/sockjs/027/xwub85zj/websocket was interrupted while the page was loading.

My Nginx setup:

# HTTPS Server
server {
    listen 443;
    server_name chat.domain.com;

    error_log /var/log/nginx/rocketchat.error.log;

    ssl on;
    ssl_certificate /etc/nginx/certificate.crt;
    ssl_certificate_key /etc/nginx/certificate.key;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don’t use SSLv3 ref: POODLE

    location / {
        proxy_pass http://chat.domain.com:3000/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forward-Proto http;
        proxy_set_header X-Nginx-Proxy true;

        proxy_redirect off;
    }
}

Server side firewall:

22/tcp                     ALLOW       Anywhere
443/tcp                    ALLOW       Anywhere

MuhClaren avatar Oct 17 '15 03:10 MuhClaren

Looking at my nginx logs, it appears that this is due to having cloudflare in the middle. While cloudflare supports websockets, they require the user to have a $$$ paid account. Citation: https://blog.cloudflare.com/cloudflare-now-supports-websockets/

Closing for now.

MuhClaren avatar Oct 17 '15 03:10 MuhClaren