New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

actually-serverless

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

actually-serverless

Connecting peers using torrent technologies.

latest
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

Actually serverless

Connecting peers using torrent technologies.

Install

Easily create serverless web rtc connections based on a connection string.

npm install --save actually-serverless

or yarn

yarn add actually-serverless

usage

Here is a very basic usage.

import actuallyServerless from "actually-serverless"
let peers = []
const stopLookingForPeers = actuallyServerless({
    connectionString: "Any string you want to use to discover peers.",
    // each peer is an extended version of https://github.com/feross/simple-peer
    // with onMessage and sendMessage added.
    onPeer: peer => {
        peers.push(peer)
        peer.on('close', () => {
            peers = peers.filter(p => p !== peer)
        })
        peer.onMessage((meesage) => {
            console.log('message from a peer: ', message)
        }))
        peer.sendMessage("welcome to my peer group, I know about " + peers.length + " peers")
    }
})

// to teardown
stopLookingForPeers()
peers.forEach(peer => peer.destroy())

Try out the serverless chat room! See the source for more advanced usage.

See the readme for create react app, if you want to play with the demo src.

usage with webpack

Webtorrent is kind of a PITA with webpack. See: https://github.com/webtorrent/webtorrent/issues/347

You will probably run into issues with minifying, what you end up needing to do is split webpack into it's own bundle and ignore that bundle for minificaiton.

FAQs

Package last updated on 06 Jan 2020

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