Skip to content

Instantly share code, notes, and snippets.

@SBajonczak
Created March 19, 2023 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SBajonczak/1cfffc5e97325780262cee945a5e51ca to your computer and use it in GitHub Desktop.
Save SBajonczak/1cfffc5e97325780262cee945a5e51ca to your computer and use it in GitHub Desktop.
HTTP3 ASP.net Core example
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