【发布时间】:2020-10-09 17:20:50
【问题描述】:
我尝试使用 cap 处理数据包,但无法正常工作。 我已经尝试了默认代码:
const Cap = __cap.Cap
const decoders = __cap.decoders
const PROTOCOL = decoders.PROTOCOL
var c = new Cap();
var device = Cap.findDevice('192.168.0.10');
var filter = 'tcp and dst port 80';
var bufSize = 10 * 1024 * 1024;
var buffer = Buffer.alloc(65535);
console.log(device);
但每次 Cap.findDevice 都会返回 undefine。 我已经安装了与 WinPcap 兼容的 npcap。 我尝试了很多不同的 ip 但没有一个工作。
有人有答案吗?
提前致谢。祝你有美好的一天。
【问题讨论】:
-
你检查过你设备的 IP 是什么吗?
-
我在想这是不是我的远程 IP。非常感谢。
标签: javascript node.js winpcap npcap