Create Program.cs

This commit is contained in:
Imi 2023-02-02 03:47:20 +01:00 committed by GitHub
parent ba3107d03c
commit d8360b1f53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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";
}