From f4c48a798a94845e58d0a4e001d9157ce2e8e0d8 Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Sat, 29 Jun 2024 17:32:47 +0200 Subject: [PATCH] Fixed https issue with socketio --- app.py | 5 ++++- compose.yaml | 2 +- templates/create.html | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index efcba92..f945627 100644 --- a/app.py +++ b/app.py @@ -14,9 +14,12 @@ import shutil # save img locally import eventlet from downloadRB import download_and_unzip,get_nil_images from db import initialize_database,get_rows,delete_tables +from werkzeug.middleware.proxy_fix import ProxyFix + app = Flask(__name__) -socketio = SocketIO(app) +app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1) +socketio = SocketIO(app,cors_allowed_origins="https://lego.baerentsen.space") count = 0 @app.route('/favicon.ico') diff --git a/compose.yaml b/compose.yaml index 40a81a7..58a5df7 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,7 +3,7 @@ services: container_name: LEGOOrganizer build: . ports: - - "5111:3333" + - "3333:3333" volumes: - .:/app env_file: diff --git a/templates/create.html b/templates/create.html index 09069ec..d0d4ddc 100644 --- a/templates/create.html +++ b/templates/create.html @@ -80,7 +80,9 @@