예제 #1
0
        private static void Initialize(string[] args)
        {
            // get settings first
            string settingsFile = args == null || args.Length == 0 ? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, HttpServerRole.DefaultSettingsFilePath) : args[0];

            HttpServerRole.settingsProvider = new HttpServerSettingsProvider(logger, new SystemFileReader(), settingsFile);
            HttpServerRole.settingsProvider.LoadSettings();

            // setup regular logging
            HttpServerRole.SetupLogging();

            // setup authentication manager
            HttpServerRole.authManager = new AuthenticationManager(HttpServerRole.settingsProvider.Settings);

            // setup operation factory
            HttpServerRole.operationFactory = new AssemblyOperationFactory(HttpServerRole.logger, HttpServerRole.settingsProvider.Settings, HttpServerRole.authManager);

            // setup httpServer
            HttpServerRole.httpServer = new HttpClientServer(
                HttpServerRole.logger,
                HttpServerRole.operationFactory,
                HttpServerRole.authManager,
                HttpServerRole.settingsProvider.Settings,
                new NetshWrapper(HttpServerRole.logger));
        }
예제 #2
0
        static void Main(string[] args)
        {
            HttpServerRole.SetupBasicLogging();
            HttpServerRole.Initialize(args);
            HttpServerRole.Start();

            Console.ReadLine();
        }
예제 #3
0
        static void Main(string[] args)
        {
            HttpServerRole.SetupBasicLogging();
            HttpServerRole.Initialize(args);
            HttpServerRole.Start();

            // Keep running in infinite loop.
            while (true)
            {
                Console.WriteLine("Running");
                Thread.Sleep(60000);
            }
        }