-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
HTTP3area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Description
Toy repro: launch server, launch client, wait ~20 seconds
Server
using Microsoft.AspNetCore.Server.Kestrel.Core;
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.ConfigureKestrel(options =>
{
options.ListenLocalhost(5001, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http3;
listenOptions.UseHttps();
});
options.Limits.KeepAliveTimeout = TimeSpan.FromSeconds(5);
});
var app = builder.Build();
app.MapGet("/", () => "Hello, world!");
app.Run();
Client
using var client = new HttpClient()
{
BaseAddress = new Uri("https://localhost:5001"),
DefaultRequestVersion = new Version(3, 0),
DefaultVersionPolicy = HttpVersionPolicy.RequestVersionExact,
};
try
{
var response = await client.GetAsync("/");
response.EnsureSuccessStatusCode();
var data = await response.Content.ReadAsStringAsync();
Console.WriteLine(data);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Request error: {e.Message}");
}
Originally posted by @amcasey in #45105 (comment)
Metadata
Metadata
Assignees
Labels
HTTP3area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions