Or you can use web-socket-js, which uses Flash sockets to emulate WebSocket. All you have to do is load the Flash file included (there's an example on the website) and serve the socket policy file at port 843 (more on that also on the website). The javascript code for using WebSocket is the same.