Hacker News new | past | comments | ask | show | jobs | submit login
[dupe] PeerJS — True peer-to-peer data in the browser (peerjs.com)
110 points by andrewnez on Feb 14, 2013 | hide | past | favorite | 24 comments



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


It is NAT reversal, even there are still many issues to be solved with the ICE. WebRTC team is working fast in this aspect...

BTW, consider that they are shipping first final version in march so NAT reversal is important. YEY!


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


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.


You should hack the Chromium webkit for this.


you can add one or more TURN server(s) into the mix, but apart from that there is no other way using just Javascript.


ICE/STUN (which is used by WebRTC and thus PeerJS) support NAT traversal in all cases but a pair of symmetric NATs, which means some single digit percentage of connections will not work. For those cases, WebRTC/PeerJS support using a TURN server which proxies the data, not ideal but it allows the library to work.


AFAIK, you will be/are able to add TURN server addresses to the mix. It is possible that chrome uses google's TURN servers by default.


Handles NAT traversals


Any details?



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.


Check out Holla.js for that: https://github.com/wearefractal/holla


Any video streaming demo?


See the demo at http://holla.jit.su/


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)


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


Potentially, but their Safari browsers don't support webRTC yet. There's also nothing you could do with the files once you had them, other than images.

I'd personally like to see them implement proper SVG support before they do too.


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


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.


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


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.


Check out Holla.js for Video/Audio: https://github.com/wearefractal/holla


It's in the works!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: