-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
DoneThis issue has been fixedThis issue has been fixedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-kestrel
Milestone
Description
Is your feature request related to a problem? Please describe.
It's common for an application to add, remove, or reconfigure endpoints via config. That works today for Kestrel but it requires restarting the application to pick up the changes.
For reference, HttpSys supports live adding or removing endpoints in code, but not in config.
aspnetcore/src/Servers/HttpSys/samples/HotAddSample/Startup.cs
Lines 24 to 41 in f6c89c2
public HttpSysOptions ServerOptions { get; set; } | |
public void Configure(IApplicationBuilder app) | |
{ | |
var addresses = ServerOptions.UrlPrefixes; | |
addresses.Add("http://localhost:12346/pathBase/"); | |
app.Use(async (context, next) => | |
{ | |
// Note: To add any prefix other than localhost you must run this sample as an administrator. | |
var toAdd = context.Request.Query["add"]; | |
if (!string.IsNullOrEmpty(toAdd)) | |
{ | |
context.Response.ContentType = "text/html"; | |
await context.Response.WriteAsync("<html><body>"); | |
try | |
{ | |
addresses.Add(toAdd); |
Describe the solution you'd like
Have Kestrel's custom configuration binder register for config reload notifications. On config change it would need to diff the changes and update its endpoints. Removing an endpoint should also cause existing connections for that endpoint to gracefully drain and close.
Metadata
Metadata
Assignees
Labels
DoneThis issue has been fixedThis issue has been fixedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-kestrel