Closed tylers-username closed 3 years ago
I'm trying to drop the headers and fluff so that only the original socket message remains.
So, if I have another NodeJS running and I send socket.write(Buffer.from([0xAB])), how would I get 0xAB from the raw_packet using node_pcap?
socket.write(Buffer.from([0xAB]))
0xAB
This is what I have so far.
pcap_session.on("packet", function (raw_packet) { console.log("raw packet", raw_packet); const packet = pcap.decode.packet(raw_packet); console.log( packet, raw_packet.buf.slice(packet.pcap_header.len, raw_packet.buf.length) ); });
It seems that payload.data should do this.
payload.data
I'm trying to drop the headers and fluff so that only the original socket message remains.
So, if I have another NodeJS running and I send
socket.write(Buffer.from([0xAB]))
, how would I get0xAB
from the raw_packet using node_pcap?This is what I have so far.