modifié: superTornado.py
modifié: video.html
This commit is contained in:
parent
be80c006a6
commit
86f037a855
@ -95,9 +95,9 @@ class DisconnectionHandler(BaseHandler):
|
|||||||
|
|
||||||
class WSocketHandler(tornado.websocket.WebSocketHandler):
|
class WSocketHandler(tornado.websocket.WebSocketHandler):
|
||||||
def open(self) :
|
def open(self) :
|
||||||
"""if not self.current_user :
|
if not self.current_user :
|
||||||
self.close()
|
self.close()
|
||||||
return"""
|
return
|
||||||
print "->Websocket opened"
|
print "->Websocket opened"
|
||||||
while 1 :
|
while 1 :
|
||||||
try :
|
try :
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
ws.onclose = function () {
|
ws.onclose = function () {
|
||||||
console.log("connection closed");
|
console.log("connection closed");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.onunload=function(){
|
||||||
|
ws.close();
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
Reference in New Issue
Block a user