public Server(string prefix) { if (!HttpListener.IsSupported) { Console.WriteLine("server is not supported"); } listener = new HttpListener(); listener.Prefixes.Add(prefix); resourceLocator = new HttpResourceLocator(); }
public HttpServer(string prefix) { if (!HttpListener.IsSupported) { // Requires at least a Windows XP with Service Pack 2 throw new NotSupportedException("The Http Server cannot run on this operating system."); } _httpListener = new HttpListener(); // Add the prefixes to listen to _httpListener.Prefixes.Add(prefix); _resourceLocator = new HttpResourceLocator(); }