Socket
Socket
Sign inDemoInstall

overactiv

Package Overview
Dependencies
3
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    overactiv

Hyperactiv over WebSocket


Version published
Weekly downloads
5
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Overactiv

Hyperactiv over WebSocket + RPC

npm install overactiv

Plain WebSockets

const WebSocket = require('ws');
const overactiv = require('overactiv').server;
const wss = overactiv(new WebSocket.Server({ port: 8080 }));

const remoteObject = wss.host({ });

Express Server

const http = require('http');
const express = require('express');
const WebSocket = require('ws');
const overactiv = require('overactiv').server;
const app = express();
const server = http.createServer(app);
const wss = overactiv(new WebSocket.Server({ server }));

server.listen(8080);

Node WebSocket Client

const WebSocket = require('ws');
const overactiv = require('overactiv').client;
const remoteObject = overactiv(new WebSocket("ws://localhost:8080"));

remoteObject.someMethod();
remoteObject.value === "This has been set!";

Browser WebSocket Client

<html>
    <head>
        <script src="https://unpkg.com/hyperactiv" ></script>
        <script src="https://unpkg.com/hyperactiv/handlers/index.js" ></script>
        <script src="https://unpkg.com/overactiv/browser.js"></script>
    </head>
    <body onload="overactiv('ws://localhost:8080', window.remoteObject = { })">
        Check developer console for "remoteObject"
    </body>
</html>

Keywords

FAQs

Last updated on 26 Feb 2018

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc