unsetbit / p

Peer-to-peer networking with browsers
http://unsetbit.com/p
Other
411 stars 27 forks source link

What about ICE / STUN ? #5

Closed lakano closed 10 years ago

lakano commented 10 years ago

Hello !

Your project seems really interesting !

But I would like to known if this could pass through NAT / Firewall / proxy ... ?

The WebRTC protocol uses ICE / STUN protocols to permit to etablish P2P connections between browsers. May be we need to do the same for WebSocket ?

Regards

unsetbit commented 10 years ago

Yep, you should be able to pass through NAT but it's not because I wrote anything for it -- the browser is handles the ICE and STUN negotiations for the most part.

It's not documented, but you can specificy which STUN server to use while creating peer connections:

var otherPeer = peer.connect({
  address: 'address to my peer',
  rtcConfiguration: {"iceServers": [{"url": "stun:stun.l.google.com:19302"}]}
};