jrief / django-websocket-redis

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

How to define {{ WEBSOCKET_URI }} with corresponding slug on front end? #270

Closed nrgx closed 5 years ago

nrgx commented 5 years ago

In my app every chat instance has its name and slug based on it, for instance: Test 1is localhost:8000/test-1/, Test 2 - localhost:8000/test-2/ and Test 3 - localhost:8000/test-3/. That way I have achieved message separation and I know that messages from test-1 chat won't be in test-2 and test-3, the same goes for others. But because of such separation I can't define them on client side, all of them are logging into console this message Connecting to ws://0.0.0.0:9000/ws/chat?subscribe-group .... Sending message to chat doesn't make them appear immediately on the screen, instead they are shown after reloading page. I suppose I should have something like this Connecting to ws://0.0.0.0:9000/ws/test-3/chat?subscribe-group ... or Connecting to ws://0.0.0.0:9000/test-3/ws/chat?subscribe-group ... but it doesn't work that way.