public ApiManager()
{
string hostName = Dns.GetHostName();
string IP = Dns.GetHostByName(hostName).AddressList[0].ToString();
string DebugPort = ConfigurationManager.AppSettings["DebugPort"];
m_vListener = new HttpListener();
if (Convert.ToBoolean(ConfigurationManager.AppSettings["DebugModeLocal"]))
{
m_vListener.Prefixes.Add("http://localhost:" + DebugPort + "/debug/");
//m_vListener.AuthenticationSchemes = AuthenticationSchemes.Anonymous;
m_vListener.Start();
Console.WriteLine("API Manager started on http://localhost:" + DebugPort + "/debug/");
Action action = RunServer;
action.BeginInvoke(RunServerCallback, action);
}
else
{
string DebugMode = IP + ":";
m_vListener.Prefixes.Add("http://" + DebugMode + DebugPort + "/debug/");
//m_vListener.AuthenticationSchemes = AuthenticationSchemes.Anonymous;
m_vListener.Start();
Console.WriteLine("API Manager started on http://" + IP + ":" + DebugPort + "/debug/");
Action action = RunServer;
action.BeginInvoke(RunServerCallback, action);
}
}