tags:

views:

51

answers:

5

Is there any possible way to have browsers communicating to each other over lan/wan without the use of a server (direct peer-to-peer)?

A: 

Short answer: Nope. Not possible.

Long answer: You could write a signed java applet that implements a web server in each browser. Then browser "a" could talk to browser "b's" applet (don't' close that tab!). You would then have limited access to the others browser state in this way.

Similarly, you could write a plugin/addon that could accomplish much of the same thing.

The real question is why would you want to do this? what are you trying to accomplish? Answer that question and we might be able to come up with a solution.

Byron Whitlock
A: 

Yes, they could, but they would need to be designed to establish the connection (or would need to have a module that does it).

Even if I'm wondering why would they need to..

IceCoder
+1  A: 

IIRC, Opera released some kind of addition to their browser that embedded a webserver for just that functionality:

http://unite.opera.com/

Not sure it really went anywhere, but I think its time will come.

guns
+1 interesting. But it doesn't make a direct connection, it uses opera servers to get around NAT restrictions (really the only smart way to do this anyhow) http://www.jorgemarsal.com/blog/2009/06/16/how-does-opera-unites-file-sharing-service-work/
Byron Whitlock
Ah, I see. I had assumed it was using zeroconf/Bonjour for resolving local clients. Oh well, maybe some day in the future it will be done with node.client.js + CouchDB or something fun like that.
guns
A: 

In pure HTML/Javascript? Probably not.

To my knowledge, there's no good way in native JavaScript to listen for connections. In HTTP, the client opens a port, sends a request, and receives a response. You could use the XHTTP or similar class to make a request but there's no good way within a normal web page to create a server on the other end that would listen for requests.

Given that, I know that Flash provides a socket library that allows you to listen for connections. (I imagine Silverlight does this as well, though I haven't researched it.) If you were to create an object using either of these technologies, you could listen for connection requests from any client (assuming that you're not behind a firewall or some other connection-filtering device), maintain an open socket and send whatever you want over the wire.

Summary:

  1. Probably can't do this in JavaScript/HTML/CSS.

  2. BUT, you could pull it off in Flash or Silverlight.

David Lively
A: 

Flash - Stratus. New stuff in latest flash that provides P2P connections.

MInner