django-websocket-redis
django-websocket-redis copied to clipboard
publish 'websocket closed' on browser close [broadcast channel]
My apologies in advance if this question has been answered. But I am trying to publish a message on a broadcast channel when a user closes the browser. I am currently working on a project where a user 'locks' the page (through logic) and this 'lock' is released when the user exists the page. Meanwhile. other user(s) can enter this same page but will be in read-only mode. My goal is once the first user exits the browser, the other users will get a message (through receive_message) stating that they can access the lock on the page.
This feature is really requested, see #29, #70 and #43. If I have some time, I'll try to implement this.
I've been trying to implement this feature where I can publish message on page clos. One thing I am trying to differentiate is a websocket.close() on a webpage close and on a webpage refresh. The status code is '200' on both situations (wsgi_server.WebsocketWSGIServer.call). Can we differentiate between a webpage refresh and a webpage close?