每当我尝试打开句柄时,我都试图使用 jdivert ( https://github.com/ffalcinelli/jdivert ) 捕获网络流量:
public static void main(String[] args) throws WinDivertException {
WinDivert w = new WinDivert("outbound");
w.open(); //exception there
Packet packet = w.recv();
System.out.println(packet);
w.close();
}
它抛出异常:
Exception in thread "main" WinDivertException{code=5, message='null'}
at com.github.ffalcinelli.jdivert.exceptions.WinDivertException.throwExceptionOnGetLastError(WinDivertException.java:57)
at com.github.ffalcinelli.jdivert.WinDivert.open(WinDivert.java:112)
at pl.alpaq.lab.packets.TestClass.main(TestClass.java:11)