sockjs-protocol icon indicating copy to clipboard operation
sockjs-protocol copied to clipboard

Note: SockJS defined protocol is invalid json

Open cryptocompress opened this issue 9 years ago • 0 comments

Hello SockJS contributors!

It happened that I connected to SockJS (from .NET) and got this:

a["message"]

As stated in the docs (http://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html#section-42) it should be an Array of json-encoded messages. Please observe however it's invalid json b/c of char-prefix and can't be parse wihout a small hack: var array = JArray.Parse(jsonString.TrimStart('a'));

It would be nice to see (in a future protocol version?) this frame identifiers (o, h, a, c) encoded into json and named explicitly.

{ version: x, frame: '...', data: [ ... ] }

Thanks!

cryptocompress avatar Nov 26 '16 17:11 cryptocompress