From 2956fa406af2a116b2558810d20205f5419a82ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Thu, 29 Jul 2021 14:29:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=ADHostName=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=9C=89=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs b/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs index 52a33ba..213daa9 100644 --- a/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs +++ b/FastGithub.ReverseProxy/KestrelServerOptionsExtensions.cs @@ -188,7 +188,11 @@ namespace FastGithub } var globalPropreties = IPGlobalProperties.GetIPGlobalProperties(); - yield return globalPropreties.HostName; + if (string.IsNullOrEmpty(globalPropreties.HostName) == false) + { + yield return globalPropreties.HostName; + } + foreach (var item in globalPropreties.GetUnicastAddresses()) { if (item.Address.AddressFamily == AddressFamily.InterNetwork)