libp2p's mplex muxer extended with snappy compression, made to be used with Individe IPFS nodes.
$ npm i @individe/libp2p-snappy-muxer
Snappy muxer extends Mplex. It compresses all outgoing streams towards nodes that implement /mplex/snappy/x.x.x multistream protocol and decompresses incoming streams from the nodes that implement that same protocol. Compression algorithm used is snappy.
import { SnappyMplex } from '@individe/libp2p-snappy-muxer'
import { createLibp2p } from 'libp2p'
const node = await createLibp2p({
streamMuxers: [
new SnappyMplex()
]
})
import { SnappyMplex } from '@individe/libp2p-snappy-muxer'
import { createLibp2p } from 'libp2p'
import * as IPFS from 'ipfs-core'
(async () => {
const libp2p = await createLibp2p({
streamMuxers: [
new SnappyMplex()
]
})
const ipfs = await IPFS.create({
libp2p: libp2p
})
})()
Licensed under either of
- Apache 2.0, (LICENSE-APACHE / http://www.apache.org/licenses/LICENSE-2.0)
- MIT (LICENSE-MIT / http://opensource.org/licenses/MIT)