[whatwg] WebSocket framing

Bronislav Klučka Bronislav.Klucka at bauglir.com
Sun Aug 21 02:05:08 PDT 2011


Hello,
I'm looking at current WebSocket interface specification
http://www.whatwg.org/specs/web-apps/current-work/complete/network.html#the-websocket-interface

1/ and I'm missing the ability to specify, whether data to be sent are 
final or not (whether the frame to be sent should be continuous or not)
I suppose some parameter for specifying final/continuing frame should be 
there, or some new methods for framing. I've tried to send 100 MiB text 
from Chrome for testing purposes and since there is no way to specify 
framing it was send in one piece.  There is no way to stream data from 
client to server, all data must be kept in memory and sent at once.

2/ The same issue for receiving. I understand the need for simple API. 
But again, there is streaming ability missing, all data are received at 
once. Receiving large amount of data could hang up browser. There should 
be onFrameMessage event intercepting frames one by one and (probably by 
some event property) define, whether all those frames should be cached 
and finally exposed by onMessage event (true by default). Programmer 
than can choose to ignore such event (not implement it) and receive all 
messages by onmessage event or implement it, use it for streaming, and 
possibly prevent onMessage calls and unnecessary caching of large data

3/ MessageEvent should expose what kind of data was received, textual, 
blob or arrayBuffer. This would prevent testing for data type and 
problems with testing |binaryType 
<http://dev.w3.org/html5/websockets/#dom-websocket-binarytype> |property 
if changed during data receiving.

Brona Klucka


More information about the whatwg mailing list