
CacheP2P – Distributed caching platform - feross
http://www.cachep2p.com
======
jdc0589
This project, and lots of others, would really benefit from a standardized
crypto Javascript API in browsers so there is an opportunity for using better
hashing algorithms than are realistic to implement in Javascript.

Im not saying its realistic to engineer sha1 collisions to serve up malicious
content on a platform like this, but its getting closer every year.

~~~
mburns
[https://www.w3.org/TR/WebCryptoAPI/](https://www.w3.org/TR/WebCryptoAPI/) ?

~~~
vitus
In particular, SubtleCrypto [0] seems to be what you're looking for. It's in
the latest versions of FF/Chrome/Edge/Safari (and according to MDN, shipped
with Edge last year and has been supported by Chrome/FF/Safari for roughly 2
years* [1]).

I can't find any support for Opera / IE, unfortunately, although Opera's been
based on Chromium since 2013, so... presumably it's been supported for years,
as well?

* Cross-referencing against browser release dates, that is.

[0] [https://www.w3.org/TR/WebCryptoAPI/#dfn-
SubtleCrypto](https://www.w3.org/TR/WebCryptoAPI/#dfn-SubtleCrypto)

[1] [https://developer.mozilla.org/en-
US/docs/Web/API/SubtleCrypt...](https://developer.mozilla.org/en-
US/docs/Web/API/SubtleCrypto)

------
niklasrde
Isn't that what Akamai used to do and then they realised people aren't happy
that their bandwidth is used for these reasons without their consent?

~~~
c3833174
I believe it was peercdn who had developed something like this, until yahoo
acquired them.

------
Paul-ish
Couldn't someone create a large number of sybils in this network to see what
pages people are loading? Browser sessions could be inferred from this.

Also, how much latency does this add due to P2P connection set up time?

~~~
striking
Hot-cache reloading the page, the P2P set up time is less than three seconds.

And yes, you could see what resources which people are downloading. It isn't a
replacement for a server, just a great way to avoid the Slashdot effect.
Definitely not privacy-focused, but I could see some smaller websites using
it.

------
Xeoncross
So you have to load the page from the server in order to load the javascript
so you can load the same page from the client pool?

Is this supposed to be more of a bootstrap process? Load the first page from
the server and then you can use the URL hash to request additional pages from
the connected clients?

~~~
rcthompson
I think you load the (hopefully small) HTML page from the server, but then you
load images, videos, and other large assets from peers.

------
willmacdonald
I'm getting this error on your API page:

    
    
      cachep2p.min.js:9 Uncaught Error: Cannot add duplicate torrent 3cd9bdf4916f422aa77cdd1b952c14202e0eafca
    

I'm also getting these on FF:

    
    
      ICE failed, see about:webrtc for more details(unknown) 
    
      TypeError: asm.js type error: expecting argument type declaration for 'e' of the form 'arg = arg|0' or 'arg = +arg' or 'arg = fround(arg)'

~~~
markbnj
Same thing in chrome, and the performance of the page is pretty horrible. It's
frozen the whole browser a couple of times forcing me to close the window.

~~~
yalooze
Same here. Chrome Version 53.0.2785.143

The whole browser becomes almost unresponsive.

------
randall
This has made me rethink a lot of things. I think video on the web should
probably use the webtorrent approach primarily. Thanks for posting... gonna go
work on some interesting approaches now.

~~~
sprky
I dont think bittorrent is particularly suited for small file caching and
thats how a lot of video is served these days (think about how adaptive rate
streaming works, a video is split into thousands of small files containing a
few seconds of video at certain bitrates).

~~~
johnhenry
I believe that bittorrent works by splitting a single file into thousands of
small files, so this may, in fact, be ideal?

~~~
thatcat
Ops point, I think, was that you couldn't switch rates mid-stream.

------
milankragujevic
Seems nice, like a hybrid between ZeroNet and WebTorrent, which it probably is
given that the author is the wonderful Feross Aboukhadijeh, the creator of
WebTorrent.

------
theon144
I like it, but doesn't this inherently expose all currently connected users'
IP addresses to all other users?

In other words, if I connect to the webpage and just monitor the swarm, can I
log all IP addresses that accessed that page?

~~~
thatcat
Theoretically though it would depend on the size of the swarm and how many
peers you had. Tor doesn't support webrtc either.

------
johnhenry
Great work. Looking through the documentation, I realized that this uses a
modified version of webtorrent in order to associate torrents with urls rather
than a page's content. I wonder would be necessary if BEP46 were implemented
([https://github.com/feross/webtorrent/issues/886](https://github.com/feross/webtorrent/issues/886))
in web torrent?

------
jorjordandan
Would it be possible to make a completely serverless webpage? Or a website
that has a server to bootstrap, but all assets are 100% distributed?

~~~
rroriz
I remember something like this appearing here:
[http://ephemeralp2p.durazo.us/](http://ephemeralp2p.durazo.us/)

------
akerro
Can I use qbittorrent/deluge to seed webpages?

~~~
thatcat
Libtorrent doesn't support webrtc yet, vuze and web torrent desktop client
support it.

------
mkephart33
I just wrote a simple Wordpress plugin which utilizes
[http://cachep2p.com's](http://cachep2p.com's) new CacheP2P technology -->
[http://keplabs.me/cachep2p.zip](http://keplabs.me/cachep2p.zip) | The simple
for now (I will update this plugin to automate the rest of the functionality
so no manual work is required) plugin will insert the necessary files in the
footer of your Wordpress website... Cheers!

------
soundofvictory
makes me think of [https://ipfs.io/](https://ipfs.io/)

------
ravenstine
I wonder how this could be set up to work on error pages; could this keep
pages working even if the server returned a a 503? Such a concept would be
pretty useful for a media company, like the one I work for, which mostly
serves static content.

~~~
thatcat
It seems it already does. "Now any browser can act as a server to other
browsers, so content can now be delivered even if the main server is
completely down, just by getting it from the users who alrelady received it. "

------
ComodoHacker
Sounds cool, but what are the use-cases? What problems is this tech trying to
solve?

~~~
WhoBeI
I have the same issue - can't think of a single one. Most of the ones I could
think of are solved better with CDN or other cloud services.

Well, should all DNS servers suddenly die it might be useful but besides
that..

But, yeah, still kind of cool.

~~~
deckar01
CDNs and cloud services cost money to setup and maintain.

This scales asset availability with popularity, automatically, for free, with
minimal setup.

~~~
guerrerocarlos
You resumed it brilliantly, I took the liberty to cite you in the landing
page, hope you don't mind.

~~~
deckar01
Happy to help. Thanks for working on this awesome project!

------
XCSme
Same as previous sites that demo web P2P: the site crashes my browser. I tried
opening the API page, it rendered fine but then the entire browser froze. P2P
pages are very far away from being production-ready.

------
uzyn
Is this like IPFS, without the need of off-browser IPFS daemon?

------
serge2k
> The way internet works currently is not scalable

News to me.

~~~
hueving
The way content delivery via HTTP works isn't very scalable. The fact that
companies like akamai and cloudflare exist are a testament to this.

------
misterbowfinger
lol all i read is "distributed xss attacks"

