• @hieudang, are you sure the forum isn't dropping down to XHR polling? I talked with Incapsula reps previously who indicated plainly that only paid plans supported websockets.


  • @ThingBreaker last time I checked with there live chat... I had 2 people say 2 different things. One said that they didn't support websockets at all (how!?) And the other one said it on there most expansive plans. One thing is for sure. They cannot make up there mind with what package supports what features


  • @Kowlin, I know for certain that their first paid tier supports them. Bloody hell, an independent test is going to be required.


  • This tutorial is awesome. I was having a terrible time because I was getting weird 400 errors in new relic for socket.io. The odd thing is that my apdex for NodeBB is terrible and transactions for socket.io are showing as ~30,000ms.

    http://d.l33t.tech/121fp/4V5UUDRS

    Anyone have ideas for why this would be?


  • @L33t Yes, that is normal. An established WebSocket connection is not "closed" until you close the tab. That's why it shows up with so many seconds. You can happily ignore that 😄


  • @lenovouser said:

    @L33t Yes, that is normal. An established WebSocket connection is not "closed" until you close the tab. That's why it shows up with so many seconds. You can happily ignore that 😄

    Thanks for the clarification. I kinda figured as much, but wanted to make sure. 😉


  • @lenovouser I am aware how to setup NodeBB in a folder, however the issue is that the above given instructions of yours, do not work with a folder based installation.


  • @AOKP are there any errors I could take a look at?


  • @lenovouser basically the same as if you wouldn't use the config.
    If you try to visit the forum under the new URL for example (live.<domain.tld>) it is saying that the page wasn't found, so it seems that the "entrance" of it is false.

  • Community Rep

    Is this working for anyone? I've been struggling trying to make it work. I'm getting an "invalid session" error whenever the site uses websockets.

    I have the realip installed and it's working according to my nginx logs.

    Seems like it could be something wrong with the forums, the request query is blank (no sid), and doesn't have any cookie. (My Java app, which injects the cookie itself, seems to be working with websockets.)

    EDIT: My default cookie settings were somehow incorrect, setting and unsetting fixed it.


  • Good news, CloudFlare will open WebSockets for everyone 😚

  • GNU/Linux

    Does anyone know how many "concurrent connections" they actually allow in Free plan?

  • Plugin & Theme Dev

    This is great news!

    We're now running on CF CDN.

    We have around 2-300 concurrent connection. No problem so far. Much snappier! And nice to offload the SSL to them 🙂

  • Plugin & Theme Dev

    anyone got ws and polling working at same time with cloudfare?

    i did 3 test ith different config and this plugin to disable ws https://addons.mozilla.org/en-US/firefox/addon/websocket-disabler/

    "socket.io": {
    "transports": ["websocket"]
    ]
    result: only websocket

    "socket.io": {
    "transports": ["polling","websocket"]
    }
    result: only polling

    "socket.io": {
    "transports": ["websocket","polling"]
    }
    result: only websocket

    so disabling ws it doesnt let you write a post

  • Plugin & Theme Dev

    Anyone? @hek @yariplus


  • @exodo you can now totally remove the whole configuration and let it run over your main domain as CloudFlare has enabled WebSockets for free.

  • Plugin & Theme Dev

    @lenovouser said in Using CloudFlare with NodeBB:

    @exodo you can now totally remove the whole configuration and let it run over your main domain as CloudFlare has enabled WebSockets for free.

    I have it that way

    @lenovouser said in Using CloudFlare with NodeBB:

    @exodo you can now totally remove the whole configuration and let it run over your main domain as CloudFlare has enabled WebSockets for free.

  • Plugin & Theme Dev

    @exodo

    I ended up configuring ssl on our domain (Cloudflare Full SSL setup).
    I had to adopt config.json to enable ssl for websockets. But as you can see I didn't change the socket.io transports defaults.

    {
        "port": ["4567", "4568", "4569"],
        "ssl": {
             "cert": "/etc/nginx/ssl/mysensors_certificate.pem",
             "key": "/etc/nginx/ssl/mysensors_key.pem"
        },
        "url": "https://forum.mysensors.org",
        "secret": "****************",
        "database": "redis",
        "redis": {
            "host": "127.0.0.1",
            "port": "6380",
            "password": "**********",
            "database": "1"
        }
    }
    

    This is our nginx config.

    upstream io_nodes {
        ip_hash;
        server 127.0.0.1:4567;
        server 127.0.0.1:4568;
        server 127.0.0.1:4569;
    }
    
    server {
        server_name forum.mysensors.org;
        listen     443 ssl spdy;
    
        ssl        on;
        ssl_certificate         /etc/nginx/ssl/mysensors_certificate.pem;
        ssl_certificate_key     /etc/nginx/ssl/mysensors_key.pem;
    
        # enables all versions of TLS, but not SSLv2 or 3 which are weak and now deprecated.
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    
        # disables all weak ciphers
        ssl_ciphers 'AES128+EECDH:AES128+EDH';
    
        ssl_prefer_server_ciphers on;
    
        # prevents 502 bad gateway error
        large_client_header_buffers 8 32k;
    
        client_max_body_size 2M;
    
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_redirect off;
        proxy_buffering off;
    
        # Socket.IO Support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    
        gzip on;
        gzip_min_length 1000;
        gzip_proxied off;
        gzip_types text/plain application/xml application/x-javascript text/css application/json;
    
        location @nodebb {
            proxy_pass https://io_nodes;
        }
    
        location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) {
            root /home/msforum/NodeBB/public/;
            try_files $uri $uri/ @nodebb;
        }
    
    
        location / {
            error_page 502 =200 @maintenance;
            # prevents 502 bad gateway error
            proxy_buffers 8 32k;
            proxy_buffer_size 64k;
            proxy_pass https://io_nodes;
        }
        location @maintenance {
            root /opt/nginx/maintanance/;
            try_files $uri /index.html =503;
        }
    }
    

    Quite a few browsers still seem to use polling. I really don't know why.
    We got quite a peak in cloudflare.. But a slowly decreasing bandwidth usage:
    0_1463302050696_Screen Shot 2016-05-15 at 10.45.37.png

  • Community Rep

    @exodo Not sure. I just have the defaults for transports. Have not had an issue.

Suggested Topics

| |