-
Notifications
You must be signed in to change notification settings - Fork 223
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
localhost does not resolve #135
Comments
Good catch! It's probably this code: Instead of calling |
That means the DNS lookup would be done synchronously, right? |
hmm... that's a good point. I wonder how hyper 0.11 is doing it |
Looks like Hyper wraps a synchronous DNS call inside a future: https://github.com/hyperium/hyper/blob/master/src/client/dns.rs#L52. |
We can try looping over the |
I tried to open an async connection to a server running locally at
ws://localhost:4000
and received the following error:However, the following work:
ws://127.0.0.1:4000
. So my code connects once DNS is resolved.ws://echo.websocket.org
. So websocket DNS resolution does work in some cases.ws://localhost:4000
. So local DNS resolution works but only for synchronous connections.http://localhost:4000
with Hyper 0.11. Does Hyper 0.11 use a different Tokio primitive to resolve DNS?I'm not exactly sure what's going on. It's not a big deal - I'm manually resolving localhost to 127.0.0.1 - but I'm kind of curious.
The text was updated successfully, but these errors were encountered: