Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

buffer-broadcaster

ygarasab1ISC1.0.0

Broadcasting buffers trhough websockets

buffer, broadcaster, pcap, websocket

readme

buffer-broadcaster

Websocket client for compressing and then broadcasting large buffers.

Install

npm i buffer-broadcaster

Usage

For using the library, you must create a broadcaster using the launchBroadcaster method, as such:


const bp = require('buffer-broadcaster')
const port = 7000 // port through where the sockets will be emited

const broadcaster = bp.launchBroadcaster(port)

Once you've done that, you have on hold a new empity Buffer. As you gather your data, you can append it just like that:


broadcaster.appendBuffer(dataBuffer)

After you have all the data you need to transmit, you broadcast it, cleaning the buffer on hold.


broadcaster.broadcast()