{"id":37470298,"url":"https://github.com/kitten/dnssd-advertise","last_synced_at":"2026-04-02T11:14:43.189Z","repository":{"id":332374892,"uuid":"1133280985","full_name":"kitten/dnssd-advertise","owner":"kitten","description":"A well-behaved Bonjour/DNS-SD service advertiser for Node.js, designed for long-running processes","archived":false,"fork":false,"pushed_at":"2026-01-14T14:37:44.000Z","size":124,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-18T00:41:37.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/dnssd-advertise","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kitten.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-13T06:08:41.000Z","updated_at":"2026-01-16T17:21:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kitten/dnssd-advertise","commit_stats":null,"previous_names":["kitten/dnssd-advertise"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/kitten/dnssd-advertise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fdnssd-advertise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fdnssd-advertise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fdnssd-advertise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fdnssd-advertise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitten","download_url":"https://codeload.github.com/kitten/dnssd-advertise/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fdnssd-advertise/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28648496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T07:15:12.846Z","updated_at":"2026-01-22T01:08:45.985Z","avatar_url":"https://github.com/kitten.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dnssd-advertise\n\nA well-behaved Bonjour/DNS-SD service advertiser for Node.js, designed for long-running processes.\n\n- Aims to be compliant with [RFC 6762](https://datatracker.ietf.org/doc/html/rfc6762) and [RFC 6763](https://datatracker.ietf.org/doc/html/rfc6763#section-6)\n- Handles network interface changes, socket recovery, and re-announcements for long-running processes\n- Supports dual-stack IPv4 and IPv6 service announcement with NIC-scoped responses\n- Single dependency ([dns-message](https://github.com/kitten/dns-message) is bundled)\n\n## Quick Reference\n\n```javascript\nimport { advertise } from 'dnssd-advertise';\n\nconst stop = advertise({\n  name: 'My Service',\n  type: 'http',\n  protocol: 'tcp',\n  port: 3000,\n});\n\nprocess.on('exit', () =\u003e {\n  stop();\n});\n```\n\n### Conflict Resolution\n\nWhen a conflict is detected during probing, as per the specification, the name or hostname of your service may be altered:\n\n- When the `name` conflicts a 4-character hex ID is appended (e.g. `My Service (B0A1)`\n- When the `hostname` conflicts a number is appended to it (e.g. `my-hostname-2`)\n\nWhen a conflict is detected during announcing, the probing phase restarts with the same conflict resolution.\n\n## API Reference\n\n### `advertise(options): () =\u003e Promise\u003cvoid\u003e`\n\nStarts advertising a DNS-SD service on all available network interfaces.\n\nReturns a function that, when called, stops advertising and sends goodbye packets to remove the service from the network.\nStopping the advertiser is, while preferred, optional as per the mDNS specification.\n\n#### Options\n\n| Option     | Type                       | Description                                                        |\n| ---------- | -------------------------- | ------------------------------------------------------------------ |\n| `name`     | `string`                   | Instance/display name of the service (e.g., \"Living Room Speaker\") |\n| `type`     | `string`                   | Service type without protocol (e.g., \"http\", \"ssh\", \"airplay\")     |\n| `protocol` | `'tcp' \\| 'udp'`           | Protocol used by the service                                       |\n| `port`     | `number`                   | Port the service is listening on                                   |\n| `hostname` | `string`                   | Hostname to advertise (defaults to system hostname)                |\n| `subtypes` | `string[]`                 | Optional list of subtypes                                          |\n| `txt`      | `Record\u003cstring, TxtValue\u003e` | Optional service metadata as key-value pairs                       |\n| `ttl`      | `number`                   | TTL for DNS records in seconds (defaults to 250s)                  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitten%2Fdnssd-advertise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitten%2Fdnssd-advertise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitten%2Fdnssd-advertise/lists"}