示例#1
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");
        }
示例#2
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();
        }
示例#3
0
        private void runbttn_Click(object sender, EventArgs e)
        {
            if (runbttn.Text.Equals("Start"))
            {
                _Server = new Webserver(this);
                _Server.Run();

                runbttn.Text = "Stop";
            }

            else
            {
                Webserver.KeepListening = false;
                // SEND REQUEST TO SERVER TO SHUTDOWN

                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("[*] APPLICATION: SHUTTING_DOWN");

                TcpClient _ExitClient = new TcpClient("192.168.0.215", _Server.IPeP.Port);
                _Server      = null;
                runbttn.Text = "Start";
            }
        }