Skip to content

swift-libp2p/swift-libp2p-yamux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.0.1"))
    ],
        ...
        .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 gnarly fork of the beautiful http2 code by the swift nio team below...

License

MIT © 2025 Breth Inc.

About

A stream multiplexer protocol for swift-libp2p

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published