peer-dns-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Peer DNS Client NPM Downloads

A small client to connect to a Peer DNS Server

Installation

npm install peer-dns-client

Description

This client implements events of the Peer DNS Server to always stay aligned with server package updates

Events

  • Link: An event triggered when a new peer connect to a domain that you are listening. It`s emits an object param with two properties:
  • Candidates: An event triggered when a peer with offer exchanged share it's candidates It`s emits an object param with two properties:
    • id: Identifier of external connection
    • candidates: An array of RTCIceCandidate

Methods

  • Query: Need only a parameter indicating a domain to join a listen for new connections

  • send.link: Used to response a link event with received id and optional offer

  • send.candidates: Used to share candidates with an id indicating the other peer and an array of candidates

  • exit: Used to stop listening connections in a domain

  • close: Used to close connection with Peer DNS Server

Package Sidebar

Install

npm i peer-dns-client

Weekly Downloads

17

Version

1.0.0

License

ISC

Unpacked Size

9.02 kB

Total Files

12

Last publish

Collaborators

  • xutyxd