
PeerJS — True peer-to-peer data in the browser - andrewnez
http://peerjs.com/
======
huhtenberg
> _Note that no peer-to-peer data goes through the server; The server acts
> only to broker connections._

Q1. Does this support connecting to a peer behind a NAT device?

Q2. Does this support connecting two peers each behind its own NAT?

Because a vast majority of real world cases will fall into either of these two
categories.

~~~
vr000m
It uses SDP to exchange ICE candidates. At the moment the SDP tries to
multiplex video/audio and SCTP (data channel).

~~~
latitude
Does WebRTC have any sort of extension mechanism whereby I can drop in my own
version of NAT traversal logic?

Speaking from past experience, STUN and ICE are OK, but they got the whole
process fundamentally wrong. They let the clients drive the traversal process.
This is substantially inferior to letting a dedicated mediating server do that
instead. I did that with one of my past projects and it helped with connecting
peers in a large number of obscure scenarios.

~~~
churreiro
You should hack the Chromium webkit for this.

------
Hupo
Looks like a nice little library, and very relevant to my interests. My
personal "dream scenario" is to have true multisource P2P video streaming in
the browser with no extensions required - with WebRTC, this seems quite
feasible as implementations mature.

~~~
jonpaul
Check out Holla.js for that: <https://github.com/wearefractal/holla>

~~~
muyuu
Any video streaming demo?

~~~
mgurlitz
See the demo at <http://holla.jit.su/>

------
samwillis
This looks like a really nice abstraction of the API. Will have to have a play
with it over the weekend and see what ideas I come up with....

You can play with their chat demo here: <http://cdn.peerjs.com/demo/chat.html>

(Google Chrome 26.0.1403.0 or above is required)

------
venomsnake
Is a torrent client for iOS finally possible with that? One that runs in the
browser and will piss off apple.

~~~
jonknee
Kind of hard when you can't store to the filesystem.

~~~
venomsnake
Direct torrents no, but you can rename the pieces *.fll and download them and
send them to registered app for that extension that combines them ... you will
have problem with seeding though, but that is also something that can be
solved with a little tweaking of the protocol. I think the hacker community
has shown that they can scare you with their inventiveness when they work in
(stupidly and unnecessarily in that case) constrained environment.

------
silverlight
Any reason not to offer support for the video side of things? A lot of the
issues in terms of client IDs and whatnot are the same. It would be nice to
have a single library that can establish a connection and then send either
video ir data or both...

~~~
churreiro
Is it totally possible to do both with the same library.Problem is: You need
that?

I mean, video rendering kills the performance of your browser I guess is
better just to show the possibility of data transferring and then you build it
by using the desired specs. Many ongoing video demos are avaliable too :)

<http://webp2p.org/>

Those guys are also in the same ship with the browser P2P using WebRTC.

