Skip to content

Parse and bind to IP's configured via --server.urls #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2017
Merged

Conversation

halter73
Copy link
Member


if (string.Equals(uri.Host, "localhost", StringComparison.OrdinalIgnoreCase))
{
ip = IPAddress.Loopback;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically I think we should bind to both IPAddress.Loopback and IPAddress.IPv6Loopback, like we do at https://github.com/aspnet/KestrelHttpServer/blob/2351c1b558fc6f4312af262aa866fd2c5164761f/src/Microsoft.AspNetCore.Server.Kestrel/KestrelServer.cs#L230.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the port is also 0? Do we add logic to throw in that case like we do Kestrel? It also complicates things slightly (but not too much) to have multiple IPEndpoints per URL.

In practice IPv4 loopback always seems to work when "localhost" is specified, but I'll change it if it's important

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you have now should be sufficient to unblock most scenarios. We should revisit this after the final design though.

@halter73 halter73 merged commit 2dfdb74 into dev Jan 11, 2017
@halter73 halter73 deleted the halter73/parse-ip branch January 11, 2017 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants