Hristo Kolev
Hristo Kolev

Reputation: 1574

Using Kestrel without ASP.NET core

I want to use Kestrel HTTP Server to do HTTP things unrelated to the ASP.NET abstraction. I don't want to install any of the ASP.NET packages just Kestrel and use Request/Response model to write a fast/performant HTTP application.

In the old days this was done with HttpListener, but since everything now runs on Linux I can't use HTTP.sys.

Every Kestrel example shows how to use it with ASP.NET Core using the WebHost thingy.

I just want to run a console application that opens a port and gives me HTTP requests.

I'm almost 100% sure that this is possible. How I'm I supposed to do it?

Upvotes: 16

Views: 2757

Answers (1)

Morteza Zabihi
Morteza Zabihi

Reputation: 3054

Kestrel has many dependencies to Asp.Net packages in both Transport and Http layer. even if you want to use just Kestrel.Transport and implement your own HttpServer, you need the packages like Microsoft.AspNetCore.Hosting in Kestrel.Transport.Abstraction and Kestrel.Transport.Socket libraries. So if you want to remove these dependencies, you need a full customize on all Kestrel class libraries.

Upvotes: 5

Related Questions