Socket
Socket
Sign inDemoInstall

dht-infohash-pub

Package Overview
Dependencies
17
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dht-infohash-pub

Crawls the DHT Network and publishes infohashes using ØMQ.


Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

dht-infohash-pub

Crawl the DHT network for resource infohashes and publish them using ØMQ

This program wraps dht-infohash-crawler in a Node.js command line executive.

Features

  • Option to create multiple DHT crawler instances
  • Find peers from the DHT network

Requirement

Install ØMQ for your platform. And then install ØMQ bindings for Node.js.

npm install zmq

If Node.js is upgraded or downgraded after npm install zmq, please run npm rebuild to rebuild ØMQ bindings.

If you experience binding problems like Error: Could not locate the bindings file., please change to dht-infohash-pub's directory and run npm rebuild to rebuild ØMQ bindings.

Install

npm install dht-infohash-pub

Usage:

node dht-infohash-pub.js [options]

  Options:

    -h, --help          output usage information
    -V, --version       output the version number
    -q, --quiet         Do not log infohashes to the console
    -n, --number <n>    Number of crawler instance, default = 2
    -a, --dhtaddr <da>  DHT network listening address, default = 0.0.0.0
    -p, --dhtport <dp>  DHT network listening port, default = 6881
    -k, --kbucket <k>   DHT k-bucket size, default = 128
    --zmqaddr <za>      ØMQ publishing address, default = 0.0.0.0
    --zmqport <zp>      ØMQ publishing port, default = 65534

Subscribe to the ØMQ publisher:

const zmq = require('zmq');
const sub = zmq.socket('sub');

sub.on('message', function (...args) {
  console.log(`${args.reduce((prev, curr) => prev+curr)}`);
});
sub.connect('tcp://PUBLISHER_IP_ADDRESS:PUBLISHER_PORT');
sub.subscribe('');

Subscribe to the ØMQ publisher, use subscriber side filter:

const zmq = require('zmq');
const sub = zmq.socket('sub');

sub.on('message', function (...args) {
  console.log(`${args.reduce((prev, curr) => prev+curr)}`);
});
sub.connect('tcp://PUBLISHER_IP_ADDRESS:PUBLISHER_PORT');
// Only subscribe to infohashes starting from '89abcdef'
['8', '9', 'a', 'b', 'c', 'd', 'e', 'f']
  .map(letter => sub.subscribe(letter));

License

MIT © Hong Yan.

Keywords

FAQs

Last updated on 15 Dec 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc