diff --git a/Ooui/UI.cs b/Ooui/UI.cs index 5444f31..fde65d8 100644 --- a/Ooui/UI.cs +++ b/Ooui/UI.cs @@ -34,7 +34,7 @@ namespace Ooui static string host = "*"; public static string Host { - get => host; + get => host == "*" ? "localhost" : host; set { if (!string.IsNullOrWhiteSpace (value) && host != value) { host = value; @@ -215,9 +215,8 @@ namespace Ooui } public static string GetUrl (string path) - { - var localhost = host == "*" ? "localhost" : host; - var url = $"http://{localhost}:{port}{path}"; + { + var url = $"http://{Host}:{port}{path}"; return url; } @@ -236,7 +235,7 @@ namespace Ooui if (serverCts != null) return; serverCts = new CancellationTokenSource (); var token = serverCts.Token; - var listenerPrefix = $"http://{host}:{port}/"; + var listenerPrefix = $"http://{Host}:{port}/"; Task.Run (() => RunAsync (listenerPrefix, token), token); }