How can I communicate over TCP sockets from JavaScript?
Here is an implementation with a similar approach:
It uses a Java Applet and bridges its API to JavaScript, interesting...
And here another one:
This one is a wrapper of the Actionscript 3 Socket API, bridged to JavaScript...