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

Resolve TODO about MacOS cannot resolve localhost #620

Merged
merged 4 commits into from
Sep 11, 2023

Conversation

PerchunPak
Copy link
Member

This bug exists deep inside MacOS, so we can't do anything better, than if statement, that will replace localhost with 127.0.0.1.

BTW, socket.getaddrinfo('localhost', 0) returns ::1 twice and 127.0.0.1 twice too.

This bug exists deep inside MacOS, so we can't do anything better, than
`if` statement, that will replace `localhost` with `127.0.0.1`.

BTW, `socket.getaddrinfo('localhost', 0)` returns `::1` twice and
`127.0.0.1` twice too.
@ItsDrike
Copy link
Member

The only concern I have here is if someone used localhost to refer to the IPv6 localhost variant. I don't think there's a huge amount of people running servers on IPv6 though, so I'm not sure how major this issue is, and if they do encounter it, we can just tell them to use ::1 instead of localhost.

@PerchunPak
Copy link
Member Author

Related: #268.

@PerchunPak
Copy link
Member Author

The only concern I have here is if someone used localhost to refer to the IPv6 localhost variant. I don't think there's a huge amount of people running servers on IPv6 though, so I'm not sure how major this issue is, and if they do encounter it, we can just tell them to use ::1 instead of localhost.

We can also raise a warning, when replacing localhost.

@ItsDrike
Copy link
Member

We can also raise a warning, when replacing localhost.

I like that idea. Should we do it regardless of the platform, or only on macos?

@PerchunPak
Copy link
Member Author

With the current implementation, we should raise a warning always, as user that wants to use IPv6 would be really confused. So we probably should replace localhost only on mac as well as raising the warning only there.

I would also be annoyed to see this warning for no real reason, especially if I don't know about performance issues with localhost.

mcstatus/address.py Outdated Show resolved Hide resolved
mcstatus/address.py Show resolved Hide resolved
Copy link
Member

@ItsDrike ItsDrike left a comment

Choose a reason for hiding this comment

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

Well, now we just hope it doesn't break anything somewhere for someone. :shipit:

@kevinkjt2000 kevinkjt2000 merged commit 16d06f1 into master Sep 11, 2023
@kevinkjt2000 kevinkjt2000 deleted the resolve-macos-localhost-todo branch September 11, 2023 20:44
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