npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rendezvous-point

v2.0.0

Published

Rendezvous points on the DHT where two authenticated peers can leave data

Downloads

4

Readme

rendezvous-point

Build Status

Rendezvous points on the DHT where two authenticated peers can leave data

Data could be eg. a ip:port pair

Usage

var rendezvous = require('rendezvous-point')

var keypairA = {publicKey: Buffer.from('...'), secretKey: Buffer.from('...')}
var peerA = rendezvous(dht, keypairA)

var keypairB = {publicKey: Buffer.from('...'), secretKey: Buffer.from('...')}
var peerB = rendezvous(dht, keypairB)

// Leave a message for peerB on the DHT
peerA.write(keypairB.publicKey, Buffer.from('Hello B!'), function (err) {
  if (err) throw err

  peerB.read(keypairA.publicKey, function (err, message) {
    if (err) throw err

    console.log(message.equal(Buffer.from('Hello B!')))
  })
})

API

var peer = rendezvous(dht, keypair)

Create a rendezvous instance for bittorrent-dht instance and a given libsodium X25519 key pair, eg. generated with crypto_kx_keypair

peer.write(recepientPublicKey, buf, cb)

Write a message buf at the rendezvous point between keypair and recepientPublicKey, calling cb(err, hash) with any error or the resulting hash key in the DHT.

peer.read(senderPublicKey, cb)

Read any message at the rendezvous point between keypair and senderPublicKey, calling cb(err, messageObj) with any error or the message left in the DHT with the DHT result object

Design

The rendezvous point is a public key generated from a seed, where the seed is the shared secret from a Diffie-Hellman key exchange between two peers. This means that either side can leave messages in the DHT at the rendezvous point, because both can generate the same key pair. The rendezvous point can therefore be seen as a shared mailbox between the two peers. A future extension may be to leave messages encrypted to the other party, so messages are only readable by the other party and no one else who happens upon the rendezvous point (eg. an adverse DHT node).

Install

npm install rendezvous-point

License

ISC