Thursday, 12 November 2020
  7 Replies
  1.3K Visits
  Subscribe
Hello, we have a problem in WebSockets by consuming large data by WebSockets.

We are communicating with the server and the message comes cripled and malformed.
so when the receive the msg from the back end they receive it this way

[metadata][payload]

the meta data part contains
ws-frame = frame-fin ; 1 bit in length
frame-rsv1 ; 1 bit in length
frame-rsv2 ; 1 bit in length
frame-rsv3 ; 1 bit in length
frame-opcode ; 4 bits in length
frame-masked ; 1 bit in length
frame-payload-length ; either 7, 7+16,
; or 7+64 bits in
; length
[ frame-masking-key ] ; 32 bits in length
frame-payload-data ; n*8 bits in
; length, where
; n >= 0



in our case we receive from the backend [1, 126, 10, 240] which means opCode 1, 16bit size for the payload
and 10*256+240 = 2800 bytes (the payload length)

the msg we have has a payload of 3175 bytes in length and hence the back end is sending the wrong metadata it should be [1, 126, 12, 104]

Could you help us with what we can search for, and what could be a problem? The same server consumed by C# websocket client works perfect.

Best regards

Patrik