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

zlorp

v2.0.1

Published

OTR encrypted, NAT-breaking p2p conversations

Downloads

33

Readme

zlorp

P2P comm module, meant more as infrastructure for peer to peer applications than a chat client.

Find peers on the internet via the BitTorrent DHT, knowing only their public keys (or public key fingerprint), and send structured data to each other with OTR messaging.

This module is used by Tradle

inspired by bluntly

Discovery schemes

Usage

Basic

var DSA = require('otr').DSA
var Zlorp = require('zlorp')
var myKey = DSA.parsePrivate('...my private DSA key...')

// DSA key fingerprints, e.g. myKey's fingerprint is myKey.fingerprint()
var billFingerprint = 'c7164fc272efc11ab218175ae9c9112333fb473f' 
var tedFingerprint = '6127a5b679f880a4680479ecff9e770ffe4172ae' 

var me = new Zlorp({
  dht: './dht.json', // where to back up the dht
  key: myKey,
  port: 12345
})

// names are optional
me.contact({
  identifier: billFingerprint, 
  name: 'Bill S. Preston Esquire'
})

me.contact({
  identifier: tedFingerprint, 
  name: 'Ted Theodore Logan'
})

me.send('excellent!', tedFingerprint)
me.send('party on, dude!', billFingerprint)

Strangers

Because of the way discovery in the BitTorrent DHT works, you may learn information about another party in pieces, especially if you're being approached by strangers. Below is an example of how to handle the two stages of being approached by a stranger, with two events triggered by your zlorp instance:

'knock'

You know their ip:port (addr), but not their DSA key public key or fingerprint, or even their DSA fingerprint's infoHash

b.on('knock', function(addr) {
  // we don't know who it is (their infoHash), just their address
  // if you don't want to talk to them, ignore this event
  // if you do:
  b.connect(addr)
})

'connect'

You now know everything you can know about the other party without access to their medical records: their ip:port and their DSA public key. You can still bail and not get into their tinted-windowed car.

b.on('connect', function(pubKey, addr) {
  // OTR with this party has passed the AKE successfully
  // you now know their pubKey
  // if you don't want to talk to them 
  //   you can issue b.removePeerWith('pubKey', pubKey)
})

Ignore Strangers

zlorp.ignoreStrangers()

Playing coy

You can go into a sort of "away" mode. All this really means is that you stop screaming "HEY! LOOK AT ME!" into the DHT

Keep in mind that "presence" information sticks around in the DHT for a while, so it may take time before your unavailability asserts itself

zlorp.unavailable()

Remote example

node example/remote.js [username] [port]

example/remote.js has a couple of keys for Bill and Ted, the most excellent friends, so you can try connecting to someone on another computer. Yes, you can be Ted since you asked nicely.

You run:

node example/remote.js ted 12345

They run:

node example/remote.js ted 12345

When you're connected, you'll feel it

Todo

  • Improve reconnect
  • replace rudp with utp
  • add duplex streaming interface to OTR client - c.pipe(otr).pipe(c)