Need help with P2P-CDN?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

135 Stars 19 Forks Other 32 Commits 5 Opened issues


WebTorrent CDN with graceful degradation

Services available


Need anything else?

Contributors list

No Data

P2P-CDN — WebTorrent CDN with graceful degradation

How to use it?

See examples folder, you can try here: look that it's an heavy page with images and video (30MB)!


The LAMP hosting is the most popular choice when you want to public on the Web.

It's cheap and it's fast, but if you want to publish heavy contents like high quality photos, audio or videos with many users could become a problem. Maybe you want to reduce your hosting bill.

This is an easy and accessible (lazy load with graceful degradation) fix: you can stream all your heavy files (PDFs included, see examples!) with much less bandwidth, sharing the bandwidth of your users.

Without Javascript or WebRTC all the contents load normally: it's SEO friendly.

Silicon Valley S04E04 - Teambuilding Exercise

Richard: I read Peter's notes, all of them, and he knew that a peer-to-peer Internet was possible in the future, but he was also basing that on, what, old desktop computers. He never, ever foresaw the ubiquity or power of all of our modern-day smartphones. He was also dealing with a completely different Weissman limit. So... uh, yeah. Yeah. Okay.

Gavin: What is that? Is that number correct?

Richard: The delta in mean device efficiency? Yeah, it is. See, eventually, over time, this will render every server that Hooli operates obsolete, which would make Jack Barker shit himself.

Gavin: Holy shit!

alt text

What is WebTorrent?

BitTorrent over WebRTC (data channels) to stream in the browser.

See WebTorrentFAQ and [email protected].

Generate the torrent with PHP

Torrent.php used in examples by Adrien Gibrat or... ?

Submit your suggestion!

Torrent announce trackers

Default torrent announce/trackers:

udp:// udp:// udp:// udp:// udp:// wss:// wss:// wss://

You can setup a private tracker with bittorrent-tracker or what you prefer.

Apache notes

Disabled gzip compression for .mp4 files with

SetOutputFilter DEFLATE

SetEnvIfNoCase Request_URI .mp4$ no-gzip dont-vary

in the .htaccess if you see this error

TODO - wish list

Configurable torrent trackers - done

Configurable torrent endpoint - done

WebRTC Peer-to-peer in Safari 11 (iOS 11) Works



check/enforce Drupal 8 / Symfony 2 coding standard

Define and expand compatibility

Explore platforms other than LAMP, maybe Node.js? webtorrent-hybrid

Tests (PHPUnit? Karma? Jasmine?)

Integration with popular frameworks and CMS like Laravel, Symfony, Wordpress and Drupal, plugins and modules

A logo maybe? :P


MIT. Copyright (c) Andrea Paiola.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.