The language I am working in is Javascript on HTML5-compatible browsers.
My understanding is that WebSockets require a socket server to transport push notifications and messages back and forth between clients.
Is there an actual peer-to-peer capability with HTML5 that does not require a socket server? Has anyone seen example client-side code in Javascript that exemplifies this capability?
Web RTC introduced by World Wide Web Consortium (W3C). That supports browser-tobrowser applications for voice calling, video chat, and P2P file sharing.
The idea for WebSockets was born out of the limitations of HTTP-based technology. It is a peer-to-peer protocol - data that is sent from the server to the client must first be requested. In turn, WebSockets allow you to send data based on UDP-like WebSockets messages, but with higher TCP reliability.
As HTTP is one of the most widely used protocols, creating a generic P2P HTTP architecture could enable a vast amount of existing services to benefit from the advantages of P2P networking. However, current initiatives focus only on specific HTTP- based applications, replacing certain functionality with a P2P overlay.
WebSocket provides a client-server computer communication protocol, whereas WebRTC offers a peer-to-peer protocol and communication capabilities for browsers and mobile apps. While WebSocket works only over TCP, WebRTC is primarily used over UDP (although it can work over TCP as well).
See the answers for Will HTML5 allow web apps to make peer-to-peer HTTP connections? However, the content in the WebSockets specification seems to have gone, so I suspect the answer now is "no".
WebRTC http://www.webrtc.org/ https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC
But in 2010 it wasn’t a thing :(
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With