https://github.com/swift-libp2p/swift-libp2p-mplex
A LibP2P Stream Multiplexer Protocol
https://github.com/swift-libp2p/swift-libp2p-mplex
libp2p libp2p-muxer mplex multiplexer swift
Last synced: 4 months ago
JSON representation
A LibP2P Stream Multiplexer Protocol
- Host: GitHub
- URL: https://github.com/swift-libp2p/swift-libp2p-mplex
- Owner: swift-libp2p
- License: mit
- Created: 2022-05-02T06:29:31.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-11-15T03:50:35.000Z (7 months ago)
- Last Synced: 2025-11-15T05:29:55.129Z (7 months ago)
- Topics: libp2p, libp2p-muxer, mplex, multiplexer, swift
- Language: Swift
- Homepage:
- Size: 212 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# LibP2PMPLEX
[](https://breth.app)
[](http://libp2p.io/)
[](https://github.com/apple/swift-package-manager)

> A LibP2P Stream Multiplexer protocol
## Table of Contents
- [Overview](#overview)
- [Install](#install)
- [Usage](#usage)
- [Example](#example)
- [API](#api)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)
## Overview
Mplex is a Stream Multiplexer protocol. The origins of this protocol are based in multiplex, the JavaScript-only Stream Multiplexer.
Mplex is a very simple protocol that does not provide many features offered by other stream multiplexers. Notably, mplex does not provide backpressure at the protocol level.
#### Note:
- For more information check out the [MPLEX Spec](https://github.com/libp2p/specs/blob/master/mplex/README.md)
## Install
Include the following dependency in your Package.swift file
``` swift
let package = Package(
...
dependencies: [
...
.package(url: "https://github.com/swift-libp2p/swift-libp2p-mplex.git", .upToNextMinor(from: "0.2.0"))
],
...
.target(
...
dependencies: [
...
.product(name: "LibP2PMPLEX", package: "swift-libp2p-mplex"),
]),
...
)
```
## Usage
### Example
``` swift
import LibP2PMPLEX
/// Tell libp2p that it can use mplex...
app.muxers.use( .mplex )
```
### API
``` swift
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...
- [Swift NIO HTTP/2](https://github.com/apple/swift-nio-http2.git)
- [MPLEX Spec](https://github.com/libp2p/specs/blob/master/mplex/README.md)
## License
[MIT](LICENSE) © 2022 Breth Inc.