Nominal Package Missing

    overactiv

    0.2.4 • Public • Published

    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>

    Install

    npm i overactiv

    DownloadsWeekly Downloads

    4

    Version

    0.2.4

    License

    MIT

    Unpacked Size

    9.13 kB

    Total Files

    8

    Last publish

    Collaborators

    • triploc