Lightweight library providing peer to peer CDN - beta version!

I have released beta version of my peer-cdn. What I would expect out of this version is feedback on the matter of browser support and the issues I haven’t thing of. This version is released in case of finding out what is need to be done before actual release.


The main idea of peer-cdn is to use WebRTC and Service Worker to allow assets such as scripts, images, videos, styles and other files to be shared between peers reducing server usage.

By importing peer-cdn into your service worker you get the access to exported PeerCDN class, Plugins and Strategies.

peer-cdn allow you to register listeners and add middleware to fetch event. For more information, see Middleware.

For full example please check this directory

Things to consider:

  • peer matching algorithms (ways of improving - pick best direction to go from here, beta version keeps it simple - pick first)
  • browser support WebRTC
  • browser support client.postMessage()
  • media supported (there might be issues with range request)

For now I know there might be some issues with:

Would love to get any feedback nad/or contributions! Check help wanted issues and contribute. Also feel free to contact me.

Next steps:

  • add more tests
  • resolve browser support
  • create web pack plugin
  • improve signalling server

Cheers guy!

Written on March 13, 2018