Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ionic/discover

Package Overview
Dependencies
Maintainers
1
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ionic/discover

Simple UDP based protocol for service discovery implemented in pure JS.

  • 3.1.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9K
decreased by-27.8%
Maintainers
1
Weekly downloads
 
Created
Source

Ionic 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 'ION_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 @ionic/discover

Usage

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

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

await service.start();

FAQs

Package last updated on 19 Dec 2023

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