Home » U++ Library support » U++ Core » Way to decode websocket frames?
|
Re: Way to decode websocket frames? [message #59047 is a reply to message #59046] |
Thu, 20 October 2022 19:11   |
omari
Messages: 276 Registered: March 2010
|
Experienced Member |
|
|
Hi,
by default, in the Upp implementation, we accept frame compression when the server can do it.
the frame then is zip compressed, but without header.
as a quik solution, you can disable compression :
in the file: upp\uppsrc\Core\WebSocket.cpp, comment out ( or remove) the line (27)
// "Sec-WebSocket-Extensions: permessage-deflate\r\n"
regards,
Abdelghani OMARI.
regards
omari.
[Updated on: Sat, 22 October 2022 08:44] Report message to a moderator
|
|
|
|
Re: Way to decode websocket frames? [message #59053 is a reply to message #59050] |
Sat, 22 October 2022 08:43   |
omari
Messages: 276 Registered: March 2010
|
Experienced Member |
|
|
Hi,
Zlib is included in U++.
String ZDecompressWS(String s){
StringStream out;
MemReadStream in(~s, s.GetCount());
ZDecompress(out, in, in.GetLeft(), [](int64, int64){ return true;}, false);
return out.GetResult();
}
regard,
Abdelghani OMARI.
regards
omari.
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:06:42 CEST 2025
Total time taken to generate the page: 0.01076 seconds
|