diff --git a/superTornado.py b/superTornado.py index 6778d6b..8d18676 100644 --- a/superTornado.py +++ b/superTornado.py @@ -95,9 +95,9 @@ class DisconnectionHandler(BaseHandler): class WSocketHandler(tornado.websocket.WebSocketHandler): def open(self) : - """if not self.current_user : + if not self.current_user : self.close() - return""" + return print "->Websocket opened" while 1 : try : diff --git a/video.html b/video.html index 1aeaf39..a8268f3 100644 --- a/video.html +++ b/video.html @@ -18,6 +18,10 @@ ws.onclose = function () { console.log("connection closed"); }; + + window.onunload=function(){ + ws.close(); + };