News for hackers. Stuff that matters.
Re:CacheP2P – Distributed caching platform by jdc0589 on Thursday October 20, 2016 @01:40PM (#12754393)
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.

Re:CacheP2P – Distributed caching platform by Sephr on Friday October 21, 2016 @01:19AM (#12758304)
The platform my company is working on is similar to cacheP2P. We wrote our own custom PKI implementation on top of the WebCrypto API that doesn't rely on SHA1 for hashing.

I go into more detail about our platform in this comment: https://news.ycombinator.com/item?id=12758084

Re:CacheP2P – Distributed caching platform by dcposch on Thursday October 20, 2016 @08:37PM (#12757389)
For fun a few months ago, I implemented BLAKE in JS. It's a state of the art hash function developed by djb.

It was cool seeing how hashing works under the hood. I used UInt32Array for speed. It is still nowhere near native speed, but fast enough for many applications.

https://www.npmjs.com/package/blakejs

Re:CacheP2P – Distributed caching platform by mburns on Thursday October 20, 2016 @07:24PM (#12757017)
Re:CacheP2P – Distributed caching platform by vitus on Friday October 21, 2016 @07:57AM (#12759635)
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

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

Re:CacheP2P – Distributed caching platform by niklasrde on Thursday October 20, 2016 @10:47AM (#12752693)
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?
Re:CacheP2P – Distributed caching platform by c3833174 on Thursday October 20, 2016 @11:44AM (#12753313)
I believe it was peercdn who had developed something like this, until yahoo acquired them.
Re:CacheP2P – Distributed caching platform by Taek on Thursday October 20, 2016 @11:32AM (#12753195)
Might have more luck if people are getting paid for the bandwidth that is consumed.
Re:CacheP2P – Distributed caching platform by Paul-ish on Thursday October 20, 2016 @01:25PM (#12754262)
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?

Re:CacheP2P – Distributed caching platform by striking on Thursday October 20, 2016 @02:34PM (#12754934)
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.

Re:CacheP2P – Distributed caching platform by Xeoncross on Thursday October 20, 2016 @12:25PM (#12753745)
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?

Re:CacheP2P – Distributed caching platform by rcthompson on Thursday October 20, 2016 @01:58PM (#12754584)
I think you load the (hopefully small) HTML page from the server, but then you load images, videos, and other large assets from peers.
Re:CacheP2P – Distributed caching platform by willmacdonald on Thursday October 20, 2016 @10:46AM (#12752691)
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)'
Re:CacheP2P – Distributed caching platform by markbnj on Thursday October 20, 2016 @11:06AM (#12752940)
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.
Re:CacheP2P – Distributed caching platform by yalooze on Thursday October 20, 2016 @12:10PM (#12753574)
Same here. Chrome Version 53.0.2785.143

The whole browser becomes almost unresponsive.

Re:CacheP2P – Distributed caching platform by ravenstine on Thursday October 20, 2016 @11:49AM (#12753375)
Interestingly, I have no issuse on mobile Chrome.
Re:CacheP2P – Distributed caching platform by jordz on Thursday October 20, 2016 @12:12PM (#12753599)
Same here.
Re:CacheP2P – Distributed caching platform by akerro on Thursday October 20, 2016 @11:14AM (#12753026)
I'm not getting any of these errors and page is very fast.
Re:CacheP2P – Distributed caching platform by guerrerocarlos on Sunday October 23, 2016 @07:54AM (#12773147)
That kind of errors should better go in github/issues than in ycombinator, so we fix them asap: https://github.com/guerrerocarlos/cachep2p/issues
Re:CacheP2P – Distributed caching platform by Socketubs on Thursday October 20, 2016 @12:16PM (#12753643)
No problem for me with Chromium on Linux. Page is fast.
Re:CacheP2P – Distributed caching platform by randomsofr on Thursday October 20, 2016 @06:04PM (#12756592)
I'm getting the first error on Chrome, the page loads, but i can see that error on the console.
Re:CacheP2P – Distributed caching platform by thekonqueror on Thursday October 20, 2016 @02:33PM (#12754923)
My Chrome 53.0.2785.143 froze within 5 seconds of opening cachep2p.com.
Re:CacheP2P – Distributed caching platform by randall on Thursday October 20, 2016 @01:28PM (#12754290)
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.
Re:CacheP2P – Distributed caching platform by sprky on Thursday October 20, 2016 @03:27PM (#12755319)
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).
Re:CacheP2P – Distributed caching platform by rakoo on Friday October 21, 2016 @03:39AM (#12758804)
The number of files is not an issue, the only potential issue is the total size of the content (not what you'd think: the bigger a torrent, the better). It is perfectly doable to create a single torrent for the full video with all known bitrates, and have the client progressively load data as needed, switching from bitrate to bitrate on-the-fly
Re:CacheP2P – Distributed caching platform by johnhenry on Thursday October 20, 2016 @04:31PM (#12755882)
I believe that bittorrent works by splitting a single file into thousands of small files, so this may, in fact, be ideal?
Re:CacheP2P – Distributed caching platform by thatcat on Thursday October 20, 2016 @05:18PM (#12756265)
Ops point, I think, was that you couldn't switch rates mid-stream.
Re:CacheP2P – Distributed caching platform by rakoo on Friday October 21, 2016 @03:42AM (#12758818)
bittorrent doesn't split into files, it splits into pieces and chunks that are invisible to the user, so that's not something you can use as a user.
Re:CacheP2P – Distributed caching platform by milankragujevic on Thursday October 20, 2016 @12:16PM (#12753655)
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.
Re:CacheP2P – Distributed caching platform by theon144 on Thursday October 20, 2016 @04:55PM (#12756089)
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?

Re:CacheP2P – Distributed caching platform by thatcat on Thursday October 20, 2016 @05:14PM (#12756223)
Theoretically though it would depend on the size of the swarm and how many peers you had. Tor doesn't support webrtc either.
Re:CacheP2P – Distributed caching platform by johnhenry on Thursday October 20, 2016 @04:36PM (#12755922)
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) in web torrent?
Re:CacheP2P – Distributed caching platform by jorjordandan on Thursday October 20, 2016 @01:48PM (#12754473)
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?
Re:CacheP2P – Distributed caching platform by rroriz on Thursday October 20, 2016 @03:45PM (#12755459)
I remember something like this appearing here: http://ephemeralp2p.durazo.us/
Re:CacheP2P – Distributed caching platform by Senji on Thursday October 20, 2016 @06:33PM (#12756759)
Zeronet
Re:CacheP2P – Distributed caching platform by akerro on Thursday October 20, 2016 @10:52AM (#12752757)
Can I use qbittorrent/deluge to seed webpages?
Re:CacheP2P – Distributed caching platform by thatcat on Thursday October 20, 2016 @05:21PM (#12756285)
Libtorrent doesn't support webrtc yet, vuze and web torrent desktop client support it.
Re:CacheP2P – Distributed caching platform by mkephart33 on Friday October 21, 2016 @01:09AM (#12758261)
I just wrote a simple Wordpress plugin which utilizes http://cachep2p.com's new CacheP2P technology --> 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!
Re:CacheP2P – Distributed caching platform by soundofvictory on Thursday October 20, 2016 @02:17PM (#12754773)
makes me think of https://ipfs.io/
Re:CacheP2P – Distributed caching platform by ravenstine on Thursday October 20, 2016 @11:48AM (#12753366)
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.
Re:CacheP2P – Distributed caching platform by thatcat on Thursday October 20, 2016 @11:52AM (#12753397)
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. "
Re:CacheP2P – Distributed caching platform by guerrerocarlos on Thursday October 20, 2016 @04:05PM (#12755642)
Certainly, could be set up in error pages, so that the content get's retrieved from users who already received it instead.

Would recommend embedding everything (all the HTML and JS) in the error page, so that the it works 'standalone'.

Re:CacheP2P – Distributed caching platform by ComodoHacker on Thursday October 20, 2016 @12:05PM (#12753524)
Sounds cool, but what are the use-cases? What problems is this tech trying to solve?
Re:CacheP2P – Distributed caching platform by WhoBeI on Thursday October 20, 2016 @01:26PM (#12754277)
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.

Re:CacheP2P – Distributed caching platform by deckar01 on Thursday October 20, 2016 @01:42PM (#12754406)
CDNs and cloud services cost money to setup and maintain.

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

Re:CacheP2P – Distributed caching platform by guerrerocarlos on Friday October 21, 2016 @06:05PM (#12765307)
You resumed it brilliantly, I took the liberty to cite you in the landing page, hope you don't mind.
Re:CacheP2P – Distributed caching platform by deckar01 on Sunday October 23, 2016 @12:33PM (#12774191)
Happy to help. Thanks for working on this awesome project!
Re:CacheP2P – Distributed caching platform by Senji on Thursday October 20, 2016 @06:36PM (#12756790)
Slashdot/Reddit hug of death? Infinitely scalable content delivery on the backs of your site visitors' upload bandwidth.
Re:CacheP2P – Distributed caching platform by kukkukb on Friday October 21, 2016 @04:59AM (#12759090)
Would this help against DDoS attacks on a web site?
Re:CacheP2P – Distributed caching platform by ComodoHacker on Friday October 21, 2016 @07:58AM (#12759645)
No if its content is dynamic.
Re:CacheP2P – Distributed caching platform by c3833174 on Thursday October 20, 2016 @12:10PM (#12753575)
Saving some bandwidth costs?
Re:CacheP2P – Distributed caching platform by ComodoHacker on Friday October 21, 2016 @02:17AM (#12758504)
You mean transfer this cost to site visitors?
Re:CacheP2P – Distributed caching platform by XCSme on Thursday October 20, 2016 @03:40PM (#12755425)
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.
Re:CacheP2P – Distributed caching platform by uzyn on Thursday October 20, 2016 @11:59PM (#12758050)
Is this like IPFS, without the need of off-browser IPFS daemon?
Re:CacheP2P – Distributed caching platform by serge2k on Thursday October 20, 2016 @04:28PM (#12755856)
> The way internet works currently is not scalable

News to me.

Re:CacheP2P – Distributed caching platform by hueving on Friday October 21, 2016 @12:11AM (#12758094)
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.
Re:CacheP2P – Distributed caching platform by misterbowfinger on Thursday October 20, 2016 @06:05PM (#12756600)
lol all i read is "distributed xss attacks"