0

The web is built around the idea of user-agents talking with servers. However, I'm wondering if there is some way (websockets perhaps?) that two user-agents (once introduced by a server) could talk directly with themselves.

Is this possible? What kind of problems exist?

User agents often site behind firewalls, so I would expect that the main problem is that unrequested traffic from user agent A to user agent B would be blocked since user agent B didn't make any requests to A.

Xeoncross
  • 55,620
  • 80
  • 262
  • 364
  • JavaScript is mostly, if not all, client-side. Without some type of interfacing socket to communicate through, it's not possible. – John Giotta Apr 19 '11 at 19:45
  • Well, I actually am basing all this off the V8 Node.js with a matching client-side library which would help out. So, the server would help clients find each other. – Xeoncross Apr 19 '11 at 19:47
  • From the look of it, its not entirely JavaScript. You still need to execute a binary service... – John Giotta Apr 19 '11 at 20:03

2 Answers2

1

Not possible with JavaScript (yet).

Alternatives:

  • Adobe Cirrus - it uses Adobe server for rendezvous after which communication run in p2p way; non-commercial use only, commercial use with LCCS
  • Java - you could create a listening socket (e.g. emulating HTTP for AJAX) on one of clients; downsides: requires public IP address + port, first client must know the IP address in order to connect so it also needs central server for this kind of informations, client with a server role must grant special privileges for opening socket
pepkin88
  • 2,742
  • 20
  • 19
0

There a discussion regarding if this feature of html5 will finally by implemented this in modern web browsers, and what would be the restrictions about this.

However, even if this gets implemented, there a lot of related problems to face. The biggest one is that you don't know any detail about the network of the client accessing your page.

The client could be behind a firewall, a reverse proxy, a corporate proxy, even behind multiple firewalls.

So, in practice, this would be difficult to accomplish in real life, even if it gets implemented.

jcarlosn
  • 398
  • 1
  • 4