GithubHelp home page GithubHelp logo

pixelscommander / viraljs Goto Github PK

View Code? Open in Web Editor NEW
957.0 43.0 52.0 3.69 MB

Express.JS middleware to enable P2P distribution for your app. Your decentralized CDN made easy.

CSS 0.90% HTML 4.04% JavaScript 95.06%
p2p nodejs expressjs webrtc

viraljs's Introduction

ViralJS

ExpressJS middleware for P2P Web apps distribution

To reduce server load, latency and establish self-maintainable CDN based on your users browsers.

Join the chat at https://gitter.im/PixelsCommander/ViralJS

Installing from NPM

npm -i viraljs

How to use?

var ViralContainer = require('viraljs');
var viralContainer = new ViralContainer();
myExpressApp.use(viralContainer.middleware);

Isomorphism blurred boundaries between server and client. The only difference between them currently is server`s ability to distribute application to clients. What if we go further enabling client to do this? What if we erase boundaries between server and client completely? In this case every client which got application`s code becomes it`s distributor or carrier. And drawing the analogy with spreading microorganisms in the nature this technique perfectly matches “viral JavaScript“ naming.

Motivation

P2P content distribution allows to reduce server load and decrease network latency since peering could be setup in the way content to be delivered from the nearest peer available. For example after hitting corporative network application will be delivered inside of it using high speed internal channels without creating a load on company`s internet channel.

Normal distribution

Traditional app distribution. Server sends package many times, corporative internet channels are loaded appropriately

P2P distribution

In case of P2P distribution application hits corporative network once and then is distributed using high speed internal network. This reduces server load and corporative internet channel load

Or another case – once application got from USA to Europe it is delivered inside of European networks only without creating transatlantic traffic.

Normal distribution

It takes a lot of transatlantic trips to transmit an app when doing it in a traditional way

P2P distribution

P2P allows to reduce number of transcontinental transfers and reduce server load

By distributing application via P2P you create a self-establishing and self-evolving CDN which moves data closer to client.

Bug tracker

Have a bug? Please create an issue here on GitHub!

https://github.com/PixelsCommander/ViralJS/issues

License

MIT: http://mit-license.org/

Copyright 2015 Denis Radin aka PixelsCommander

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.