Created
March 19, 2023 08:24
-
-
Save SBajonczak/1cfffc5e97325780262cee945a5e51ca to your computer and use it in GitHub Desktop.
HTTP3 ASP.net Core example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddHttpsRedirection(options => | |
{ | |
options.HttpsPort = 443; | |
}); | |
} | |
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | |
{ | |
app.UseHttpsRedirection(); | |
app.UseRouting(); | |
app.UseEndpoints(endpoints => | |
{ | |
endpoints.MapControllers(); | |
}); | |
app.UseQuic(options => | |
{ | |
options.Listen(IPAddress.Any, 443, listenOptions => | |
{ | |
listenOptions.Protocols = HttpProtocols.Http3; | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment