modifié: superTornado.py
This commit is contained in:
parent
9eaa349025
commit
0431210ab7
@ -99,16 +99,16 @@ class WSocketHandler(tornado.websocket.WebSocketHandler):
|
|||||||
self.close()
|
self.close()
|
||||||
return"""
|
return"""
|
||||||
print "->Websocket opened"
|
print "->Websocket opened"
|
||||||
while 1 :
|
|
||||||
try :
|
try :
|
||||||
f = urlopen('http://test:a@192.168.1.15/image.jpg?cidx=791836195')
|
f = urlopen('http://test:a@192.168.1.15/image.jpg?cidx=791836195')
|
||||||
data = f.read()
|
data = f.read()
|
||||||
encoded = base64.b64encode(data)
|
encoded = base64.b64encode(data)
|
||||||
self.write_message(encoded)
|
self.write_message(encoded)
|
||||||
except Exception, e :
|
except Exception, e :
|
||||||
print e
|
print e
|
||||||
break
|
|
||||||
time.sleep(2)
|
|
||||||
|
|
||||||
def on_message(self,mesg):
|
def on_message(self,mesg):
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user