Skip to content

ollikekalainen/lan-ns-ticker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lan-ns-ticker

Javascript client that notifies LanNS service at specified intervals that the web server / service on the local network is running.

Installation

npm install lan-ns-ticker

Usage

Initialization

const Ticker = require("lan-ns-ticker");
const ticker = new Ticker(options);

Options

url: <string>                       LanNS Service url
appName: <string>
appDescription: <string>            default: ""
appPort: <number>
appUrlPath: <string>                default: ""
appProtocol: <string>               default: "http"
refreshIntervalInSeconds: <number>  default: 60, min: 30
expireTimeInSeconds: <number>       default: 120, min: 2*refreshIntervalInSeconds
networkInterfaceFilter: <string>    default: "", e.g. "Local Area Connection" (Usefull when excluding private IP addresses for virtual Ethernet adapters. Can be also a semicolon-separated list of interface names.)

Methods

start( onError )
    onError  function(error)
    
    Starts the ticker object to sending notifications to LanNS service with specified intervals.
    
stop()
    Stops the ticker notifications.

Example

const Ticker = require("lan-ns-ticker")
new Ticker({
    url: "https://www.mylannsservice.net:3003",
    appName: "Musa",
    appDescription: "Musa Music Player",
    appPort: 3001,
    appProtocol: "http",
    appUrlPath: "",
    refreshIntervalInSeconds: 60,
    expireTimeInSeconds: 180
}).start(( error ) => { console.log( error ); });

About

Javascript client for notifying to the LanNS service that a web server/service on local network is up and running

Resources

License

Stars

Watchers

Forks

Packages

No packages published