Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 740 Bytes

README.md

File metadata and controls

36 lines (22 loc) · 740 Bytes

DiscoverProtocol

npm

Request service information to unknown server locations

Install

$ npm install @ramclen/discover-protocol

Usage

Server Side

import UDPServer, { ServerDiscoverProtocol } from '@ramclen/discover-protocol/server';

new UDPServer(new ServerDiscoverProtocol('ServiceName', {info: 'content'}) ).run();

Client Side

import DiscoverClient, { ClientDiscoverProtocol } from '@ramclen/discover-protocol/client';

new DiscoverClient(new ClientDiscoverProtocol('ServiceName', 'ProtocolName'))
  .run()
  .then(information => {
    console.log(information.info);
  });