Peer Plugin
Plugins are factories for middleware allowing you to create more complicated logic used by peer-cdn.
This is where main logic of peer-cdn is handled. Currently due to lack of support for WebRTC in the service workers is used with DelegatePlugin to be handled on client side. Creates middleware which asks other connected peer for a given resource and if found downloads it from other peers instead of server.
Source code
Please see source: Peer.js