Skip to content

swift-libp2p/swift-libp2p-yamux

Repository files navigation

LibP2PYAMUX

Swift Package Manager compatible Build & Test (macos and linux)

A LibP2P Stream Multiplexer protocol

Table of Contents

Overview

Yamux is a Stream Multiplexer protocol.

Yamux uses a single streaming connection underneath, but imposes message framing so that it can be shared between many logical streams. These logical streams support windowing which provides a soft version of backpressure.

Note:

Install

Include the following dependency in your Package.swift file

let package = Package(
    ...
    dependencies: [
        ...
        .package(url: "https://github.com/swift-libp2p/swift-libp2p-yamux.git", .upToNextMinor(from: "0.2.0"))
    ],
        ...
        .target(
            ...
            dependencies: [
                ...
                .product(name: "LibP2PYAMUX", package: "swift-libp2p-yamux"),
            ]),
    ...
)

Usage

Example

import LibP2PYAMUX

/// Tell libp2p that it can use yamux...
app.muxers.use( .yamux )

API

Not Applicable

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

This repo is just a modified fork of the beautiful swift-nio-ssh repo...

License

MIT © 2025 Breth Inc.

About

A YAMUX (Yet Another Multiplexer) implementation for swift-libp2p

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages