P2P stream multi-multiplexing in Go
Package peerstream is a peer-to-peer networking library that multiplexes connections to many hosts. It attempts to simplify the complexity of:
- accepting incoming connections over multiple listeners
- dialing outgoing connections over multiple transports
- multiplexing multiple connections per-peer
- multiplexing multiple different servers or protocols
- handling backpressure correctly
- handling stream multiplexing
- providing a simple interface to the user
go-peerstream
is a standard Go module which can be installed with:
go get github.com/libp2p/go-peerstream
Note that go-peerstream
is packaged with Gx, so it is recommended to use Gx to install and use it (see Usage section).
This module is packaged with Gx. In order to use it in your own project it is recommended that you:
go get -u github.com/whyrusleeping/gx
go get -u github.com/whyrusleeping/gx-go
cd <your-project-repository>
gx init
gx import github.com/libp2p/go-peerstream
gx install --global
gx-go --rewrite
Please check Gx and Gx-go documentation for more information.
See example/example.go and example/blockhandler/blockhandler.go for examples covering the functionality of go-peerstream
.
To build the examples, please make sure to run make
in the examples/
folder.
This project is maintained by @hsanjuan.
PRs accepted.
Small note: If editing the README, please conform to the standard-readme specification.
MIT © Protocol Labs, Inc