diff --git a/routes/esp_routes.py b/routes/esp_routes.py index b8ec713..77daa06 100644 --- a/routes/esp_routes.py +++ b/routes/esp_routes.py @@ -24,7 +24,7 @@ def esp_online(): sender_ip = request.headers.get('X-Forwarded-For', request.remote_addr) esp_ip = data.get("ip", "unknown") - esp_conn_infos["ip_local"] = esp_ip + esp_conn_infos["ip_local"] = esp_ip[0] esp_conn_infos["ip_global"] = sender_ip esp_conn_infos["last_seen"] = datetime.now() esp_conn_infos["connection_valid"] = True diff --git a/server.py b/server.py index 71a7bad..81008f8 100644 --- a/server.py +++ b/server.py @@ -19,7 +19,7 @@ MQTT_TOPIC_SEND = "coffee/command" app = Flask(__name__, static_url_path='/unsecure/static') app.config['SECRET_KEY'] = 'super-secret-key' -socketio.init_app(app) +socketio.init_app(app, cors_allowed_origins="*", async_mode='threading') # Blueprints registrieren diff --git a/static/socketio.js b/static/socketio.js index 010bec1..33cff4d 100644 --- a/static/socketio.js +++ b/static/socketio.js @@ -28,4 +28,4 @@ socket.on('static_data', (data) => { gebId("infoMain").classList.add("blink-orange"); gebId("machine-status-butt").classList.add("deniePress"); } -}); \ No newline at end of file +});