diff --git a/superTornado.py b/superTornado.py index 5b8965f..f2c6ffc 100644 --- a/superTornado.py +++ b/superTornado.py @@ -95,6 +95,17 @@ class WSocketHandler(BaseHandler,tornado.websocket.WebSocketHandler): print 'maison.request("GET", "micom/lamp.php?room=salon1&order=1")' print "->Authorized user access" + try : + socket.setdefaulttimeout(5) + f = urlopen('http://test:a@192.168.0.13/image.jpg?cidx=791836195') + data = f.read() + encoded = base64.b64encode(data) + self.write_message(encoded) + except Exception, e : + print e + self.write_message("error") + + def on_message(self,mesg): print "->Data receive" try : diff --git a/video.html b/video.html index 283f069..3c3bd6a 100644 --- a/video.html +++ b/video.html @@ -19,7 +19,7 @@ return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});v } else { console.log("data NOK !"); - var str = "
Erreur : image camera indisponilbe
"; + var str = "Erreur : image camera indisponible
"; } $('.image').html(str); }