Sockets in Django

I n my project I have users who connect to a waiting room, after a certain time, I run an algorithm and then redirect all the users to a different room. In order to this I use sockets. Until now I have been using django_channels with daphne on Asgi, however it hasn’t been 100% reliable. I need something that will work all the time. I am looking for an alternative. I need it to accurately tell me who is in the room and who has left etc. Some of the options are:

  1. Pyzmq
  2. websockets - websockets — websockets 9.1 documentation
  3. Autobahn|Python
  4. python-socketio
  5. websocket-client
  6. graphene
  7. converse js

I would really appreciate feedback. I would prefer something which can integrate easily with django if possible. The website is up on AWS.


What is the nature of the failures? How many people are you handling? How frequent are those failures?

I’m assuming you actually mean websockets here? (Or are you opening a network socket?)

Websockets have never been 100% reliable, and probably never will be. (Doubly true with mobile devices.) Anything you do with websockets needs to be able to recover from intermittent interruptions. The clients must handle the error and close events with an attempt to reconnect. This is going to open a new websocket on the server, which the protocol you layer on top of the websocket needs to be able to handle as the “same user”.

How are you doing it now?