Ejecta icon indicating copy to clipboard operation
Ejecta copied to clipboard

Supporting blob binaryType for WebSocket is becoming crucial

Open apitaru opened this issue 11 years ago • 2 comments

I think it is becoming crucial to support the blob binaryType in Ejecta's WebSocket. As far as I can tell both react-native(1) and nodejs(2) do not support arraybuffer.

Being able to interface properly with these very popular libraries would be wonderful for Ejecta.

(1) https://github.com/facebook/react-native/pull/1829 (2) https://github.com/websockets/ws/issues/441

apitaru avatar Aug 19 '15 15:08 apitaru

React Native doesn't support Blobs either. Blobs are not a part of JSC, but of WebKit. Typed Arrays are at least supported directly in JSC, but there's still no API to deal with them in C land. nodejs/ws is able to send and receive binary data (binary flag).

Ejecta doesn't care if the WebSocket Server sends and receives binary data as Blobs or ArrayBuffers, because it's just binary data. The Server can do whatever it wants with it. So if the server is not able to handle binary data, it's the server's problem.

Also see https://github.com/facebook/react-native/issues/1424 And this JSC Bug https://bugs.webkit.org/show_bug.cgi?id=120112

phoboslab avatar Aug 19 '15 18:08 phoboslab

Thanks for the detailed response. Seems you're a step ahead of me here : ) I'll take a closer look at it all. Closing this issue. Thanks again!

apitaru avatar Aug 19 '15 22:08 apitaru