Skip to content
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

Kestrel - Binding to localhost now binds to IPv4 and IPv6 loopback interfaces #185

Open
cesarblum opened this issue May 26, 2016 · 0 comments

Comments

@cesarblum
Copy link

cesarblum commented May 26, 2016

Configuring Kestrel to bind to localhost used to only bind to the IPv4 loopback interface. This caused confusion among users, especially those putting Kestrel behind reverse proxies that would see failures or delays because the proxies where trying to establish an IPv6 connection to Kestrel on localhost.

After change aspnet/KestrelHttpServer@a3d0bd0 when localhost is specified in the list of URLs for Kestrel to use, Kestrel will attempt to bind to both loopback interfaces. If one of them is not available due to any reason other than the address being in use by another service (e.g. IPv6 not enabled/supported), Kestrel logs a warning. However, if the requested port is in use by another service on either loopback interface, Kestrel will fail to start.

Binding to localhost:0 is not possible anymore after this change. To bind to dynamic ports on both loopback interfaces, you must explicitly bind to 127.0.0.1:0 and [::1]:0.

Discuss at aspnet/KestrelHttpServer#881.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant