Skip to content
A multiplexed p2p network framework that supports custom protocols
Branch: master
Clone or download
Pull request Compare This branch is even with driftluo:master.
Latest commit 23ff751 Apr 19, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
bench feat: 1. Change send API 2. Define channel buffer length Apr 18, 2019
secio chore: release 0.2-alpha.2 Apr 15, 2019
src feat: 1. Change send API 2. Define channel buffer length Apr 18, 2019
yamux chore: release 0.2-alpha.2 Apr 15, 2019
.gitignore add bench for secio Jan 28, 2019
.travis.yml use our own bench test, easy to test/debug Jan 28, 2019
Makefile bump to 0.2.0-alpha.1 Mar 14, 2019
rust-toolchain chore: upgrade toolchain Apr 12, 2019
rustfmt.toml Switch to organizational development Dec 25, 2018


Build Status image


This is a minimal implementation for a multiplexed p2p network based on yamux that supports mounting custom protocols.


  1. Data stream transmission
+----+      +----------------+      +-----------+      +-------------+      +----------+      +------+
|user| <--> | custom streams | <--> |Yamux frame| <--> |Secure stream| <--> |TCP stream| <--> |remote|
+----+      +----------------+      +-----------+      +-------------+      +----------+      +------+
  1. Code implementation

All data is passed through the futures channel, yamux splits the actual tcp stream into multiple substreams, and the service layer wraps the yamux substream into a protocol stream.

At the same time, support for other protocol(such as websocket) is also planned, but will delay a lot.

Detailed introduction: 中文/English

Note: It is not compatible with libp2p.


The API of this project is basically usable. However we still need more tests. PR is welcome.


From cargo

tentacle = "0.2"


  1. Clone
$ git clone
  1. On one terminal:

Listen on

$ RUST_LOG=simple=info,tentacle=debug cargo run --example simple -- server
  1. On another terminal:
$ RUST_LOG=simple=info,tentacle=debug cargo run --example simple
  1. Now you can see some data interaction information on the terminal.


Because when I use rust-libp2p, I have encountered some difficult problems, and it is difficult to locate whether it is my problem or the library itself, it is better to implement one myself.

You can’t perform that action at this time.