예제 #1
0
파일: Program.cs 프로젝트: chakrit/plumber
        public void Run()
        {
            var server = new DotNetServer(new IPEndPoint(IPAddress.Loopback, 80));
              var pipes = Pipes
            .Connect(Static.String("Hello, World!"));

              var instance = server.Start();
              server.Host(new OwinApplication(pipes.AsOwinApp()));

              Console.WriteLine("Listening...");
              Console.ReadKey();

              instance.Dispose();
        }
예제 #2
0
파일: Simple.cs 프로젝트: markrendle/kayak
        public static void Run()
        {
            var server = new DotNetServer();

            var pipe = server.Start();

            server.Host((env, respond, error) =>
                {
                    respond(
                            "200 OK",
                            new Dictionary<string, IList<string>>()
                            {
                                { "Content-Type",  new string[] { "text/html" } }
                            },
                            new object[] { Encoding.ASCII.GetBytes("Hello world.") }
                        );
                });

            Console.WriteLine("Listening on " + server.ListenEndPoint);
            Console.WriteLine("Press enter to exit.");
            Console.ReadLine();

            pipe.Dispose();
        }
예제 #3
0
 public OwinWebServer()
 {
     _server = new DotNetServer(new IPEndPoint(IPAddress.Any,9090));
 }