static void Main(string[] args) { ServicePointManager.ServerCertificateValidationCallback += (a, b, c, d) => true; var master = new MasterProxy(); var settings = new CnCSettings { LisenerPrefix = "http://+:4444/", MasterProxy = master }; var server = new CnC(settings); server.Start(); //now that the web interface is up, we can notify our master master.NotifyUp(); #if !MONO Console.WriteLine("Press any key to quit"); Console.ReadKey(true); #else System.Threading.Thread.Sleep(); //zzz until all goes away... #endif master.NotifyDown(); server.Stop(); }
public CnC(CnCSettings settings) { listenPrefix = settings.LisenerPrefix; master = settings.MasterProxy; router = new HttpListenerRouter { {"^/start/?", "POST", OnStart }, {"^/status/?$", "GET", StatusGeneral }, {"^/status/[a-fA-F0-9{}-]+$", "GET", OnStatusSpecific }, }; }