Skip to content

exmaples: add --verify option in the query example - #412

Merged
keepsimple1 merged 1 commit into
mainfrom
update-example
Dec 31, 2025
Merged

keepsimple1 merged 1 commit into
mainfrom
update-example

Conversation

@keepsimple1

Copy link
Copy Markdown
Owner

Address the comments in #54 .

Now the query example supports --verify option (doc) to show how it can be used for reconfirming service IPv4 addresses:

$ cargo run --example query   
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/examples/query`
Usage: cargo run --example query <service_type_without_domain_postfix> [--verify]
Example: 
cargo run --example query _my-service._udp

Options:
--verify: make the client attempt to verify IPv4 addresses of resolved services.

You can also do a meta-query per RFC 6763 to find which services are available:
cargo run --example query _services._dns-sd._udp

Note that unregister already exists in the register example:

$ cargo run --example register
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
     Running `target/debug/examples/register`
Usage:
cargo run --example register <service_type> <instance_name> <hostname> [options]

Options:

--unregister: automatically unregister after 2 seconds
--disable-ipv6: not to use IPv6 interfaces.
--logfile: write debug log to a file instead of stderr. The logfile is named 'mdns-register-<timestamp>.log'.

For example:
cargo run --example register _my-hello._udp instance1 host1

To see the debug log, set the RUST_LOG environment variable and write a logfile:
RUST_LOG=mdns_sd=debug cargo run --example register _my-hello._udp instance1 host1 --logfile

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

Successfully merging this pull request may close these issues.

1 participant