Skip to content

How to register a subtype? #109

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

Open
cmcqueen opened this issue Jul 7, 2017 · 4 comments
Open

How to register a subtype? #109

cmcqueen opened this issue Jul 7, 2017 · 4 comments

Comments

@cmcqueen
Copy link

cmcqueen commented Jul 7, 2017

How can a service be registered with a subtype? E.g., with the example registration.py, how would it be modified to register _somethingspecial._sub._http._tcp instead of (or as well as) plain _http._tcp?

@NullYing
Copy link

NullYing commented Jun 8, 2020

use https://github.com/grandcat/zeroconf

@cmcqueen
Copy link
Author

cmcqueen commented Jun 8, 2020

A Go library is a poor recommendation to substitute for a Python package.

@NullYing
Copy link

All Python package that I found can't register a subtype

@khan-git
Copy link

khan-git commented Sep 11, 2020

Simply add it to the service type string.

   info = ServiceInfo(
        "_somethingspecial._sub._http._tcp.local.",
        "Paul's Test Web Site._http._tcp.local.",
        addresses=[socket.inet_aton("127.0.0.1")],
        port=80,
        properties=desc,
        server="ash-2.local.",
    )

But my experience is that there is something no quite correct with the sub type handling.
Using avahi-browse -r _http._tcp to filter out the type wont show the above service when using python-zeroconf.
Using avahi-publish-service --subtype=_somethingspecial._sub._http._tcp basse _zmp._tcp 8080 will show just fine.

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

3 participants