当前位置:网站首页>Introduction to Kestrel_ Introduction to kestrel web server

Introduction to Kestrel_ Introduction to kestrel web server

2022-06-13 02:55:00 Tianma 3798

Kestrel brief introduction _Kestrel Web Server profile

One 、Kestrel brief introduction

Kestrel It's a Cross platform Of applies to Kestrel.

Kestrel Is contained in ASP.NET Core In the project template Web The server , It is enabled by default .

.NET Core All supported platforms and versions support Kestrel.

More detailed configuration and use :ASP.NET Core Medium Kestrel Web Server implementation | Microsoft Docs

not used IIS In escrow ,ASP.NET Core By default, the project template uses Kestrel. stay “Program.cs” in , Method call UseKestrel:

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/", () => "Hello World!");

app.Run();

Two 、 Server configuration endpoint

var builder = WebApplication.CreateBuilder(args);

// Configure server 
builder.WebHost.UseUrls("http://localhost:8080");

// Add services to the container.
builder.Services.AddControllersWithViews();


var app = builder.Build();

For more detailed configuration reference :

by ASP.NET Core Kestrel Web Server configuration endpoint | Microsoft Docs

ASP.NET Core Web host | Microsoft Docs

By default :

Kestrel stay http://localhost:5000 and https://localhost:5001 Listen on ( If the default certificate is available ).

3、 ... and 、Kestrel And HTTP.sys

And HTTP.sys comparison ,Kestrel It has the following advantages :

  • Better performance and memory utilization .
  • Cross platform
  • flexibility , It is developed and patched independently of the operating system .
  • Programming ports and TLS To configure
  • Extensibility , allow PPv2 And other protocols and standby transmission .

Http.Sys Run as a shared kernel mode component , have kestrel The following functions are not available :

  • Port sharing
  • Kernel mode Windows Authentication . Kestrel Only user mode authentication is supported .
  • A fast agent that transmits through a queue
  • Direct file transfer
  • Response cache

more :

.Net Core Upload components _.Net Core Image upload processing component

C# common Url Examples of operation ( One )、 Regular Expression Matching URl

 C# obtain Url The domain name

原网站

版权声明
本文为[Tianma 3798]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280535329415.html