multicast-channel
A simple communication channel using UDP multicast. Node.js only. Send an receive anything JSON.stringify
-able.
Similar to multicast
. The code is heavily inspired by multicast-dns
.
Installing
npm install multicast-channel
Usage
const createChannel = const channel = channelchannel channel
API
opt
may have the following keys:
name
: The user name to send messages with.pack(content, from)
: Pack a message into aBuffer
.unpack(buf)
: Unpack a message from aBuffer
. Should return an object withcontent
andfrom
.
Contributing
If you have a question or have difficulties using multicast-channel
, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.