3.1.11 • Published 1 year ago

@navify/discover v3.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Navify Discover

Simple UDP based protocol for service discovery implemented in pure JS. It is not mDNS or bonjour, but it tries to accomplish the same thing.

Spec

It uses a JSON based textual format:

const message = {
  t: now,
  id: 'unique',
  name: this.name,
  host: os.hostname(),
  ip: iface.address,
  port: number1,
  commPort: number2
};

return 'NAV_DP' + JSON.stringify(message);
keydescription
tunix timestamp in second
idunique id for this session
namename of the announced service
hosthostname of the machine announcing the service
ipipv4 address
porttcp port of the announced service
commPortoptional websocket port of the communication server

Installation

npm install @navify/discover

Usage

import { Publisher } from '@navify/discover';

const namespace = 'your-service';
const serviceName = 'Navify thing!';
const tcpPort = 8100;
const service = new Publisher(namespace, serviceName, tcpPort);

await service.start();
3.1.11

1 year ago

3.1.10

1 year ago

3.1.9

1 year ago

3.1.8

1 year ago

3.1.7

1 year ago

3.1.6

1 year ago

3.2.0-rc.0

1 year ago

3.1.5

1 year ago