Пример #1
0
    void OnDisable()
    {
        ws.Stop();

        if (cefProcess != null && !cefProcess.HasExited)
        {
            cefProcess.Kill();
        }
        stopServer();
    }
Пример #2
0
        static void Main(string[] args)
        {
            StartServer();

            Console.WriteLine("Started on https://" + _Hostname + ":" + _Port);

            while (_RunForever)
            {
                Console.Write("Command [? for help]: ");
                string userInput = Console.ReadLine();
                if (String.IsNullOrEmpty(userInput))
                {
                    continue;
                }

                switch (userInput)
                {
                case "?":
                    Menu();
                    break;

                case "q":
                    _RunForever = false;
                    break;

                case "c":
                case "cls":
                    Console.Clear();
                    break;

                case "state":
                    Console.WriteLine(_Server.IsListening);
                    break;

                case "start":
                    _Server.Start();
                    break;

                case "stop":
                    _Server.Stop();
                    break;

                case "dispose":
                    _Server.Dispose();
                    break;

                case "conn":
                    ListConnections();
                    break;
                }
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            string endpoint = "http://localhost:8080/test/";

            Webserver ws = new Webserver(SendResponse, endpoint);

            ws.Run();
            Console.WriteLine($"Simple WebServer, running at: {endpoint} - press any key to stop");
            Console.ReadKey();
            ws.Stop();

            thingTest("thing");
        }
Пример #4
0
        static void Main(string[] args)
        {
            string endpoint = "http://localhost:8080/test/";

            Webserver ws = new Webserver(SendResponse, endpoint);

            ws.Run();
            Console.WriteLine($"Simple WebServer, running at: {endpoint} - press any key to stop");
            Console.ReadKey();
            ws.Stop();

            //End goal is to pass method and endpoint here
            //PostServer ps = new PostServer();
            //Console.WriteLine($"Simple WebServer, running - press any key to stop");
            //Console.ReadKey();
        }