24

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
  • Really cool idea, +1 for the thinking Commented Nov 21, 2008 at 1:52

4 Answers 4

16

WebSockets is designed to solve this problem.

Sign up to request clarification or add additional context in comments.

Comments

11

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

Comments

9

You can use node.js framework's socket.io package which can can be installed via npm (A node package manager).

More detailed usage.

1 Comment

I highly recommend Socket.io
6

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.