https://github.com/nitroshare/gomdns
mDNS browser and provider for Go applications
https://github.com/nitroshare/gomdns
Last synced: 3 months ago
JSON representation
mDNS browser and provider for Go applications
- Host: GitHub
- URL: https://github.com/nitroshare/gomdns
- Owner: nitroshare
- License: mit
- Created: 2025-07-20T21:14:03.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-07-28T18:42:40.000Z (10 months ago)
- Last Synced: 2025-07-28T20:41:54.286Z (10 months ago)
- Size: 13.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## gomdns
[](https://github.com/nitroshare/gomdns/actions/workflows/test.yml)
[](https://coveralls.io/github/nitroshare/gomdns?branch=main)
[](https://pkg.go.dev/github.com/nitroshare/gomdns)
[](https://opensource.org/licenses/MIT)
This package aims to provide an [RFC 6762](https://datatracker.ietf.org/doc/html/rfc6762) 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](https://github.com/nitroshare/qmdnsengine).
### Browser Example
Want to find devices on the network that provide `_http._tcp`?
```golang
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()
```