jrief / django-websocket-redis

Websockets for Django applications using Redis as message queue
http://django-websocket-redis.awesto.com/
MIT License
895 stars 222 forks source link

Can't get example working #204

Open jorge-lavin opened 8 years ago

jorge-lavin commented 8 years ago

When trying to run the example chat server I get the following error

(django_test)[xxx@yyy examples]$ python manage.py runserver 0.0.0.0:8000
Performing system checks...

System check identified no issues (0 silenced).
[2016-09-14 13:28:27,240 utils] DEBUG: (0.001) QUERY = "\n            SELECT name, type FROM sqlite_master\n            WHERE type in ('table', 'view') AND NOT name='sqlite_sequence'\n            ORDER BY name" - PARAMS = (); args=None
[2016-09-14 13:28:27,243 utils] DEBUG: (0.000) QUERY = u'SELECT "django_migrations"."app", "django_migrations"."name" FROM "django_migrations"' - PARAMS = (); args=()
September 14, 2016 - 13:28:27
Django version 1.8.8, using settings 'chatserver.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
[2016-09-14 13:28:27,267 django_runserver] INFO: Websocket support is enabled
/tmp/test/django-websocket-redis/examples/chatserver/urls.py:17: RemovedInDjango19Warning: Default value of 'RedirectView.permanent' will change from True to False in Django 1.9. Set an explicit value to silence this warning.
  url(r'^$', RedirectView.as_view(url=reverse_lazy('broadcast_chat'))),

[14/Sep/2016 13:28:30] "GET /chat/ HTTP/1.1" 200 4493
[14/Sep/2016 13:28:37] "GET /chat/ HTTP/1.1" 200 4493
[14/Sep/2016 13:28:38] "GET /static/js/ws4redis.js HTTP/1.1" 304 0
[2016-09-14 13:28:38,447 django_runserver] DEBUG: WebSocket request accepted, switching protocols
[2016-09-14 13:28:38,448 wsgi_server] DEBUG: Subscribed to channels: subscribe-broadcast, publish-broadcast
[2016-09-14 13:28:38,721 websocket] INFO: websocket.receive: WebSocketError Unexpected EOF while decoding header
[2016-09-14 13:28:38,721 websocket] DEBUG: Closed WebSocket
[2016-09-14 13:28:38,722 websocket] DEBUG: Failed to write closing frame -> closing socket
[2016-09-14 13:28:38,722 websocket] DEBUG: Closed WebSocket
[2016-09-14 13:28:38,722 websocket] DEBUG: Failed to write closing frame -> closing socket
[2016-09-14 13:28:38,722 websocket] DEBUG: Closed WebSocket
[14/Sep/2016 13:28:38] "GET /ws/foobar?subscribe-broadcast&publish-broadcast&echo HTTP/1.1" 101 0
^C

Then there is an endless loop of failed websocket connections, What may be hapenning here?

jrief commented 8 years ago

This seems weird:

[2016-09-14 13:28:38,721 websocket] INFO: websocket.receive: WebSocketError Unexpected EOF while decoding header

which browser? any firewall/proxy in between?

jorge-lavin commented 8 years ago

Chrome Version 52.0.2743.116 m (64-bit) and no firewall / proxy in between but a VPN

rafe-g commented 7 years ago

@jrief i see this as well however only see this on safari client 10.0.1 (11602.2.14.0.7). Chrome 54.0.2840.98 and Firefox 47.0 work fine. Its definitely browser dependent. Looks like something in safari's latest 10.0.1 rollout broke this client.

grevzi commented 2 years ago

Hello guys. I have the same errors on my console:

websocket.receive: WebSocketError Unexpected EOF while decoding header
INFO 2022-06-23 11:15:40,460 [django.request:websocket.py:222] [Thread-19] websocket.receive: WebSocketError Unexpected EOF while decoding header

What I found during debugging. For now, I have to disable WS4REDIS_HEARTBEAT and in this case, the issue is present, but... When it is enabled there are no issues.

Can it be helpful to resolve this issue?