monitor Zwift UDP packets and emit events for player state updates
npm install zwift-packet-monitor
npm install zwift-packet-monitor
`
Usage
`javascript
const ZwiftPacketMonitor = require('zwift-packet-monitor')
// interface is cap interface name (can be device name or IP address)
const monitor = new ZwiftPacketMonitor(interface)
monitor.on('outgoingPlayerState', (playerState, serverWorldTime) => {
console.log(playerState)
})
monitor.on('incomingPlayerState', (playerState, serverWorldTime) => {
console.log(playerState)
})
// The Zwift server sends states in batches. This event is emitted at the end of each incoming batch
monitor.on('endOfBatch', () => {
console.log('end of batch')
})
monitor.start()
``