New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

holesail-server

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

holesail-server

Server module for holesail to create and announce local server on the DHT

  • 1.4.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51
decreased by-37.04%
Maintainers
0
Weekly downloads
 
Created
Source

holesail-server

Join our Discord Support Server

Create and announce your server on the HyperDHT P2P protocol.

Installation

npm i holesail-server 

Usage

Require as a module

const HolesailServer = require('holesail-server')

Create instance of the holesailServer class

const server =  new HolesailServer();

Start server and get the public key

server.serve({port:5000, address:"127.0.0.1"}, () => {
    console.log('Server started');
    console.log(server.getPublicKey());
    setTimeout(() => {
      server1.destroy();
      console.log('Server destroyed');
  }, 6000);
})

Optionally you can also set a buffSeed to generate the same connection key every time

server.serve({port:5000, address:"127.0.0.1",buffSeed:"4917816487c1822049939ff1abbf515663275105d01361bbc84fe2000e594539"}, () => {
    console.log('Server started');
    console.log(server.getPublicKey());
    setTimeout(() => {
      server1.destroy();
      console.log('Server destroyed');
  }, 6000);
})
//buffSeed needs to be of 64 char long

Destroy the DHT server

server.destroy();

Syntax:

server.serve(options,callback())
Options:
  • port: The port to listen on (required)
  • address: The local address, use 0.0.0.0 if you want to listen on all (required)
  • buffSeed: A 64 character long string, will be used as a buffer of the connector. Pass it if you want to use same connector everytime (Optional)
  • secure: (boolean) (optional) (Recommended). Prevents leaking access capability to HyperDHT. Listens on a different seed than the one needed to connect on.
  • udp: (boolean) (optional). Start a udp connection instead of TCP.

Keywords

FAQs

Package last updated on 07 Jan 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc