public UnsecuredWebserver(SettingsReader Settings)
     : base(Settings)
 {
     this.Settings = Settings;
     listener = new TcpListener(IPAddress.Parse("127.0.0.1"), Settings.Port);
     logger = Logger.getInstance();
 }
        public SecuredWebserver(SettingsReader Settings)
            : base(Settings)
        {
            this.Settings = Settings;
            activeIPs = new Dictionary<string, int>();
            connector = Connector.getInstance();
            sessions = new SessionManager(connector);
            logger = Logger.getInstance();

            listener = new TcpListener(IPAddress.Parse("127.0.0.1"), Settings.AdminPort);
            //certificate = new X509Certificate2(cerficicate_name, "ChrisLuke");
        }
        public AbstractWebserver(SettingsReader Settings)
        {
            this.Settings = Settings;

            // Setup MimeDictionary
            MimeDictionary = new Dictionary<String, String>();
            MimeDictionary.Add(".html", "text/html");
            MimeDictionary.Add(".htm", "text/html");
            MimeDictionary.Add(".xml", "text/xml");
            MimeDictionary.Add(".jpg", "image/jpeg");
            MimeDictionary.Add(".png", "image/png");
            MimeDictionary.Add(".bmp", "image/bmp");
            MimeDictionary.Add(".gif", "image/gif");
            MimeDictionary.Add(".ico", "image/x-icon");
        }
        public static void Main(String[] args)
        {
            Settings = new SettingsReader();

            AbstractWebserver webserver = new UnsecuredWebserver(Settings);
            AbstractWebserver adminserver = new SecuredWebserver(Settings);

            Thread tWeb = new Thread(m => webserver.StartListening());
            Thread tAdmin = new Thread(m => adminserver.StartListening());

            Thread tLogger = new Thread(Logger.getInstance().processLogs);

            //new Thread(Logger.getInstance().testAddLogs).Start();

            tLogger.Start();
            tWeb.Start();
            tAdmin.Start();

            Console.WriteLine("Christiaan & Luke's webserver. Press ^C to quit.");
        }