public UrlBuilder()
{
protocol = EnvironmentManager.GetSettingValue("Protocol");
hostName = EnvironmentManager.GetSettingValue("HostName");
port = EnvironmentManager.GetSettingValue("Port");
// TODO(andre.nogueira): Remove trailing / from folder
path = EnvironmentManager.GetSettingValue("Folder");
//Use the first IPv4 address that we find
IPAddress ipAddress = IPAddress.Parse("127.0.0.1");
foreach (IPAddress ip in Dns.GetHostEntry(hostName).AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
ipAddress = ip;
break;
}
}
alternateHostName = ipAddress.ToString();
}