From a9115f29e7ab1b0bc2b505127941d06933007d64 Mon Sep 17 00:00:00 2001 From: tsukumi Date: Sat, 23 Nov 2024 23:05:57 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20--host=20=E3=81=AB=20127.0.0.1=20?= =?UTF-8?q?=E3=81=8C=E6=8C=87=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=9F=E3=81=A8?= =?UTF-8?q?=E3=81=8D=E3=80=81Windows=20=E4=B8=8A=E3=81=A7=20localhost=20?= =?UTF-8?q?=E3=81=A7=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9=E3=81=97=E3=81=9F?= =?UTF-8?q?=E9=9A=9B=E3=81=AB=20IPv6=20=E3=81=A7=E3=83=90=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=89=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=81=AB=E3=82=88=E3=82=8B=E6=8E=A5=E7=B6=9A=E9=81=85?= =?UTF-8?q?=E5=BB=B6=E3=82=92=E9=98=B2=E3=81=90=E3=81=9F=E3=82=81=E3=81=AB?= =?UTF-8?q?=E3=80=81=E4=BB=A3=E3=82=8F=E3=82=8A=E3=81=AB=20localhost=20?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=97=20IPv4=20=E3=81=A8=20IPv6?= =?UTF-8?q?=20=E3=81=AE=E4=B8=A1=E6=96=B9=E3=81=A7=E3=83=90=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=89=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref: github.com/VOICEVOX/voicevox_engine/issues/1480 --- run.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/run.py b/run.py index f8320943..faa0c2bc 100644 --- a/run.py +++ b/run.py @@ -308,6 +308,12 @@ def read_cli_arguments(envs: Envs) -> CLIArgs: # args_dict["runtime_dirs"] = args_dict.pop("runtime_dir") args_dict["allow_origins"] = args_dict.pop("allow_origin") + # --host に 127.0.0.1 が指定されたとき、Windows 上で localhost でアクセスした際に + # IPv6 でバインドされないことによる接続遅延を防ぐために、代わりに localhost を指定し IPv4 と IPv6 の両方でバインドする + # ref: https://github.com/VOICEVOX/voicevox_engine/issues/1480 + if args_dict["host"] == "127.0.0.1": + args_dict["host"] = "localhost" + args = _cli_args_adapter.validate_python(args_dict) return args