43 comments

[ 4.7 ms ] story [ 94.4 ms ] thread
any specific reason why it's chrome-only?

http://www.webrtc.org/firefox

As ianlevesque mentioned in the link below, http://peerjs.com/status is a good overview of current state of data channels. As Firefox stabilizes their WebRTC data channel support, I will implement it. Hopefully there will soon be cross-browser support as well for data channels.
Firefox is currently ahead on the data channel, right? They support sending blobs / arrayBuffers directly, while Chrome doesn't yet have a reliable transport or binary data support.

Your example translates the file into a base64 string to send over the unreliable channel, which ends up being a pretty big performance hit compared to a native binary transport.

All of this is to say: WebRTC is getting there, but it's still going to be several months before it's ready for more than demos like this.

It's true that it supports binary / reliable transport already but there are some very annoying not-to-spec issues. As a library developer, if I added code to support it, it would just go to waste because in BugZilla they've already patched but not pushed changes to these issues.
I think support for WebRTC is still only in Firefox Nightlies, not the stable version, or at least not full support.
I am on firefox nightly, and the website refuses to work. Looks like it does browser detection, not feature detection.
Same here. Pretty sure it's browser detection only.

I wish developers would honestly stop doing that already. Capabilities and stability are far more important than a logo.

it doesn't work for me on chrome 25 on Mint either.
Depending on how they're writing their files; firefox doesn't support persistent file storage last time I checked.

Firefox does have indexeddb, but if you want to do seek operations you're out of luck.

EDIT: To explain more, without seek writing dealing with large files is incredibly expensive, you have to write everything you've got to indexeddb every time you want to modify it.

This is neat. I've been meaning to do something like it myself for fun. I'd be far more interested in one that just let's you drop a file and gives you a URL for your friend to visit with no other steps. Having one of these services that does the transfer directly peer to peer without accounts or setup steps would be great.
P2P doesnt really work with URLs though as you need to be online for the recieving end to get your file. Some traditional filesharing/upload site would work better in that case imo.

For a P2P scenario it makes sense to have something like a chatroom.

Of course but that's not a big deal if you can see when the transfer to your friend completed.
How about testing the WebRTC availability straight on the frontpage?
I like that idea. Will implement it shortly.
Is this an encrypted/secure connection? I don't see how without certs.
It's not

    Warning:
    -Data is transmitted here without encryption, directly to the other users in this WebRTC room. Use caution if sending sensitive files and communicate file passwords through a more secure channel.
WebRTC encrypts by default and you have to manually edit the SDP to turn it off. I highly doubt the developer went to the lengths to do that.
Could you make it work on Chromium on Linux?
When I was initially developing this a month ago, I used the Chromium nightly build on Ubuntu on my laptop. Since then my laptop's video card died. I'm going to probably roll out a linux VM soon to make sure this works with Chromium nightly still.
One of the coolest implementations of WebRTC is a project my friend launched called PeerCDN (https://peercdn.com/) - basically allows you to reduce bandwidth costs by leveraging the resources of active users on your app.
Holy cow - this is amazing!

My girlfriend brought up a good point: is there any way to opt-out of seeding?

Hmm not sure... Haven't actually tried it out yet
I remember looking into the feasability of something like this about 3-4 years ago when I was working on a social game with ~10 million DAU. Our bandwidth costs for static files were really really high even with a big discount from S3 because we were a heavy user. It's awesome to see that it is finally a reality.

With things like this, getting exposure isn't a matter of having the money to host your content, but simply a matter of being popular. The more popular you are, the more likely that you can offload static file hosting to those consuming your content.

As soon as I saw the WebRTC demo I went looking through the bittorrent spec to see how that was done, to then see how I could do something similar. Looks like you beat me to it, but it's a powerful tool nonetheless. Just imagine Reddit only hosting their database and a single server for master replication.
This was a pillar of Kazaa's business model and made everyone angry that Kazaa's darknet was sucking up their bandwidth, so be sold by Kazaa.
Allows active users of your app to spy on each other, seeing who connects and when.

Or maybe DOS your site, by pretending to be a PeerCDN participant but instead sending large chunks rate limited to 0.5Kb/s. The SHA1 hash check will stop them being used, but only after a long delay. People could be having a bad experience and you wouldn't even know by watching server stats.

How is the connection between peers encrypted?

My Chrome tab crashed when I tried sending a 440mb file!
From their website:

"Your browser will likely crash if you attempt to send a single file larger than 100MB, your mileage will vary."

Opera Unite was trying to do peer-to-peer centrally indexed file sharing as part of their offering I think (http://unite.opera.com/application/132/).

I blogged about it back in 2009 anyhow (under the self-effacing title of "Opera is about to change the world?!"!).