Introduction
HTTP.sys is a Windows-based web server for ASP.NET Core. It is an alternative to Kestrel Server and it has some features that are not supported by Kestrel. It is built on HTTP.sys Kernel mode driver. It cannot be used with IIS Express or IIS due to it is incompatibility with the ASP.NET Core modules.
Following are the features supported by HTTP.sys.
- Windows Authentication
- Response caching
- WebSockets
- Direct file transmission
- Port sharing
- HTTPS with SNI (Server Name Indication)
- HTTP/2 over TLS
- It supports Windows 7 and Windows Server 2008 R2 and later
It is very useful for deployments where we need to expose the server directly to the internet without IIS. It is built on HTTP.sys so it does not require a reverse proxy server for protection against attacks. HTTP.sys provides robustness, security and scalability of web server and it is mature technology which protects against many kinds of attacks. This web server is a good choice for internal deployments when the Windows authentication kind of feature is used that is not available with the Kestrel Server.
Configure Windows Server
Following are the items required to configure this Windows server.
- Install the version of the .NET framework on which our application runs
- Required preregistered URL prefixes to bind HTTP.sys and set up SSL certificate. If we do not reregister the URL, our application needs to be run with administrator privileges. Our application can run without administrator privileges only if it binds to the localhost using HTTP with a port number greater than 1024.
- We need to open the firewall ports to allow us to reach HTTP.sys.
Configure ASP.net Core application
Following are the steps to configure the ASP.NET application for HTTP.sys.
- The package Microsoft.AspNetCore.Server.HttpSys is required for the HTTP.sys web server, so it needs to be referenced in the project. If we use Microsoft.AspNetCore.All meta packages, we need not install any other packages.
- The next step is to configure the HTTP.sys server using the UseHttpSys extension method of WebHostBuilder in the main method of the Program class. Here, we can also specify HTTP.sys options.
Program. cs
public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseHttpSys(options =>
{
options.Authentication.Schemes = AuthenticationSchemes.None;
options.Authentication.AllowAnonymous = true;
options.MaxConnections = 100;
options.MaxRequestBodySize = 30000000;
options.UrlPrefixes.Add("http://localhost:5000");
})
.Build();
}


Terry RemsikPosted Mar 16, 2020, 11:12 AM
Is there an update to at least .NET core 2.2 ? Thank you so much!
AKshay RautPosted Jan 26, 2020, 8:37 PM
This HTTP.sys is not new. In fact IIS also uses HTTP.sys to run.
Tridip BhattacharjeePosted Dec 21, 2017, 3:31 AM
Can you please tell me what is reverse proxy and what it does ? when people use reverse proxy ? when we use IIS as web server then how reverse proxy can be used with IIS ? please clear my few points. thanks