esp32 is taking 2-3s for TLS negotiation, try switching from https to wss
This commit is contained in:
9
app.py
9
app.py
@@ -8,10 +8,12 @@ import jinja_partials
|
||||
from flask_htmx import HTMX
|
||||
import minify_html
|
||||
from urllib.parse import urlparse
|
||||
from flask_socketio import SocketIO
|
||||
|
||||
app = Flask(__name__)
|
||||
jinja_partials.register_extensions(app)
|
||||
htmx = HTMX(app)
|
||||
socketio = SocketIO(app)
|
||||
|
||||
|
||||
@app.after_request
|
||||
@@ -29,6 +31,11 @@ def response_minify(response):
|
||||
return response
|
||||
|
||||
|
||||
@socketio.on('message')
|
||||
def handle_message(data):
|
||||
print('received message: ' + data)
|
||||
|
||||
|
||||
@app.route("/api/status", methods=['GET', 'POST'])
|
||||
def status():
|
||||
req_data = save_request(request)
|
||||
@@ -49,4 +56,4 @@ def save_request(request):
|
||||
if __name__ == '__main__':
|
||||
# Bind to PORT if defined, otherwise default to 5000.
|
||||
port = int(os.environ.get('PORT', 5000))
|
||||
app.run(host='127.0.0.1', port=port)
|
||||
socketio.run(app, host='127.0.0.1', port=port)
|
||||
|
||||
@@ -6,3 +6,7 @@ psycopg2-binary==2.9.3
|
||||
flask-htmx==0.2.0
|
||||
python-dateutil==2.8.2
|
||||
minify-html==0.10.3
|
||||
bidict==0.22.1
|
||||
flask-socketio==5.3.2
|
||||
python-engineio==4.3.4
|
||||
python-socketio==5.7.2
|
||||
Reference in New Issue
Block a user