Tuesday, February 14, 2012

Implementing WebSocket

I am currently creating a Java implementation of the WebSocket protocol. This will allow me to have a Javascript client with a fast, bidirectional communication with the server. Currently only Firefox and Chrome support WebSockets. But Opera already released a development build with the old hybi-00 WebSockets protocol enabled, but decided not to integrate this feature into the main branch because of security concerns. The current version of the standard has solved these security problems, so I am sincere that they will add WebSocket support to the official version soon. MSIE supports it in version 10 (Win8 only). The Windows 7 versions of MSIE is still a problem, though. There are, however, workarounds for that, like using a little flash animation for network communication.

First I wanted to use the jWebSockets Server, but it turned out to be a everything-but-a-kitchen-sink solution much too oversized for my purpose. So I decided to take a look at the RFC and implement it on my own.

The handshaking with a little Javascript exectuted in Firefox already works. Now I have to implement the hard part of the protocol - the data framing. I implemented RFC protocols before, but never one which required me to interpret and write data on the binary level. It will be interesting.

No comments:

Post a Comment