Swiftpack.co - swift-libp2p/swift-libp2p-mdns as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by swift-libp2p.
swift-libp2p/swift-libp2p-mdns 0.0.2
An mDNS service for discovering Libp2p Peers within a Local Area Network
⭐️ 0
🕓 7 hours ago
iOS macOS
.package(url: "https://github.com/swift-libp2p/swift-libp2p-mdns.git", from: "0.0.2")

LibP2PMDNS

Swift Package Manager compatible Build & Test (macos)

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

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

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


import LibP2PMDNS

/// When you configure your app
app.discovery.use(.mdns)

API

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 critques, are welcome!

Let's make this code better together! 🤝

Credits

License

MIT © 2022 Breth Inc.

GitHub

link
Stars: 0
Last commit: 15 hours ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics