Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the ASP.NET Core server?

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "ASP.NET Core Server is what", the explanation content in the article is simple and clear, easy to learn and understand, please follow the idea of Xiaobian slowly in-depth, together to study and learn "ASP.NET Core Server is what"!

ASP.NET Core applications run through an in-process HTTP server instance that listens for HTTP requests and exposes them to our application as a set of request capabilities that make up the HttpContext.

ASP.NET Core is implemented on two servers:

Kestrel is a cross-platform HTTP server based on libuv, a cross-platform asynchronous I/O library

WebListener is a "Windows only"HTTP server based on the HTTP.SYS kernel driver

Kestrel

Kestrel is the default web server included in ASP.NET Core new project templates. If your app only receives requests from the internal network, you can use Kestrel itself.

If you deploy your application on the public network, we recommend using IIS, Nginx or Apache as a reverse proxy server. A reverse proxy server receives HTTP requests from the network and passes them on to the Kestrel server after some preliminary processing. The process is shown below.

One of the most important reasons for using reverse proxies for edge deployments (how traffic is deployed from exposure to the public network) is security. Because Kestrel is relatively new, it does not yet have a complete feature complement to defend against security attacks. Security handling includes, but is not limited to, appropriate timeouts, size limits, and concurrent connection limits. For more information on when to use Kestrel vs. reverse proxies, see Kestrel.

IIS with Kestrel

When you use IIS or IIS Express as a reverse proxy for ASP.NET Core, ASP.NET Core applications run in a process separate from the IIS worker process. Within the IIS process, there is a special IIS module that is used to coordinate reverse proxy relationships. It is the ASP.NET Core module. The main functions of the ASP.NET Core module include launching ASP.NET Core applications, handling restarts when applications crash, and delivering HTTP traffic to applications. For more information, see ASP.NET Core Module.

Nginx with Kestrel

For more information on how to use Nginx as a reverse proxy server for Kestrel in Linux, see Publish to a Linux Production Environment.

Apache with Kestrel

For more information on how to use Apache as a reverse proxy server for Kestrel on Linux, see Using Apache Web Server as a reverse proxy.

Jexus with Kestrel

For more information on how to use Jexus as a forwarding server for Kestrel in Linux, please refer to Jexus 5.8.2 Official Release Provides Platform Support for Asp.Net Core Going into Production

WebListener

If you are running your ASP.NET Core application on Windows, you may encounter a scenario where you want to deploy your application on the public network but cannot use IIS, and WebListener is an alternative.

WebListeners can be used instead of Kestrel when you want to deploy your application only on your intranet, especially if you need something that the WebListener server supports that Kestrel doesn't.

For internal networking scenarios, we generally recommend Kestrel servers for best performance, but in other scenarios you may want to use a feature that is only supported by WebListeners. For more information about WebListener functionality, see WebListener.

ASP.NET Core Server Foundation Component Description

IApplicationBuilder's Configure method in the Startup class exposes the ServerFeatures property of the IFeature Collection class. Both Kestrel and WebListener servers provide only a single feature, the IServer Addresses Feature, but different server implementations may show additional features.

The IServerAddresses Feature can be used to find out which server instance ports are bound at runtime.

ServerFeatures comments "Gets the set of HTTP features the application's server providers."

custom server

You can create custom server implementations to replace Kestrel or WebListeners. The Open Web Interface for. NET (OWIN) guide explains how to implement a Nowin-based IServer. You are free to implement the functional interfaces your application needs, but at least you must support the IHttpRequestFeature and IHttpRequestFeature interfaces.

Thank you for reading, the above is "ASP.NET Core Server is what" content, after the study of this article, I believe that we have a deeper understanding of what ASP.NET Core Server is, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 233

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report