Giter Club home page Giter Club logo

Comments (4)

jrief avatar jrief commented on July 28, 2024

I never used werkzeug, so I can't really say whats the problem.
You're encountering this problem in debug mode. There ws4redis hijacks the main loop if the URL starts with /ws. I assume that werkzeug somehow gets in conflict with this approach. Could you please dig into that direction.

from django-websocket-redis.

kosz85 avatar kosz85 commented on July 28, 2024

The problem is that werkzeug is using standard django WSGI handler from from django.core.handlers.wsgi import WSGIHandler, so if it's not overwritten then it fails. And I didn't found setting to do that without monkeypatching or editing source code.

It's working ok, but werkzeug is WSGI which isn't Async like websockets, so after keeping connection too long it just closing it forcefully. It event write you about it INFO: Finish long living response with status code: 192.168.85.1 - - [29/Jul/2014 22:04:57] "GET /ws/foobar?subscribe-broadcast&publish-broadcast&echo HTTP/1.1" 101

It's just incompatible. Use django-devserver witch allow to add option --wsgi-app=ws4redis.django_runserver or add such possibility to werkzeug :)

from django-websocket-redis.

szelga avatar szelga commented on July 28, 2024

@kosz85 were you able to successfully monkey-patch Werkzeug then?

from django-websocket-redis.

kosz85 avatar kosz85 commented on July 28, 2024

No I'm just using django-devserver. I think it's easier and less time consuming to use nginx with uwsgi or django-devserver then rewriting werkzeug. If this is not an option, you can try run two separate servers, one for websockets without werkzeug and second normal for django app with werkzeug. Thought such setup will need to add some changes to app (adding port for websockets or proxy like nginx).

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.