2

I am writing a proof of concept application to allow several computers to communicate with each other and control hardware that is attached to them. I would like to use Socket.IO or something like it for the connection , but I often want to send data directly from one socket client to another instead of to the socket server. This is mostly to save network traffic. Is this possible?

Arlen Beiler
  • 15,336
  • 34
  • 92
  • 135

2 Answers2

1

It looks like your answer might be WebRTC, described here:

Do websockets allow for p2p (browser to browser) communication?

From an answer in the article: "The WebRTC protocol and API is making rapid progress and allows a Data Channel to be established between two peers (you still may need a STUN/TURN server for the initial NAT traversal and setup)."

Community
  • 1
  • 1
nixkuroi
  • 2,259
  • 1
  • 19
  • 25
  • The answer you refered to is oudated. The guy wrote in 2010 that _The WebRTC protocol and API is making rapid progress_. It was almost 5 years ago! – niekas Jan 19 '15 at 14:08
1

There is a github project called socket.io-p2p which comes with a demo chat application that starts out brokered by a server but then switches to WebRTC.

The current link is https://github.com/socketio/socket.io-p2p . That seems unlikely to disappear any time soon, but, in case it does at some future point, you should be able to find a clone/fork somewhere by knowing the socket.io-p2p name. (It's under the MIT license.)

msouth
  • 832
  • 11
  • 21