简体   繁体   English

Cap.findDevice 返回所有时间未定义

[英]Cap.findDevice return all time undefined

I try to work on packet with cap but is not work.我尝试使用带帽的数据包但不工作。 I have try the default code:我尝试了默认代码:

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); 

But every time Cap.findDevice return undefine .但是每次 Cap.findDevice 返回undefine I have install npcap with WinPcap compatibility.我已经安装了与 WinPcap 兼容的 npcap。 I have try to a lot of different ip but no one work.我尝试了很多不同的 ip 但没有一个工作。

Some one have an answer?有人有答案吗?

Thank in advance.预先感谢。 Have a good day.祝你有美好的一天。

Ok that's my bad i dont understand the ip is for the listening interface, i was think is the remote ip.好吧,那是我的错,我不明白 ip 用于监听接口,我认为是远程 ip。 So i have put my ip and is work.所以我放了我的 ip 并且正在工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM