Using HTTP3 in Asp.net core

Sascha Peter Bajonczak
3 min readMar 19, 2023
Photo by Campaign Creators on Unsplash

HTTP/3 is the latest iteration of the Hypertext Transfer Protocol (HTTP) protocol that powers the World Wide Web. This new version of HTTP, also known as “QUIC” (Quick UDP Internet Connections), brings many improvements over its predecessor, HTTP/2. In this article, we’ll explore what HTTP/3 is and how it can be used with ASP.NET Core. We’ll also discuss some of the pros and cons of using HTTP/3.

What is HTTP3?

HTTP/3 is the third major version of the HTTP protocol, and it is designed to address some of the limitations of previous versions. The most significant change in HTTP/3 is the use of a new transport protocol called QUIC. Unlike TCP, which is used in HTTP/1 and HTTP/2, QUIC is designed to run over the User Datagram Protocol (UDP). This allows for faster and more reliable connections, especially in situations where network conditions are less than ideal.

HTTP/3 also includes other changes, such ,as the elimination of header compression and the use of a new congestion control mechanism. These changes are intended to reduce latency and improve the overall performance of web applications.

How to use HTTP/3 with ASP.NET Core

To use HTTP/3 with ASP.NET Core, you’ll need to use a server that supports HTTP/3, such as Kestrel. For this you must only modify the startup.cs according to this example.

This code sets up Kestrel to listen for HTTP/3 connections on port 443. It also configures the HTTPS redirection middleware to use port 443 as well. Easy eh?

How to make a HTTP3 call in the Client

On the client, you must also adjust your code. Here’s an example:

--

--