-
Notifications
You must be signed in to change notification settings - Fork 522
Conversation
@@ -9,6 +9,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal | |||
public enum ListenType | |||
{ | |||
IPEndPoint, | |||
Localhost, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes me super sad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the feeling. Still better than "Prefix" though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it, I think this is too big of a hack to exist. It doesn't fit the current model. This enum needs to be something else and not part of ListenType.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such as? I could drive from Listen options and type check. Or add a second enum IPMode with values LocalhostSplit, AnyIPFallback, and Single. Or derive from ListenOptions and put the bind method on that type. Hmm, that might work...
19a56db
to
fdf9229
Compare
Rebased and updated with tests, ready for review. |
src/Kestrel.Core/ListenOptions.cs
Outdated
@@ -182,5 +183,11 @@ public ConnectionDelegate Build() | |||
|
|||
return app; | |||
} | |||
|
|||
internal virtual async Task BindAsync(AddressBinder.AddressBindContext context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: unnest AddressBindContext
} | ||
|
||
private static async Task BindAddressAsync(string address, AddressBindContext context) | ||
internal static ListenOptions ParseAddress(string address, KestrelServerOptions serverOptions, IDefaultHttpsProvider defaultHttpsProvider) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pending nit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
709c1a2
to
89d1862
Compare
#2139 Still needs tests
This abstracts the address parser to work independently of the binder so it can be used for future config code. It also adds first class support for two scenarios formerly only available via UseUrls, ListenLocalhost and ListenAnyIP. Both of these provide dynamic fallback behavior that's not was not possible with a single ListenOptions before.