{"id":13413620,"url":"https://github.com/hashicorp/mdns","last_synced_at":"2025-05-10T05:06:15.687Z","repository":{"id":13662486,"uuid":"16356100","full_name":"hashicorp/mdns","owner":"hashicorp","description":"Simple mDNS client/server library in Golang","archived":false,"fork":false,"pushed_at":"2025-02-24T13:04:42.000Z","size":83,"stargazers_count":1252,"open_issues_count":41,"forks_count":218,"subscribers_count":265,"default_branch":"main","last_synced_at":"2025-05-08T20:57:45.984Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/hashicorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-01-29T19:39:18.000Z","updated_at":"2025-05-06T12:45:42.000Z","dependencies_parsed_at":"2023-07-13T15:27:21.263Z","dependency_job_id":"ced1630b-a22f-4310-87ac-de97ce0c55d3","html_url":"https://github.com/hashicorp/mdns","commit_stats":{"total_commits":66,"total_committers":19,"mean_commits":3.473684210526316,"dds":0.7121212121212122,"last_synced_commit":"3550404c033bcc6270aed2c6406890fec073c2f1"},"previous_names":["armon/mdns"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fmdns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fmdns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fmdns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fmdns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashicorp","download_url":"https://codeload.github.com/hashicorp/mdns/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253157470,"owners_count":21863127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-07-30T20:01:44.713Z","updated_at":"2025-05-08T22:30:19.229Z","avatar_url":"https://github.com/hashicorp.png","language":"Go","readme":"# mdns\n[![Build Status](https://github.com/hashicorp/mdns/workflows/ci/badge.svg)](https://github.com/hashicorp/mdns/actions)\n\nSimple mDNS client/server library in Golang. mDNS or Multicast DNS can be\nused to discover services on the local network without the use of an authoritative\nDNS server. This enables peer-to-peer discovery. It is important to note that many\nnetworks restrict the use of multicasting, which prevents mDNS from functioning.\nNotably, multicast cannot be used in any sort of cloud, or shared infrastructure\nenvironment. However it works well in most office, home, or private infrastructure\nenvironments.\n\nUsing the library is very simple, here is an example of publishing a service entry:\n```go\n// Setup our service export\nhost, _ := os.Hostname()\ninfo := []string{\"My awesome service\"}\nservice, _ := mdns.NewMDNSService(host, \"_foobar._tcp\", \"\", \"\", 8000, nil, info)\n\n// Create the mDNS server, defer shutdown\nserver, _ := mdns.NewServer(\u0026mdns.Config{Zone: service})\ndefer server.Shutdown()\n```\n\nDoing a lookup for service providers is also very simple:\n```go\n// Make a channel for results and start listening\nentriesCh := make(chan *mdns.ServiceEntry, 4)\ngo func() {\n    for entry := range entriesCh {\n        fmt.Printf(\"Got new entry: %v\\n\", entry)\n    }\n}()\n\n// Start the lookup\nmdns.Lookup(\"_foobar._tcp\", entriesCh)\nclose(entriesCh)\n```\n","funding_links":[],"categories":["Networking","网络相关库","Go","网络","Device Discovery","網絡","Relational Databases","\u003cspan id=\"网络-networking\"\u003e网络 Networking\u003c/span\u003e"],"sub_categories":["Strings","暂未分类","Transliteration","Uncategorized","音译","Advanced Console UIs","交流","mDNS / Bonjour","高級控制台界面","暂未分类这些库被放在这里是因为其他类别似乎都不适合。","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高级控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fmdns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashicorp%2Fmdns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fmdns/lists"}