diff --git a/src/NzbDrone.Common/Http/Dispatchers/ManagedHttpDispatcher.cs b/src/NzbDrone.Common/Http/Dispatchers/ManagedHttpDispatcher.cs index 1a94a92b6..335da0898 100644 --- a/src/NzbDrone.Common/Http/Dispatchers/ManagedHttpDispatcher.cs +++ b/src/NzbDrone.Common/Http/Dispatchers/ManagedHttpDispatcher.cs @@ -4,6 +4,7 @@ using NzbDrone.Common.Extensions; using com.LandonKey.SocksWebProxy.Proxy; using com.LandonKey.SocksWebProxy; using System.Net.Sockets; +using System.Linq; namespace NzbDrone.Common.Http.Dispatchers { @@ -31,7 +32,14 @@ namespace NzbDrone.Common.Http.Dispatchers if (request.Proxy != null && !request.Proxy.ShouldProxyBeBypassed(new Uri(request.Url.FullUri))) { - var addresses = Dns.GetHostAddresses(request.Proxy.Host); + var proxyHost = request.Proxy.Host; + if(request.Proxy.Host == "localhost") + { + proxyHost = "127.0.0.1"; + } + + var addresses = Dns.GetHostAddresses(proxyHost); + var socksUsername = request.Proxy.Username == null ? string.Empty : request.Proxy.Username; var socksPassword = request.Proxy.Password == null ? string.Empty : request.Proxy.Password; diff --git a/src/NzbDrone.Common/Http/HttpRequestProxySettings.cs b/src/NzbDrone.Common/Http/HttpRequestProxySettings.cs index ba533eb56..41c15ccfb 100644 --- a/src/NzbDrone.Common/Http/HttpRequestProxySettings.cs +++ b/src/NzbDrone.Common/Http/HttpRequestProxySettings.cs @@ -12,6 +12,8 @@ namespace NzbDrone.Common.Http Port = port; Username = username; Password = password; + SubnetFilter = filterSubnet; + BypassLocalAddress = bypassLocalAddress; } public ProxyType Type { get; private set; } diff --git a/src/NzbDrone.Core/HealthCheck/Checks/ProxyCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/ProxyCheck.cs index 9266a44f7..be688f360 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/ProxyCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/ProxyCheck.cs @@ -27,7 +27,7 @@ namespace NzbDrone.Core.HealthCheck.Checks if (_configService.ProxyEnabled) { var addresses = Dns.GetHostAddresses(_configService.ProxyHostname); - if(addresses.Length != 1) + if(!addresses.Any()) { return new HealthCheck(GetType(), HealthCheckResult.Error, "Failed to resolve the IP Address for the Configured Proxy Host: " + _configService.ProxyHostname); }