Hacker News new | ask | show | jobs
by aviswanathan 4831 days ago
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.
6 comments

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.

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
Here's one my friends (and I) are building, including a live demo: http://demo.peerkit.com/static/index_demo.html
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.
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?

The problem of bad peers exists with BitTorrent as well, but it's not very effective unless you have a lot of IPs to spare. I found https://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=434346... to be an interesting read.
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.