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

Support for IP addresses #7

Closed
sebastianhaberey opened this issue Jan 19, 2022 · 3 comments
Closed

Support for IP addresses #7

sebastianhaberey opened this issue Jan 19, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@sebastianhaberey
Copy link
Owner

sebastianhaberey commented Jan 19, 2022

This seems to be a common request, so I'm adding this issue for discussion. I'm still unsure if IP addresses should be part of this API, or if they are out of scope. My understanding is that connecting to a resolved service can and should be done using the host name / port combination. Apple representative "Eskimo" writes on their developer forum:

When you’re done with the resolve operation don’t build the URL with IP addresses based on the addresses property. Rather, build a URL with a DNS name based on the hostName property. This is easier and it’ll work better in various edge cases.

So I'd like to hold out implementing this feature until I'm more certain about its use cases. Feel free to comment here.

@sebastianhaberey sebastianhaberey added the enhancement New feature or request label Jan 19, 2022
@sebastianhaberey sebastianhaberey changed the title Add I Support for IP addresses Jan 19, 2022
@guyluz11
Copy link

guyluz11 commented Jan 20, 2022

If you are searching for use case examples we are here.
vernet is Network Analyzer and Monitoring Tool.

It currently shows the users all devices IPs on the local network.
We can use one of two options in order to show the user device mDNS name with his IP.

  1. Get mDNS name (if exist) of specific IP, as we already have all the devices IP in the local network.
  2. Get a list of all the mDNS in the local network compare it to our list by IP and add the name for it.

You can see an example for the result in a close source app named Network Scanner

Without IP there is no way for us to associate an mDNS name to our existing IP list and show the user the full information about each IP.

@sebastianhaberey
Copy link
Owner Author

Since this feature seems somewhat popular, I will have a look at adding an option to look up IPs.

sebastianhaberey added a commit that referenced this issue Jan 23, 2022
- added addresses property to Service
- added option "ipLookupType" to configure ip lookup
- added integration test for ip lookup
- added some test helper functions
@sebastianhaberey
Copy link
Owner Author

The latest version (1.3.0) now has an ipLookupType flag:

final discovery = await startDiscovery(serviceType, ipLookupType: IpLookupType.any);

This will populate the new attribute service.addresses with the addresses of the service host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants