aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs11
1 files changed, 5 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 3a504d2f4..c244e7cfa 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -1186,14 +1186,13 @@ namespace Emby.Server.Implementations
}
/// <inheritdoc/>
- public string GetLoopbackHttpApiUrl()
+ public string GetUrlForUseByHttpApi()
{
- if (NetManager.IsIP6Enabled)
- {
- return GetLocalApiUrl("::1", Uri.UriSchemeHttp, HttpPort);
- }
+ // GetBindInterfaces will return an interface.
+ var bind = NetManager.GetInternalBindAddresses().FirstOrDefault() ??
+ NetManager.GetAllBindInterfaces(true).First();
- return GetLocalApiUrl("127.0.0.1", Uri.UriSchemeHttp, HttpPort);
+ return GetLocalApiUrl(bind.Address.ToString(), Uri.UriSchemeHttp);
}
/// <inheritdoc/>