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.
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
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.
精彩评论