raw-network-listener
Wrapper around cap that listens for packets on network interfaces.
Uses pcap filters.
$ npm install raw-network-listener
Usage
const rnl =const loopback =consoleloopback
API
.decoders
From cap.decoders
.findDevice()
From cap.Cap.findDevice
.deviceList()
From cap.Cap.deviceList
({ interface, filter })
Create listener on the interface
(e.g. lo0
or eth0
) with the filter. Filters are based on pcap filters.
.on('packet', packet => ...)
Is emitted when a new packet is registered on the interface. packet
is a buffer.
.linkType
The link type of the interface
.send()
From cap.Cap().send
.close()
From cap.Cap().close