dotnet / dotnet/aspnetcore

Support adding and removing Kestrel endpoints with code

Open
#21,244 8 comments 8 reactions 0 assignees View on GitHub
affected-few api-suggestion area-networking enhancement feature-kestrel feature-yarp severity-nice-to-have
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is your feature request related to a problem? Please describe.

This is a followup to #19376. Kestrel should support a programmatic API for adding and removing endpoints with code in addition to config.

For reference, here's how it looks with HttpSys:

https://github.com/dotnet/aspnetcore/blob/f6c89c2dc776060a5988f56f50c138220eaa129d/src/Servers/HttpSys/samples/HotAddSample/Startup.cs#L24-L41

### Describe the solution you'd like

We should probably have APIs similar to KestrelServerOptions.Listen* that work even after the server has started. We'll also need an API to query active endpoints and remove them. Perhaps IServerAddressesFeature could be leveraged for this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.