-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add mDNS support for MQTT server #4769
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
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
.replace()limited to the end of strings? Otherwise it would strip in the middle of DNS names too which is probably not wanted.In general, I'd recommend explicitly checking for
.localat the end, and only if present resolve via mDNS (stripping the domain if it isn't done by the mDNS component anyway). It seems the above code just checks for the presence of dots, which is imho not correct. Plain hostnames (without dots) are typically expected to be resolved via DNS (using the search domain).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the impl from this PR would fail for those who use dots in their mDNS name. Yes, some people do this and I understand this is bending the mDNS spec a bit, but it would be nice to support these cases anyway.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more comment about
.replace(): is it case-insensitive? Both DNS and mDNS names/domains are case-insensitive.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are welcome to add on to this at a later time. For now just test if it fulfills your needs with .local domain.
You have to understand that I'm doing that in my spare time and I have no need for this feature and limited resources in ESP may need a few compromises.
FYI resolving mDNS host only requires hostname, no domain. Domain is only there to determine if regular DNS is needed or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, and thanks for your time investment. I was just reviewing this PR as you asked me to do.