You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried using the websocket.ksy format file in Python and i noticed that masked packets raise an UnicodeDecodeError exception when parsed.
I used the examples section (5.7) from RFC 6455 for the WebSocket protocol.
Example code:
# A single-frame masked text message (contains "Hello")raw_msg=bytes((0x81, 0x85, 0x37, 0xfa, 0x21, 0x3d, 0x7f, 0x9f, 0x4d, 0x51, 0x58))
ws_msg=Websocket.from_bytes(raw_msg) # Exception raised here
The format doesn't take special care of masked messages as they can't be parsed as UTF-8 strings.
I also see the format doesn't attempt to use the xor process with the key after which it should be possible to parse the data as a string. I tried finding a way to incorporate it but as far as I understand, currently there is no way to make an optional process routine (based on the is_masked header section).
The text was updated successfully, but these errors were encountered:
I've tried using the websocket.ksy format file in Python and i noticed that masked packets raise an UnicodeDecodeError exception when parsed.
I used the examples section (5.7) from RFC 6455 for the WebSocket protocol.
Example code:
Traceback of the exception:
The format doesn't take special care of masked messages as they can't be parsed as UTF-8 strings.
I also see the format doesn't attempt to use the xor process with the key after which it should be possible to parse the data as a string. I tried finding a way to incorporate it but as far as I understand, currently there is no way to make an optional process routine (based on the is_masked header section).
The text was updated successfully, but these errors were encountered: