All Projects → grandcat → Zeroconf

grandcat / Zeroconf

Licence: other
mDNS / DNS-SD Service Discovery in pure Go (also known as Bonjour)

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Zeroconf

Ciao
RFC 6762 and RFC 6763 compliant mdns service discovery library written in Typescript
Stars: ✭ 33 (-92.47%)
Mutual labels:  zero-configuration, service-discovery
Plibsys
Highly portable C system library: threads and synchronization primitives, sockets (TCP, UDP, SCTP), IPv4 and IPv6, IPC, hash functions (MD5, SHA-1, SHA-2, SHA-3, GOST), binary trees (RB, AVL) and more. Native code performance.
Stars: ✭ 402 (-8.22%)
Mutual labels:  ipv6
Admiral
Admiral provides automatic configuration generation, syncing and service discovery for multicluster Istio service mesh
Stars: ✭ 323 (-26.26%)
Mutual labels:  service-discovery
Ipt Netflow
Netflow iptables module for Linux kernel (official)
Stars: ✭ 357 (-18.49%)
Mutual labels:  ipv6
Nacos
an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
Stars: ✭ 20,691 (+4623.97%)
Mutual labels:  service-discovery
Dsnet
Simple command to manage a centralised wireguard VPN. Think wg-quick but quicker: key generation + address allocation.
Stars: ✭ 365 (-16.67%)
Mutual labels:  ipv6
Ansible Consul
📡 Ansible role for Hashicorp Consul clusters
Stars: ✭ 320 (-26.94%)
Mutual labels:  service-discovery
Ipwhois
Retrieve and parse whois data for IPv4 and IPv6 addresses
Stars: ✭ 432 (-1.37%)
Mutual labels:  ipv6
Microservices Recipes A Free Gitbook
“If you are working in an organization that places lots of restrictions on how developers can do their work, then microservices may not be for you.” ― Sam Newman
Stars: ✭ 393 (-10.27%)
Mutual labels:  service-discovery
Static React
Zero-configuration CLI React static renderer
Stars: ✭ 358 (-18.26%)
Mutual labels:  zero-configuration
Ip Address
💻 a library for parsing and manipulating IPv4 and IPv6 addresses in JavaScript
Stars: ✭ 353 (-19.41%)
Mutual labels:  ipv6
Spring Cloud Alibaba
Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
Stars: ✭ 20,934 (+4679.45%)
Mutual labels:  service-discovery
Linkerd Examples
Examples of how to configure and run linkerd
Stars: ✭ 370 (-15.53%)
Mutual labels:  service-discovery
Vue Simple Suggest
Feature-rich autocomplete component for Vue.js
Stars: ✭ 324 (-26.03%)
Mutual labels:  zero-configuration
Beehive
🐝 BeeHive is a solution for iOS Application module programs, it absorbed the Spring Framework API service concept to avoid coupling between modules.
Stars: ✭ 4,117 (+839.95%)
Mutual labels:  service-discovery
6lbr
A deployment-ready 6LoWPAN Border Router solution based on Contiki
Stars: ✭ 324 (-26.03%)
Mutual labels:  ipv6
Cloudflare Ddns
🎉🌩️ Dynamic DNS (DDNS) service based on Cloudflare! Access your home network remotely via a custom domain name without a static IP!
Stars: ✭ 332 (-24.2%)
Mutual labels:  ipv6
Mirrorbits
Mirrorbits is a geographical download redirector written in Go for distributing files efficiently across a set of mirrors.
Stars: ✭ 365 (-16.67%)
Mutual labels:  ipv6
Onekey caddy php7 sqlite3
小内存 VPS 一键搭建 Caddy+PHP7+Sqlite3 环境 (支持VPS最小内存64M),一键翻墙 caddy+web(php+sqlite3)+v2ray+bbr。
Stars: ✭ 435 (-0.68%)
Mutual labels:  ipv6
Noderize
Create a Node app in less than 30 seconds.
Stars: ✭ 432 (-1.37%)
Mutual labels:  zero-configuration

ZeroConf: Service Discovery with mDNS

ZeroConf is a pure Golang library that employs Multicast DNS-SD for

  • browsing and resolving services in your network
  • registering own services

in the local network.

It basically implements aspects of the standards RFC 6762 (mDNS) and RFC 6763 (DNS-SD). Though it does not support all requirements yet, the aim is to provide a compliant solution in the long-term with the community.

By now, it should be compatible to Avahi (tested) and Apple's Bonjour (untested). Target environments: private LAN/Wifi, small or isolated networks.

GoDoc Go Report Card Build Status

Install

Nothing is as easy as that:

$ go get -u github.com/grandcat/zeroconf

This package requires Go 1.7 (context in std lib) or later.

Browse for services in your local network

// Discover all services on the network (e.g. _workstation._tcp)
resolver, err := zeroconf.NewResolver(nil)
if err != nil {
    log.Fatalln("Failed to initialize resolver:", err.Error())
}

entries := make(chan *zeroconf.ServiceEntry)
go func(results <-chan *zeroconf.ServiceEntry) {
    for entry := range results {
        log.Println(entry)
    }
    log.Println("No more entries.")
}(entries)

ctx, cancel := context.WithTimeout(context.Background(), time.Second*15)
defer cancel()
err = resolver.Browse(ctx, "_workstation._tcp", "local.", entries)
if err != nil {
    log.Fatalln("Failed to browse:", err.Error())
}

<-ctx.Done()

A subtype may added to service name to narrow the set of results. E.g. to browse _workstation._tcp with subtype _windows, use_workstation._tcp,_windows.

See https://github.com/grandcat/zeroconf/blob/master/examples/resolv/client.go.

Lookup a specific service instance

// Example filled soon.

Register a service

server, err := zeroconf.Register("GoZeroconf", "_workstation._tcp", "local.", 42424, []string{"txtv=0", "lo=1", "la=2"}, nil)
if err != nil {
    panic(err)
}
defer server.Shutdown()

// Clean exit.
sig := make(chan os.Signal, 1)
signal.Notify(sig, os.Interrupt, syscall.SIGTERM)
select {
case <-sig:
    // Exit by user
case <-time.After(time.Second * 120):
    // Exit by timeout
}

log.Println("Shutting down.")

Multiple subtypes may be added to service name, separated by commas. E.g _workstation._tcp,_windows has subtype _windows.

See https://github.com/grandcat/zeroconf/blob/master/examples/register/server.go.

Features and ToDo's

This list gives a quick impression about the state of this library. See what needs to be done and submit a pull request :)

  • [x] Browse / Lookup / Register services
  • [x] Multiple IPv6 / IPv4 addresses support
  • [x] Send multiple probes (exp. back-off) if no service answers (*)
  • [ ] Timestamp entries for TTL checks
  • [ ] Compare new multicasts with already received services

Notes:

(*) The denoted features might not be perfectly standards compliant, but shouldn't cause any problems. Some tests showed improvements in overall robustness and performance with the features enabled.

Credits

Great thanks to hashicorp and to oleksandr and all contributing authors for the code this projects bases upon. Large parts of the code are still the same.

However, there are several reasons why I decided to create a fork of the original project: The previous project seems to be unmaintained. There are several useful pull requests waiting. I merged most of them in this project. Still, the implementation has some bugs and lacks some other features that make it quite unreliable in real LAN environments when running continously. Last but not least, the aim for this project is to build a solution that targets standard conformance in the long term with the support of the community. Though, resiliency should remain a top goal.

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