https://github.com/swift-libp2p/swift-libp2p-mdns
An mDNS service for discovering Libp2p Peers within a Local Area Network
https://github.com/swift-libp2p/swift-libp2p-mdns
discovery libp2p mdns
Last synced: 7 months ago
JSON representation
An mDNS service for discovering Libp2p Peers within a Local Area Network
- Host: GitHub
- URL: https://github.com/swift-libp2p/swift-libp2p-mdns
- Owner: swift-libp2p
- Created: 2022-06-22T22:36:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-02T17:08:30.000Z (7 months ago)
- Last Synced: 2025-03-02T18:21:57.957Z (7 months ago)
- Topics: discovery, libp2p, mdns
- Language: Swift
- Homepage:
- Size: 37.1 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LibP2PMDNS
[](https://breth.app)
[](http://libp2p.io/)
[](https://github.com/apple/swift-package-manager)
> An mDNS Discovery Mechanism for registering, and discovering, libp2p services, and peers, on a local area network.
### Note:
- This implementation uses the `dnssd` library on mac/ios systems.
- This implementation is not compatible with GETH / JS libp2p mdns packages.
- This implementation does not work on linux at the moment.## Table of Contents
- [Overview](#overview)
- [Install](#install)
- [Usage](#usage)
- [Example](#example)
- [API](#api)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)## Overview
mDNS helps you discover libp2p peers on a local network without pre-configuring ip addresses and port numbers.#### Heads up ‼️
- This package uses the `dnssd` library and doesn't work on Linux at the moment.## Install
Include the following dependency in your Package.swift file
```Swift
let package = Package(
...
dependencies: [
...
.package(url: "https://github.com/swift-libp2p/swift-libp2p-mdns.git", .upToNextMajor(from: "0.0.1"))
],
...
.target(
...
dependencies: [
...
.product(name: "LibP2PMDNS", package: "swift-libp2p-mdns"),
]),
...
)
```## Usage
### Example
TODO```Swift
import LibP2PMDNS
/// When you configure your app
app.discovery.use(.mdns)```
### API
```Swift
N/A
```## Contributing
Contributions are welcomed! This code is very much a proof of concept. I can guarantee you there's a better / safer way to accomplish the same results. Any suggestions, improvements, or even just critiques, are welcome!
Let's make this code better together! 🤝
## Credits
- [Bouke Haarsma](https://twitter.com/BoukeHaarsma) for the DNS library
## License
[MIT](LICENSE) © 2022 Breth Inc.