{"id":13872044,"url":"https://github.com/Bouke/NetService","last_synced_at":"2025-07-16T01:32:41.734Z","repository":{"id":56018503,"uuid":"68636620","full_name":"Bouke/NetService","owner":"Bouke","description":"Swift NetService (Bonjour / Zeroconf / mDNS) implementation for Linux","archived":false,"fork":false,"pushed_at":"2020-11-30T23:13:31.000Z","size":226,"stargazers_count":118,"open_issues_count":8,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-18T16:57:53.030Z","etag":null,"topics":["bonjour","mdns","rfc-6762","swift","zeroconf"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/Bouke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-19T19:00:34.000Z","updated_at":"2024-06-02T17:06:27.000Z","dependencies_parsed_at":"2022-08-15T11:31:14.461Z","dependency_job_id":null,"html_url":"https://github.com/Bouke/NetService","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bouke%2FNetService","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bouke%2FNetService/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bouke%2FNetService/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bouke%2FNetService/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bouke","download_url":"https://codeload.github.com/Bouke/NetService/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226090030,"owners_count":17572114,"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":["bonjour","mdns","rfc-6762","swift","zeroconf"],"created_at":"2024-08-05T23:00:32.799Z","updated_at":"2024-11-23T19:31:33.954Z","avatar_url":"https://github.com/Bouke.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Swift NetService (Bonjour / Zeroconf / mDNS) implementation for Linux\n\n[![Build Status](https://travis-ci.org/Bouke/NetService.svg?branch=master)](https://travis-ci.org/Bouke/NetService)\n\nThis module allows you to publish your own Bonjour service on the local network. On macOS NetService is included with Cocoa, however on Linux there's no such thing in the standard library.\n\nSince version 0.5 this library uses dns_sd as the responder, instead of implementing mDNS itself. On macOS this means that it uses the system-wide daemon, and on Linux one should install `libavahi-compat-libdnssd-dev` to run the system-wide daemon.\n\n## Usage\n\nSee also [NetService-Example](https://github.com/Bouke/NetService-Example). Note that like Apple's NetService, you need to run a RunLoop in order for the callbacks to happen.\n\nThere's also a command line tool included called `dns-sd`, with a subset of the functionality provided by Apple's tool with the same name. You can use this tool to verify the implementation and debug your network when advertisements are not working. Run `swift run dns-sd --help` for usage instructions.\n\n### Publish a NetService\n\nThis code will publish a new NetService advertising port 8000. Note that you need to setup a listening socket on port 8000 yourself.\n\n```swift\nimport Foundation\nimport NetService\n\nlet service = NetService(domain: \"local.\", type: \"_hap._tcp.\", name: \"Zithoek\", port: 8000)\nservice.delegate = ...\nservice.publish()\nwithExtendedLifetime((service, delegate)) {\n    RunLoop.main.run()\n}\n```\n\n### Browsing for NetServices\n\nThis code will start a search for the given service type.\n\n```swift\nlet browser = NetServiceBrowser()\nbrowser.delegate = ...\nbrowser.searchForServices(ofType: \"_airplay._tcp.\", inDomain: \"local.\")\nwithExtendedLifetime((browser, delegate)) {\n    RunLoop.main.run()\n}\n```\n\n## Credits\n\nThis library was written by [Bouke Haarsma](https://boukehaarsma.nl).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBouke%2FNetService","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBouke%2FNetService","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBouke%2FNetService/lists"}