I'm trying to parse some data from a socket in C#. The socket uses the Permessage-Deflate extension. While the packet types are all text, some of the packets show illegible characters.
If I select a packet and go to the HexView tab, I can right-click the packet, choose Copy/Copy as Base64, paste it into the TextWizard and then transform it from DeflatedSAML. This parsed the packet perfectly.
What is being done here in terms of encodings etc in C# equivalent code? I can't seem to go from a string received as a packet in C# to getting the same result as those steps in Fiddler, no matter what options in terms of encoding or decompression I cycle through. . .
Is there a 'flag' byte at the start of a packet that indicates whether a packet contains plain text or compressed data, out of interest?
I'd appreciate any pointers at all on this.