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

Some windows hosts cannot resolve hostnames returned by MDNS #19

Closed
jnstahl opened this issue Nov 25, 2021 · 4 comments
Closed

Some windows hosts cannot resolve hostnames returned by MDNS #19

jnstahl opened this issue Nov 25, 2021 · 4 comments

Comments

@jnstahl
Copy link
Contributor

jnstahl commented Nov 25, 2021

the current Windows implementation returns hostnames, such as 'Android-5.local' when provided by the MDNS query results. However some windows hosts do not have the ability to resolve such a hostname and to establish a connection (apparently this ability relies on 3rd party packages such as Bonjour being installed).

Suggested fix:

  • short-term: Windows implementation will always return an IP address string for hostname
  • long-term: the NsdServiceInfo object can be expanded to include:
    • ipv4
    • ipv6
      in addition to hostname and port
@jnstahl
Copy link
Contributor Author

jnstahl commented Nov 25, 2021

val hostname = this?.host?.canonicalHostName <==== canonicalHostName will return either IP address or hostname on the android implementation

@Nimrodda
Copy link
Owner

Nimrodda commented Nov 26, 2021

the current Windows implementation returns hostnames, such as 'Android-5.local' when provided by the MDNS query results. However some windows hosts do not have the ability to resolve such a hostname and to establish a connection (apparently this ability relies on 3rd party packages such as Bonjour being installed).

Suggested fix:

  • short-term: Windows implementation will always return an IP address string for hostname

  • long-term: the NsdServiceInfo object can be expanded to include:

    • ipv4
    • ipv6
      in addition to hostname and port

Sounds like a plan 👍

val hostname = this?.host?.canonicalHostName <==== canonicalHostName will return either IP address or hostname on the android implementation

OK. That's good to know.
How about the iOS/MacOS implementation?

@Nimrodda
Copy link
Owner

This comment is just for tracking what's done:
Short term solution introduced in PR #21

@jnstahl
Copy link
Contributor Author

jnstahl commented Nov 26, 2021

the current Windows implementation returns hostnames, such as 'Android-5.local' when provided by the MDNS query results. However some windows hosts do not have the ability to resolve such a hostname and to establish a connection (apparently this ability relies on 3rd party packages such as Bonjour being installed).
Suggested fix:

  • short-term: Windows implementation will always return an IP address string for hostname

  • long-term: the NsdServiceInfo object can be expanded to include:

    • ipv4
    • ipv6
      in addition to hostname and port

Sounds like a plan 👍

val hostname = this?.host?.canonicalHostName <==== canonicalHostName will return either IP address or hostname on the android implementation

OK. That's good to know. How about the iOS/MacOS implementation?

One would have to test. But on iOS presumably it won't matter as MDNS is native to iOS and the hostname will always be resolvable. this particular complication is specific to Windows. I found out even more - the hostname may be resolvable within the Flutter app but when opened in an external browser (Chrome) is still not resolvable. Or Flutter may resolve it to an ipv6 which cannot be loaded into chrome either. So now for the purpose of opening external browsers I force resolve it to an ipv4 inside my app before constructing the url. But that is independent from the plugin.

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

No branches or pull requests

2 participants