Olivier-Truong commited on
Commit
37830f0
1 Parent(s): 4fd94c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -93,6 +93,11 @@ def initDB():
93
  initDB()
94
 
95
  app = Flask(__name__)
 
 
 
 
 
96
  app.config['SECRET_KEY'] = 'fhdvidushdujxjddfkidfjojcvndhfxnvkdnvid'
97
  app.config['tab'] = {'usid': {123456789: {'tmp-img': ""}}, "Tempo": 0, "any": b''}
98
  socketio = SocketIO(app)
@@ -150,6 +155,12 @@ def upload_img():
150
  return send_file("cloud-computing.png")
151
 
152
 
 
 
 
 
 
 
153
  @socketio.on('message')
154
  def handle_message(message):
155
  r = message
 
93
  initDB()
94
 
95
  app = Flask(__name__)
96
+
97
+ sock = Sock(app)
98
+
99
+ app.config['SOCK_SERVER_OPTIONS'] = {'ping_interval': 25}
100
+
101
  app.config['SECRET_KEY'] = 'fhdvidushdujxjddfkidfjojcvndhfxnvkdnvid'
102
  app.config['tab'] = {'usid': {123456789: {'tmp-img': ""}}, "Tempo": 0, "any": b''}
103
  socketio = SocketIO(app)
 
155
  return send_file("cloud-computing.png")
156
 
157
 
158
+ @sock.route('/pred')
159
+ def echo(ws):
160
+ while True:
161
+ data = ws.receive()
162
+ ws.send(data)
163
+
164
  @socketio.on('message')
165
  def handle_message(message):
166
  r = message