Socket
Book a DemoInstallSign in
Socket

hyperpunch

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperpunch

new holepuncher

latest
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

hyperpunch

Note, that the API is still under development so subject to changes

const { Client } = require('hyperpunch')

const c = new Client([
  'bootstrap1.hyperdht.org',
  'bootstrap2.hyperdht.org'
])

// to join the swarm and accept connections on a public key:
await c.join(keyPair)

c.on('connection', function (noiseStream) {
  // emitted when a new connection is accepted
  // noiseStream is a NoiseSecretStream instance
})

// to connect to a public key to
const noiseStream = c.connect(publicKey, localKeyPair)

noiseStream.on('open', function () {
  console.log('stream is fully open')
})

noiseStream.write(Buffer.from('hello world'))

FAQs

Package last updated on 15 Apr 2021

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