Exemple #1
0
 public void AuthorizeDomains(String[] domains)
 {
     using (HTTPServer httpserver = new HTTPServer()) {
         httpserver.Listen(80);
         HTTPPathSelector httprouter = new HTTPPathSelector();
         httpserver.ContentProvider = httprouter;
         AuthorizeDomains(domains, httprouter);
     }
 }
Exemple #2
0
 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"));
         }
     });
 }