Skip to content

libp2p/go-mplex

Repository files navigation

DEPRECATED: go-mplex

mplex is deprecated. When on TCP, we recommend using Yamux instead. If TCP is not a requirement, consider using QUIC instead.

Ref: Discussion around mplex deprecation: libp2p/specs#553


Go Reference Discourse posts

A super simple stream muxing library implementing mplex.

Users should prefer yamux over mplex. We would like to deprecate mplex in the future.

Usage

mplex := multiplex.NewMultiplex(mysocket)

s, _ := mplex.NewStream()
s.Write([]byte("Hello World!"))
s.Close()

os, _ := mplex.Accept()
// echo back everything received
io.Copy(os, os)

The last gx published version of this module was: 0.2.35: QmWGQQ6Tz8AdUpxktLf3zgnVN9Vy8fcWVezZJSU3ZmiANj