Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser Console Errors Regarding Websocket #1146

Closed
MuhClaren opened this issue Oct 17, 2015 · 1 comment
Closed

Browser Console Errors Regarding Websocket #1146

MuhClaren opened this issue Oct 17, 2015 · 1 comment

Comments

@MuhClaren
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant