mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-01-03 15:24:11 +00:00
DnsWebService: trying to start web service on 127.0.0.1 when it fails to start with default hostname.
This commit is contained in:
@@ -6531,9 +6531,19 @@ namespace DnsServerCore
|
||||
{
|
||||
_log.Write("Web Service failed to bind using default hostname. Attempting to bind again using 'localhost' hostname.\r\n" + ex.ToString());
|
||||
|
||||
_webService = new HttpListener();
|
||||
_webService.Prefixes.Add("http://localhost:" + _webServiceHttpPort + "/");
|
||||
_webService.Start();
|
||||
try
|
||||
{
|
||||
_webService = new HttpListener();
|
||||
_webService.Prefixes.Add("http://localhost:" + _webServiceHttpPort + "/");
|
||||
_webService.Prefixes.Add("http://127.0.0.1:" + _webServiceHttpPort + "/");
|
||||
_webService.Start();
|
||||
}
|
||||
catch
|
||||
{
|
||||
_webService = new HttpListener();
|
||||
_webService.Prefixes.Add("http://localhost:" + _webServiceHttpPort + "/");
|
||||
_webService.Start();
|
||||
}
|
||||
|
||||
_webServiceHostname = "localhost";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user