1.0.0 • Published 6 years ago

dhcp-spy v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

DHCP Spy

Silently listen for DHCP requests on the network. Useful for monitoring when devices connects to the network, and can be used to detect presses on an Amazon Dash Button.

Requires root priveligies in order to listen on port 67.

Installation

npm install --save dhcp-spy

Usage

const spy = require('dhcp-spy')

spy.listening.then(() => {
  console.log('Listening for DHCP requests')
})

spy.on('detected', (mac) => {
  console.log(`Detected a request from ${mac}`)
})

spy.on('78:e1:03:b0:08:24', () => {
  console.log('Someone pressed the "Mentos" dash button')
})