Skip to content

nitroshare/gomdns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gomdns

Build Status Coverage Status Go Reference MIT License

This package aims to provide an RFC 6762 compliant mDNS package 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 start of this package.

Features

  • Browser for continuously monitoring other devices providing a service
  • Provider for exposing a local service on the network
  • Ability to easily change parameters without recreating everything
  • Comprehensive test suite to ensure compliance

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages