1.4.1 • Published 11 months ago

holesail-server v1.4.1

Weekly downloads
-
License
GNU GPL v3
Repository
github
Last release
11 months ago

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.
1.4.1

11 months ago

1.4.0

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago