🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

dotlocal

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotlocal

Easily announce and discover .local domains over mdns

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

dotlocal

Easily announce and discover .local domains over mdns

npm install dotlocal

Usage

var dotlocal = require('dotlocal')()

dotlocal.announce('test.local')

// on any machine on the local network (assuming it is multicast friendly)
dotlocal.lookup('test.local', function (err, ip) {
  if (err) throw err
  console.log('test.local --> ' + ip)
})

You can also find test.local using normal Unix tools, like ping

ping test.local

API

var announce = dotlocal.announce(domain)

Announce your local ip on the specified domain.

announce will emit question everytime someone tries to resolve the domain.

Call announce.destroy to stop announcing.

var query = dotlocal.lookup(domain, [options], [callback])

Do a lookup for the domain. If you specify a callback it will call that when it finds any ip resolving that domain or a timeout occurs.

If not query will emit answer with an answer object everytime an ip is discovered.

Call query.destroy to stop a query (not needed if you are providing a callback).

CLI

There is a cli available as well

npm install -g dotlocal
dotlocal announce test.local

Or to query

dotlocal lookup test.local

License

MIT

FAQs

Package last updated on 02 Dec 2017

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