10

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?

eeejay
  • 5,394
  • 8
  • 29
  • 30
  • possible duplicate of [Will HTML5 allow web apps to make peer-to-peer HTTP connections?](http://stackoverflow.com/questions/1032006/will-html5-allow-web-apps-to-make-peer-to-peer-http-connections) – Chris Morgan Jun 17 '15 at 22:00

4 Answers4

4

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".

Community
  • 1
  • 1
Chris Morgan
  • 86,207
  • 24
  • 208
  • 215
  • This is incorrect, WebRTC support direct peer-to-peer communications. And there are existing applications already who use it: https://www.sharefest.me , https://www.peer5.com – shacharz Jun 17 '15 at 16:47
  • Yes, WebRTC has indeed taken up this matter. In 2010 it wasn’t a thing, though; I believe it was more than a year before there were any stable implementations of it. – Chris Morgan Jun 17 '15 at 21:58
3

WebRTC http://www.webrtc.org/ https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC

But in 2010 it wasn’t a thing :(

stevemao
  • 1,423
  • 1
  • 16
  • 29
0

https://www.peer5.com/faq

Just seen this online, may be worth looking at.

roo
  • 27
  • 1
0

Most of the time browsers are behind firewall and you cannot connect directly to browser. If you don't want to implement server yourself there is a solution:

https://httprelay.io/

You can use AJAX calls to communicate between browsers.

Jonas
  • 4,683
  • 4
  • 45
  • 81