Skip to content

Repository files navigation

gomdns

Build Status Coverage Status Go Reference MIT License

This package aims to provide an RFC 6762 compliant mDNS implementation for Go applications, with a heavy focus on simplicity. Although there are existing mDNS packages for Go, each of them lacked something we wanted, leading to the creation of this package.

Features

  • Exhaustive test suite to ensure compliance & reliability
  • Fully self-contained — no external package dependencies
  • Browser for continuously monitoring other devices providing a service
  • Provider for exposing a local service on the network
  • Released under the MIT license; completely free to use anywhere

This package is heavily based on QMdnsEngine.

Browser Example

Want to find devices on the network that provide _http._tcp?

import "github.com/nitroshare/gomdns/browser"

// Channels receive *Device when a device is added or removed
var (
    chanAdded   = make(chan *Device)
    chanRemoved = make(chan *Device)
)

// Create the browser
b, _ := browser.New(&browser.Config{
    Service:     "_http._tcp",
    ChanAdded:   chanAdded,
    ChanRemoved: chanRemoved,
})

// Read from chanAdded or chanRemoved in a separate goroutine
d := <-chanAdded
d := <-chanRemoved

// Close the browser when you are done
b.Close()

About

mDNS browser and provider for Go applications

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages