From 6632b63a11713a8c1415499fc4adb1b423d1c758 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 15 Apr 2021 21:15:29 +1000 Subject: [PATCH] support overriding listening IP during dev --- qt/aqt/mediasrv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt/aqt/mediasrv.py b/qt/aqt/mediasrv.py index 0e9f7b5e8..6df56f0d8 100644 --- a/qt/aqt/mediasrv.py +++ b/qt/aqt/mediasrv.py @@ -64,10 +64,11 @@ class MediaServer(threading.Thread): logging.basicConfig() logging.getLogger("waitress").setLevel(logging.ERROR) + desired_host = os.getenv("ANKI_API_HOST", "127.0.0.1") desired_port = int(os.getenv("ANKI_API_PORT", "0")) self.server = create_server( app, - host="127.0.0.1", + host=desired_host, port=desired_port, clear_untrusted_proxy_headers=True, )