Binary-Data over WebSockets not supported?

2,686 views
Skip to first unread message

Clemens

unread,
Sep 1, 2011, 8:28:11 AM9/1/11
to Chromium HTML5
Hi,

I try to receive binary data using WebSockets, my code basically looks
like this:

webSocket = new WebSocket('ws://.......');
webSocket.binaryType = "arraybuffer";
webSocket.onmessage = function(e) {
.... = new Uint8Array(e.data);
}

However chrome just prints out the following message:
> "Received a binary frame which is not supported yet."

Does chrome (14) not support binary data over websockets, or is this
my fault?

Thank you in advance, Clemens

PhistucK

unread,
Sep 1, 2011, 8:30:44 AM9/1/11
to Clemens, Chromium HTML5
Chrome 14 does not support the transmission of binary data over WebSocket just yet.
This (along with other new features of the latest -10 draft) is being actively developed. I am not sure Chrome 15 will have it, I guess Chrome 16 is more likely.
No official time frame.

PhistucK




--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To post to this group, send email to chromiu...@chromium.org.
To unsubscribe from this group, send email to chromium-html...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/?hl=en.


Bauglir

unread,
Sep 1, 2011, 1:03:23 PM9/1/11
to Chromium HTML5
Hi,

you should check out this bug I've reported
http://code.google.com/p/chromium/issues/detail?id=93652

to see the progress on Chromium and WebKit side (webkit link is inside
this bug report)

B.

Clemens

unread,
Sep 1, 2011, 2:41:49 PM9/1/11
to Chromium HTML5
Hi again,

> Chrome 14 does not support the transmission of binary data over WebSocket
> just yet.
> This (along with other new features of the latest -10 draft) is being
> actively developed. I am not sure Chrome 15 will have it, I guess Chrome 16
> is more likely.

Thanks for the clarification. Well seems I have to rely on Base64
again.
Hopefully the whole websocket-topic will be settled soon, its has been
going on for sooo lang already :/

Thanks, Clemens

Takeshi Yoshino

unread,
Sep 7, 2011, 4:22:35 AM9/7/11
to Chromium HTML5

Bauglir

unread,
Sep 7, 2011, 6:49:17 PM9/7/11
to Chromium HTML5
Well better to say "we thank you" :)
I've just downloaded the build and tried to receive fragmented blob
imsge, fragmented arraybuffer image and send image to server.... all
works!!

Thumbs UP!
Brona

On 7. Sep., 10:22 h., Takeshi Yoshino <tyosh...@google.com> wrote:
> It's landed for M-15.http://code.google.com/p/chromium/issues/detail?id=93652
>
> Thanks,

Lucas Vickers

unread,
Sep 25, 2012, 4:30:14 PM9/25/12
to chromiu...@chromium.org
I'm on Chrome 22.0.1229.79 on OS X 10.8

I am attempting to send binary data up to javascript in Chrome.  

        ws = new WebSocket(url);
        ws.binaryType = "arraybuffer";

I put a debugger; in my ws.onmessage, and it is never hit.
On the console I read
" Could not decode a text frame as UTF-8. "
which is printed in my ws.onerror function.

From everywhere I've read this has been supported in Chrome for some time.  Can anyone let me know what I am missing?

thanks

Lucas Vickers

unread,
Sep 25, 2012, 5:18:51 PM9/25/12
to chromiu...@chromium.org
The message opcode was being set to Text.  I set to Binary and we are all good.  Sorry for the spam.

Eiji Kitamura

unread,
Sep 25, 2012, 8:45:54 PM9/25/12
to Lucas Vickers, chromiu...@chromium.org
Hi Lucas,


To get a better response, you should give more information.

I am attempting to send binary data up to javascript in Chrome.  

        ws = new WebSocket(url);
        ws.binaryType = "arraybuffer";

I put a debugger; in my ws.onmessage, and it is never hit.
On the console I read
" Could not decode a text frame as UTF-8. "
which is printed in my ws.onerror function.

From everywhere I've read this has been supported in Chrome for some time.  Can anyone let me know what I am missing?

Assuming this code is on client side, are you sure the server side supports binary frame?

ws.binaryType = "arraybuffer";

This defines your preference of format you will receive binary data in (arraybuffer or blob). So this doesn't indicate the format of the binary data you are going to send. In case you don't know.

I have an audio streaming demo code which sends audio data as binary.

Check out this part:

Here's the live demo:

 
thanks

On Wednesday, September 7, 2011 6:49:17 PM UTC-4, Bauglir wrote:
Well better to say "we thank you" :)
I've just downloaded the build and tried to receive fragmented blob
imsge, fragmented arraybuffer image and send image to server.... all
works!!

Thumbs UP!
Brona

On 7. Sep., 10:22 h., Takeshi Yoshino <tyosh...@google.com> wrote:
> It's landed for M-15.http://code.google.com/p/chromium/issues/detail?id=93652
>
> Thanks,

--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.

To post to this group, send email to chromiu...@chromium.org.
To unsubscribe from this group, send email to chromium-html...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/?hl=en.



--
Eiji Kitamura | Developer Advocate | age...@google.com | +81-80-1150-6480

Reply all
Reply to author
Forward
0 new messages