mirror of
https://github.com/luxfi/zap.git
synced 2026-10-30 15:04:16 +00:00
Per HIP-0069 — one service type, no transition window, no backwards compat. Non-compliant deployments fail loudly so we detect and fix them rather than papering over them. Removed: - LEGACY_SERVICE_TYPE (`_hanzo-zap._tcp.local.`) - Dual-publish (canonical + legacy) on `publish()` - Dual-browse on `browse()` - All de-dup logic that existed only because of the dual records The only Hanzo service-type is `_hanzo._tcp.local.`. Verified live with macOS dns-sd: the omniserver advertises only on canonical, and is reachable via canonical browse from sibling python and the extension's native-messaging helper.
19 lines
686 B
Rust
19 lines
686 B
Rust
//! Example: what a Rust service does on startup. Run with
|
|
//! `cargo run --example publish_kms`.
|
|
use zap_mdns::{Publisher, PublishOptions, Role};
|
|
use std::time::Duration;
|
|
|
|
fn main() -> Result<(), zap_mdns::Error> {
|
|
let _pub = Publisher::publish(PublishOptions {
|
|
role: Some(Role::Kms),
|
|
port: 8443,
|
|
version: env!("CARGO_PKG_VERSION").to_string(),
|
|
capabilities: vec!["sign".into(), "verify".into(), "encrypt".into(), "decrypt".into()],
|
|
auth: Some("iam".into()),
|
|
..Default::default()
|
|
})?;
|
|
println!("published; sleeping 60s. dns-sd -B _hanzo._tcp local. to verify.");
|
|
std::thread::sleep(Duration::from_secs(60));
|
|
Ok(())
|
|
}
|