• Stars
    star
    961
  • Rank 47,587 (Top 1.0 %)
  • Language
    JavaScript
  • Created about 9 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

More Repositories

1

HTML-GL

Get as many FPS as you need and amazing effects by rendering HTML/CSS in WebGL
JavaScript
3,454
star
2

Propeller

JavaScript library to rotate elements with mouse or touch gestures. Supports inertia and stepwise rotation. Optimized for better performance.
JavaScript
409
star
3

Download-File-JS

Intelligent JavaScript solution for file downloading.
JavaScript
200
star
4

FlashJS

JavaScript graphics and games engine with API similar to Flash one. Just look to examples sources.
JavaScript
174
star
5

pixi-sdf-text

Signed distance field text implementation for PixiJS
JavaScript
96
star
6

OnlineJS

Reliable, fast and easy to use library to check your internet connection status
JavaScript
68
star
7

requestIdleCallback-polyfill

Polyfill for request idle callback. Determines is user interacting with document and fires when it is not or after interaction is finished.
JavaScript
54
star
8

polymer-native

Develop completely native mobile apps with Web Components
JavaScript
46
star
9

CanvasImage

Converts image to canvas with same look. Useful for memory optimization in case of responsive image usage. Also is good for solving PhoneGap Android anti aliasing issue.
JavaScript
34
star
10

pixel-shaders-workshop

GLSL
29
star
11

React-GL

Render React components in WebGL for 60 FPS animations
JavaScript
21
star
12

PrayerWheel

Produces positive karma when spinning, blessing all living beings around and purifying karma of the one who spins it
TypeScript
21
star
13

glsl-component

Lightweight library for GLSL rendered web components
HTML
17
star
14

HTML-Aircraft-Indicators

Indicators for multifunctional display built with HTML
CSS
16
star
15

Mobile-Transitions

High performance JavaScript library to emulate native mobile transitions. Designed to be as easy to use as possible. Just look to example.
JavaScript
11
star
16

Telekinesis-JS

JavaScript multiplayer game engine. Using Node.JS for server and any graphic library for client-side.
JavaScript
9
star
17

webgpu-vs-webgl-compute-matrix-multiplication

WebGL vs WebGPU vs JavaScript demo shows the difference in performance when naively multiplying some matrices
JavaScript
9
star
18

isAntialiasingSupportedForWebGL

gl.antialias=true does not guarantee it is actually going to be ON because browser accepts antialias attribute just as a hint and decides on itself there. This library checks for actual AA availability.
JavaScript
6
star
19

StyleObserver

The StylesObserver library provides the ability to watch for changes being made to the styles of the element
TypeScript
5
star
20

fps-control-chrome-extension

Control FPS in your browser for testing, performance investigation or to stress your app with dropped frames
JavaScript
4
star
21

GetterSetterJS

ะกross-browser way to getters and setters
JavaScript
4
star
22

PerFix

Rendering smoothness benchmark for scientific - blended performance optimization, written in JavaScript
JavaScript
3
star
23

QuickContext

ContextAPI state management made Easy. Less code more performance.
JavaScript
1
star
24

CodeTone

Let code play!
CSS
1
star