views:

2414

answers:

3

I'm thinking about how limiting it is for AJAX apps to have to poll for updates, when what would be ideal is for javascript to be able to set up a real two way connection to the server. I'm wondering if there is some method of integrating javascript with a browser plugin that can make a tcp connection so that I could pass data into and out of the browser plugin.

+1  A: 

You are a genius you know. This is most definitely possible, you do need to write a flash-Javascript library, haven't heard of one, but the idea is totally doable. You just need the TCP in flash with well defined callback API for javascript (or you could just call strings to give you more flexibility).

Anyways pure genius I say.

Robert Gould
+6  A: 

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...

CMS
+4  A: 

jSocket and Stream are two options that utilize Flash's built-in XML sockets, though neither appears to be production-ready. I'd lean towards using a Flash-based solution rather than Java, as browser penetration is higher and generally offers a better user experience (load times & stability).

pix0r