find peers on local network by broadcasting / receiving UDP packets
ameba23 4814bf1921 add license 1 year ago
test update to take a key and add a distinctive message 1 year ago
LICENSE add license 1 year ago
README.md fix to get test passing 1 year ago
index.js update to take a key and add a distinctive message 1 year ago
package.json change name in package.json 1 year ago
recieve.js update name etc 1 year ago

README.md

API

const bc = require('try-udp-broadcast')

const destroy = bc.broadcast(msg, [opts])

Broadcast a message regularly.

  • destroy is a function which you can call with no arguments to stop broadcasting.
  • opts may include:
    • opts.interval interval between packets in ms, default 1000
    • opts.port port to broadcast on.

const destroy = bc.receive(callback [opts])

Listen for messages.

  • destroy is a function which you can call with no arguments to stop listening.
  • callback is called whenever a unique message is found. That is, whenever the message or address changes. The message is passed in the callback.
  • opts may include:
    • opts.port port to listen to