Iridium icon indicating copy to clipboard operation
Iridium copied to clipboard

Add network packet capture feature

Open lhyqy5 opened this issue 2 years ago • 6 comments

Use windivert to capture packet, make capture data more easy.

lhyqy5 avatar Jun 08 '22 14:06 lhyqy5

Why specifically windivert and not libpcap? Just curious.

Algoinde avatar Jun 08 '22 14:06 Algoinde

I didn't delve into it. but windivert seems have more easy API, and doesn't need install another soft.

lhyqy5 avatar Jun 08 '22 15:06 lhyqy5

Fair enough. Would you be up to add a button to start/stop it (same as the proxy) instead of the config option and running all the time?

Algoinde avatar Jun 08 '22 16:06 Algoinde

Use node-pcap instead seems to be more general.

Like this https://github.com/Escheee/Iridium/blob/222928ffc762a3be99e8532252e0b71690e3b2da/backend/sniffer.js#L483

But you need to add a button to select the captured network card. 😭

Escheee avatar Jun 09 '22 13:06 Escheee

Agree on node-pcap as it's not as platform-dependent it seems. I can do the UI stuff if needed, just need the backend to spit out the list of current interfaces to the frontend via websocket on connect.

Algoinde avatar Jun 09 '22 14:06 Algoinde

Have added a start button to UI, and added pcap capture implement(enabled default). now both pcap and windivert mode can work, but windivert mode will cause an unexcepted exit when trying to stop the capture, maybe the windivert node-lib has a bug.

lhyqy5 avatar Jun 10 '22 12:06 lhyqy5