1.0.0 • Published 5 months ago

peer-dns-client v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

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