From 2bb68654fc5f09da5b81c86d45ae04a2e27e42ca Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Thu, 21 Jul 2016 11:52:56 -0400 Subject: [PATCH] Send WebSocket close code on disconnect --- daphne/ws_protocol.py | 1 + 1 file changed, 1 insertion(+) diff --git a/daphne/ws_protocol.py b/daphne/ws_protocol.py index 3428d45..e42af82 100755 --- a/daphne/ws_protocol.py +++ b/daphne/ws_protocol.py @@ -165,6 +165,7 @@ class WebSocketProtocol(WebSocketServerProtocol): if not self.muted: self.channel_layer.send("websocket.disconnect", { "reply_channel": self.reply_channel, + "code": code, "path": self.unquote(self.path), "order": self.packets_received + 1, })