Hello, I'm building my own packet capture program using libpcap with c++. I wanted to capture a web socket protocol. I faced a problem while captureing it. I am using stomp library, and using permessage-deflate.
I looked at structure of web socket protocol. I successfully unmasked payload data using mask key. It looked just the same as wireshark's unmasked data. But the problem is here.
I heard that web socket protocol uses deflate compression to compress data. So I tried to decompress data which I already have unmasked. I used zlib that chatGPT gave me. But It kept saying error -3: data error. It says that data I tried to decompress is not a compressed data.
I also tried to compress data using zlib, but the result was different from wireshark's compressed data.
I want to know how wireshark successfully decompress data using deflate algorithm. I also want to know how to code it.
plz help me this is killing me for days..