mirror of
https://github.com/iminet/dev.git
synced 2024-05-19 07:52:35 +02:00
18 lines
390 B
C#
18 lines
390 B
C#
|
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";
|
||
|
}
|