diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-07 15:46:55 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-07 15:46:55 -0400 |
| commit | 18df678d3f18bd710aa65fa315f4006a78415fbc (patch) | |
| tree | 80f975cad1efc5814d04b6c2191afad1051e0dd1 | |
| parent | 49b96a3613591a719d454b37734fd4823c98e31e (diff) | |
fixes #1537 - [Feature Request] Provide option to select which interface(s) to bind to
| -rw-r--r-- | MediaBrowser.Server.Startup.Common/ApplicationHost.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 23710479b..9acb3bea2 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -831,9 +831,24 @@ namespace MediaBrowser.Server.Startup.Common private string CertificatePath { get; set; } + private string NormalizeConfiguredLocalAddress(string address) + { + var index = address.Trim('/').IndexOf('/'); + + if (index != -1) + { + address = address.Substring(index + 1); + } + + return address.Trim('/'); + } private IEnumerable<string> GetUrlPrefixes() { - var hosts = ServerConfigurationManager.Configuration.LocalNetworkAddresses.ToList(); + var hosts = ServerConfigurationManager + .Configuration + .LocalNetworkAddresses + .Select(NormalizeConfiguredLocalAddress) + .ToList(); if (hosts.Count == 0) { |
