public void AuthorizeDomains(String[] domains) { using (HTTPServer httpserver = new HTTPServer()) { httpserver.Listen(80); HTTPPathSelector httprouter = new HTTPPathSelector(); httpserver.ContentProvider = httprouter; AuthorizeDomains(domains, httprouter); } }
public void AuthorizeDomains(String[] domains, HTTPPathSelector httprouter) { AuthorizeDomains(domains, (String path, String value) => { if (value == null) { httprouter.DeletePath(path); } else { httprouter.AddPath(path, new HTTPStaticContent(value, "/text/plain")); } }); }