Closed g407 closed 4 years ago
The readme clearly states that you need to install npcap as a requirement. The Windows files bundled with this addon are not sufficient to support packet capturing. They are part of the SDK needed to link with the necessary DLLs installed by the actual packet capturing software (npcap).
Hi,
npm i cap
builds successfully and I run my node.js script, the js call sequence
var Caplib = require('cap'); var Cap = Caplib.Cap; var decoders = Caplib.decoders; var PROTOCOL = decoders.PROTOCOL;
var c = new Cap(); var device = Cap.findDevice("192.168.0.158");
results in 'device==undefined'. After I install winpcap manually, the device is initialized correctly.
I see the 'deps' directory contains the required libs, but for some reason they are never used.
My binding.gyp says:
{ 'targets': [ { 'target_name': 'cap', 'sources': [ 'src/binding.cc', ], 'include_dirs': [ "<!(node -e \"require('nan')\")", ], 'conditions': [ [ 'OS=="win"', { 'include_dirs': [ 'deps/winpcap/Include', ], 'defines': [ 'WPCAP', ], 'conditions': [ [ 'target_arch=="ia32"', { 'link_settings': { 'libraries': ['ws2_32.lib', '<(PRODUCT_DIR)/../../deps/winpcap/Lib/wpcap.lib'], }, }, { 'link_settings': { 'libraries': ['ws2_32.lib', '<(PRODUCT_DIR)/../../deps/winpcap/Lib/x64/wpcap.lib'], }, }], ], }, {
POSIX
], }
Do you have a clue how I can debug this?
Thank you.