Socket
Book a DemoInstallSign in
Socket

grapevine-server

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grapevine-server

browser-to-browser messaging (server component)

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
2
Created
Source

Grapevine

Transmit live socket updates through a distributed client P2P network, instead of requiring the server to do all of the heavy lifting. Uses WebRTC and jsrsasign encryption.

Install

npm install grapevine-server

Example Use

server.js

var express = require('express');
var app = express();
var server = app.listen(3000);

var Grapevine = require('grapevine-server');
Grapevine.setup('/webrtc', app, server);

app.get('/sendMessage', function(req, res){
  Grapevine.messageAll('hello world');
  return res.sendStatus(200);
});

index.html

<script src="https://cdn.rawgit.com/mLuby/grapevine/master/client/grapevine-client.js"></script>
<script>
  Grapevine.connectToServer({ host:'localhost', port:3000, path:'/webrtc' });
  Grapevine.onMessage = function(message){
    document.getElementById('title').innerHTML = 'I heard '+JSON.stringify(message)+' through the Grapevine';
  };
</script>

FAQs

Package last updated on 25 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.