All Projects → Bouke → NetService

Bouke / NetService

Licence: MIT license
Swift NetService (Bonjour / Zeroconf / mDNS) implementation for Linux

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to NetService

Ciao
Publish and discover services using Bonjour
Stars: ✭ 50 (-51.46%)
Mutual labels:  zeroconf, bonjour, mdns
Francis
Bonjour browser for macOS and iOS
Stars: ✭ 25 (-75.73%)
Mutual labels:  bonjour, mdns
airprint-proxy
Advertise AirPrint printers for network printers located outside the subnet using node. GPL-3.0 licensed.
Stars: ✭ 23 (-77.67%)
Mutual labels:  bonjour, mdns
docker-mdns
Simple mDNS/ZeroConf demonstration of a nginx container, acessible at http://nginx.local
Stars: ✭ 25 (-75.73%)
Mutual labels:  zeroconf, mdns
iOS-AirPrint-for-Mac
enable iOS Airprint Sharing on Mac OS
Stars: ✭ 24 (-76.7%)
Mutual labels:  bonjour, mdns
VCVRack-Holon.ist
Holon.ist Receiver for VCV Rack
Stars: ✭ 13 (-87.38%)
Mutual labels:  bonjour, mdns
MDNS Generic
mDNS Library for nRF52, SAMD21, SAMD51, SAM DUE, STM32F/L/H/G/WB/MP1, AVR Mega, RP2040-based boards, etc. using Ethernet W5x00. Supports mDNS (Registering Services) and DNS-SD (Service Discovery). Ethernet_Generic library is used as default for W5x00
Stars: ✭ 22 (-78.64%)
Mutual labels:  bonjour, mdns
GCXMulticastDNSKit
Multicast DNS framework for iOS
Stars: ✭ 16 (-84.47%)
Mutual labels:  zeroconf, mdns
Servus
Ad-hoc peer-to-peer iOS library
Stars: ✭ 27 (-73.79%)
Mutual labels:  zeroconf, bonjour
python-zeroconf
A pure python implementation of multicast DNS service discovery
Stars: ✭ 468 (+354.37%)
Mutual labels:  zeroconf, bonjour
Merhaba
Bonjour networking for discovery and connection between iOS, macOS and tvOS devices.
Stars: ✭ 62 (-39.81%)
Mutual labels:  bonjour
libmicrodns
Minimal mDNS resolver (and announcer) cross-platform library
Stars: ✭ 48 (-53.4%)
Mutual labels:  mdns
Servus
Zeroconf discovery in C++
Stars: ✭ 58 (-43.69%)
Mutual labels:  zeroconf
Super-Simple-RGB-WiFi-Lamp
A project based on the ESP8266 and WS2812b
Stars: ✭ 61 (-40.78%)
Mutual labels:  mdns
mdns lite
A simple, no frills mDNS implementation in Elixir
Stars: ✭ 29 (-71.84%)
Mutual labels:  mdns
playercast
Cast to media player and control playback remotely.
Stars: ✭ 46 (-55.34%)
Mutual labels:  mdns
VindicateTool
LLMNR/NBNS/mDNS Spoofing Detection Toolkit
Stars: ✭ 40 (-61.17%)
Mutual labels:  mdns
dragit
Application for intuitive file sharing between devices.
Stars: ✭ 121 (+17.48%)
Mutual labels:  mdns
RemoteDesktop
A simple remote desktop server/client application for Windows
Stars: ✭ 30 (-70.87%)
Mutual labels:  zeroconf
ZeroConf
ZeroConf plugin for Cordova/Phonegap 3.0
Stars: ✭ 39 (-62.14%)
Mutual labels:  zeroconf

Swift NetService (Bonjour / Zeroconf / mDNS) implementation for Linux

Build Status

This 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.

Since 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.

Usage

See also NetService-Example. Note that like Apple's NetService, you need to run a RunLoop in order for the callbacks to happen.

There'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.

Publish a NetService

This code will publish a new NetService advertising port 8000. Note that you need to setup a listening socket on port 8000 yourself.

import Foundation
import NetService

let service = NetService(domain: "local.", type: "_hap._tcp.", name: "Zithoek", port: 8000)
service.delegate = ...
service.publish()
withExtendedLifetime((service, delegate)) {
    RunLoop.main.run()
}

Browsing for NetServices

This code will start a search for the given service type.

let browser = NetServiceBrowser()
browser.delegate = ...
browser.searchForServices(ofType: "_airplay._tcp.", inDomain: "local.")
withExtendedLifetime((browser, delegate)) {
    RunLoop.main.run()
}

Credits

This library was written by Bouke Haarsma.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].