[Answered ]-Django ASGI channels application not keeping track of multiple websocket clients (using redis and nginx)

1👍

I had missed .as_asgi() when defining routes for my websockets, meaning each instance I created was overwritten by the next one I made.

My routing.py now looks like:

application = ProtocolTypeRouter({
    'websocket': AllowedHostsOriginValidator(
        AuthMiddlewareStack(
            URLRouter(
                [
                    url("calling/interface/", ChatConsumer.as_asgi()),
                ]
            )
        )
    )
})

Leave a comment