diff --git a/csharp/HttpListener/Program.cs b/csharp/HttpListener/Program.cs new file mode 100644 index 0000000..05e482f --- /dev/null +++ b/csharp/HttpListener/Program.cs @@ -0,0 +1,17 @@ +using System.Net; + +using var listener = new HttpListener(); +listener.Prefixes.Add("http://localhost:8001/"); + +listener.Start(); + +Console.WriteLine("Listening on port 8001..."); + +while (true) +{ + HttpListenerContext ctx = listener.GetContext(); + using HttpListenerResponse resp = ctx.Response; + + resp.StatusCode = (int) HttpStatusCode.OK; + resp.StatusDescription = "Status OK"; +}