This post originated from an RSS feed registered with Ruby Buzz
by Aslak Hellesøy.
Original Post: Webbit 0.2.0 with hybi-10 support
Feed Title: Aslak Hellesøy's uncommon sense
Feed URL: http://aslakhellesoy.com/rss
Feed Description: Ruby-related blog posts from Aslak Hellesøy
The WebSocket specification has gone through several drafts, and seems to be settling down after some security flaws were identified and resolved a couple of months ago. Most current web servers that support WebSockets implement the hybi-00 version of the specification (which, confusingly is the same as hixie-76).
Last week, Google released Chromium 14.0.835.2, which implements hybi-10 - the latest draft of the WebSocket specification. This version of Chromium will not be able to talk to WebSocket servers that only implement the older WebSocket specifications.
Chromium is mostly used by programmers like myself who want early access to the new features, so this isn’t going to be a problem for Chrome users yet. Chrome is based on Chromium, and it auto-updates itself in the background. This means that one day in the near future a lot of WebSocket apps will break for Chrome users.
Web applications based on Webbit 0.2.0 will not have this problem. Webbit is a light-weight Java web server with WebSocket and EventSource support, created by my colleague Joe Walnes. I have been a contributor to Webbit almost since the beginning, and the past couple of days I have implemented hybi-10 support. Webbit now supports hybi-10, hybi-0/hixie-76 and hixie-75.
One of the exciting features of the new protocol specification is the ability to send and receive binary data over a WebSocket. Previous versions of the specification only allowed UTF-8 encoded strings.
On the browser side, this is possible via JavaScript Typed Arrays. Typed arrays are JavaScript types that are available in modern browsers, and provide an API similar to Node.js’ Buffer type. In short, this allows JavaScript code to work with binary data, reading and writing signed or unsigned numbers with 8, 16, 32 or 64 bits. This opens up for transfer of richer data types, such as audio and video, but also custom protocols. Chromium doesn’t support binary data over WebSockets yet, but it will soon and Webbit is ready for it.
Grab a copy of Webbit today and ask questions on the webbit mailing list. -And if you happen to be in Melbourne or Brisbane in December, join me for an in-depth Webbit presentation at the YOW! conference.