Giter Club home page Giter Club logo

Comments (3)

jrief avatar jrief commented on July 28, 2024

I just found a bug in the code, but it refers to user-subscription, so this does not affect your setup.

Hmmm, looking at your logs, it seems as if the client is disconnected from the server by someone intermediate, maybe NGiNX or another proxy. Then uWSGI can't receive a PONG, which causes the error logs on the server.

Could you please test with Chrome.

from django-websocket-redis.

HorizonXP avatar HorizonXP commented on July 28, 2024

Sorry, missed this comment/reply. I'll test with Chrome.

Here's the error from Chrome:
WebSocket connection to 'ws://172.16.52.136/ws/datacentre?subscribe-broadcast' failed: Error during WebSocket handshake: 'Connection' header value is not 'Upgrade': keep-alive

That is a much better error! Sounds like you're right. Here's my Nginx configuration:

upstream strata {
  server STRATA_HOST:STRATA_PORT;
}

upstream strata_ws {
  server STRATA_WEBSOCKET_HOST:STRATA_WEBSOCKET_PORT;
}

server {
  listen 80;
  server_name <MY_URL>;

  location /static {
    autoindex on;
    alias /srv/static/;
  }

  location /ws/ {
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_pass http://strata_ws;
  }

  location / {
    include uwsgi_params;
    uwsgi_pass strata;
  }
}

I'm going to search Google to figure out what's going on here, but this is a good lead.

from django-websocket-redis.

HorizonXP avatar HorizonXP commented on July 28, 2024

So it turns out that Ubuntu 12.04 ships with Nginx 1.1 by default, which is much too old. Using Nginx's Ubuntu repository and upgrading to version 1.4.x fixed my issue.

from django-websocket-redis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.