Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Bind to IPv6 loopback address when the "localhost" is specified #231

Closed
halter73 opened this issue Sep 28, 2015 · 11 comments
Closed

Bind to IPv6 loopback address when the "localhost" is specified #231

halter73 opened this issue Sep 28, 2015 · 11 comments
Assignees
Milestone

Comments

@halter73
Copy link
Member

Currently Kestrel only binds to the IPv4 loopback address (127.0.0.1) and not the IPv6 loopback address (::1) when localhost is specified.
#98

@halter73 halter73 added the bug label Sep 28, 2015
@halter73 halter73 self-assigned this Sep 28, 2015
@Tratcher
Copy link
Member

Also for host names and *, bind to IPv4 Any (0.0.0.0) and IPv6 Any (::)

@Tragetaschen
Copy link
Contributor

Binding to IPv6Any already binds to IPv4Any. Libuv is using dual stack sockets by default and needs an explicit bind flag to disable that.

@halter73
Copy link
Member Author

@Tragetaschen Thanks for the heads up. It appears this only applies to IPv6Any. My testing shows that binding to IPv6Loopback does not bind to IPv4Loopback. Binding to IPv4Any also doesn't appear bind to IPv6Any.

@grahamehorner
Copy link

not sure if my experience is related to this issue; but I'm unable to get kestrel to listen on the hostname when the host has multiple network interfaces; even the localhost is unable to access the web application via the hostname; however localhost shows that kestrel is listening on the loopback interface.

@esko22
Copy link

esko22 commented Nov 2, 2015

Not sure if what I am seeing is also related but since switching to beta8 I have had a new issue pop up. Granted my use case is not common but I am running a Windows 10 VM on my Mac to host / debug my api. Until switching to beta8 I was able to make calls directly against the api hosted in the VM via port forwarding with no issues.

The only way I can get this to work now is by launching Kestrel with the VM host name instead of localhost as I previously had in beta7. The odd thing is that on the Mac side I can make REST calls using either the VM host name or localhost and it resolves just fine. As soon as I try to host it on Kestrel with anything other then the VM host name the request times out with no error response.

@Tratcher
Copy link
Member

Tratcher commented Nov 2, 2015

@esko22 I think this is expected. Before beta8 kestrel would always listen publicly on Any/*, no matter what you specified. Now if you specify localhost it listens only on ::1. As far as the VM is concerned the Mac is a separate machine so you need to listen on a public IP or *, not localhost.

@esko22
Copy link

esko22 commented Nov 2, 2015

Thanks @Tratcher. Using * works great.

@muratg muratg added this to the 1.0.0-rc2 milestone Dec 21, 2015
@cesarblum
Copy link
Contributor

Is this still an issue? Is there something to be fixed?

@Tratcher
Copy link
Member

Yes, #242 (comment)

@DamianEdwards
Copy link
Member

post RC2

@cesarblum
Copy link
Contributor

I've published an announcement on this change: aspnet/Announcements#185

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

9 participants