brutella / dnssd

This library implements Multicast DNS (mDNS) and DNS-Based Service Discovery (DNS-SD) for Zero Configuration Networking in Go.
MIT License
207 stars 33 forks source link

Browse example only works with full service strings #42

Open JAlexoid opened 1 year ago

JAlexoid commented 1 year ago

I tried the browse example to test out lookup of all services.

Using just _tcp yields no results. Compare that to avahi-browse _tcp wich yields a lot of results

./browse -Type _tcp
Browsing for _tcp.local.
DATE: –––Wed Mar 1 2023–––
16:08:35.855  ...STARTING...
Timestamp   A/R if Domain   Service Type    Service Name
^C

However I get results with a broader query

./browse -Type _googlecast._tcp
Browsing for _googlecast._tcp.local.
DATE: –––Wed Mar 1 2023–––
16:09:43.070  ...STARTING...
Timestamp   A/R if Domain   Service Type    Service Name
16:09:43.164    Add wlp0s20f3   local   _googlecast._tcp    Google-Nest-Mini-6147e2ff355612c5da0029f5a82002a2 ([192.168.1.26])
16:09:43.165    Add wlp0s20f3   local   _googlecast._tcp    M65Q7-H1-a4cbf4829ec90c72e9f4e42c2b2ca294 ([192.168.1.103])
^C
brutella commented 1 year ago

You are right, browsing for service type _tcp gives you no results. Comparing with dns-sd on a Mac where you also get no results because _tcp specifies the transport protocol and not the service type.

JAlexoid commented 1 year ago

Is there a way to get that result?

If no - would you accept a PR allowing "query for all" and "query on protocol only"?

brutella commented 3 weeks ago

What is your use case for this feature?