开发者

Are there any plans for a standard for connecting two clients (P2P) in web applications? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago.

This question has been answered: Do websockets allow for p2p (browser to browser) communication?

The answer is no.

My question is: are there any plans for this? Any speculative draft by the W3C or whoever, planning this capability? (I have googled and found nothing, but I'm not sure if I'm searching the wrong thing.)

There is the WebSockets API, which allows you to, for example, transfer files from one user to another quite efficiently (like http://jetbytes.com/ and some others I've seen). I believe these work by piping the file through the server - it's very light on the server, as it doesn't have to store each chunk after its sent to the receiving client. But it does use the server's bandwidth twice (down and up) for each file transfer.

It would be more efficient (for server and both clients) if the server could just pass the IP address (a开发者_如何学Pythonnd a port?) of each client to the other, and the entire data transfer could take place between them.

For security, the browser could prompt each user to give permission ("This website, example.com, wants to connect you to IP address 1.2.3.4 to receive a file transfer of 23MB. Allow/Refuse?").

If there are no plans to publish a spec on this, why not?


There is a proposed standard for P2P data exchange in web apps: WebRTC Data Channel API.

Example JavaScript implementations include PeerJS, BoneValue and WebRTC.io.


Some RFC's have been implemented to solve parts of the problem (i.e., NAT traversal), but whole problem is pretty complex and I doubt their will ever be a complete official standardization.

What you are suggesting is in fact TURN and STUN implementations of P2P frameworks. It 'looks' easy, but when you get in the details, it is a complex technical issue (and I am not even mentioning security). It is not just a matter of passing IP addresses.

If you want more details, read the NAT traversal chapter from the Practical JXTA II book available online for reading at Scribd.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜