Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

protomux-wakeup

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protomux-wakeup

Wakeup protocol over protomux

Source
npmnpm
Version
2.6.0
Version published
Weekly downloads
2.6K
-2.11%
Maintainers
1
Weekly downloads
 
Created
Source

protomux-wakeup

Wakeup protocol over protomux

npm install protomux-wakeup

Usage

const Wakeup = require('protomux-wakeup')

const w = new Wakeup()

w.addStream(stream)

const s = w.session(capability, {
  onpeeradd (peer) {
    // peer added
  },
  onpeerremove (peer) {
    // peer removed
  },
  onlookup (req, peer) {
    // received a lookup request
  },
  onannounce (wakeup, peer) {
    // received an announce message
  }
})

// the peers
s.peers

// request wakeup
s.lookup(peer, { hash })
s.announce(peer, [{ key, length }])

// or by stream
s.lookupByStream(stream, ...)
s.announceByStream(stream, ...)

// mark session as inactive, you must call this when done
s.inactive()

// cancel an inactive call
s.active()

// release the handlers
s.release()

License

Apache-2.0

FAQs

Package last updated on 26 Aug 2025

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