mdp

multicast-dns-peer

Find peers using multicast-dns

Showing:

Popularity

Downloads/wk

3

GitHub Stars

1

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

4

Size (min+gzip)

9.7KB

License

BSD-2-Clause

Type Definitions

Tree-Shakeable

No?

Categories

Readme

multicast-dns-peer

Find peers using multicast-dns.

Install

npm install --save multicast-dns-peer

Use

var mdp = require('multicast-dns-peer')('yolopeers')
mdp.on('peer', function(peer) {
    console.log(peer)
    mdp.destroy()
})

The default peer information is not very useful, it only contains the peer id. You'll typically want to add some additional answer records with connection information.

Options

var mdp = require('multicast-dns-peer')('yolopeers', {
    queryInterval : 2000, // how often to query for peers (default 5000)
    answers : [           // additional peer records 
        { 
            name : 'peer2', 
            type : 'A', 
            ttl  : 300, 
            data : '192.168.1.2' 
        },
        {
            name : 'yolo-service',
            type : 'SRV',
            data : {
                port   : 9999,
                target : 'yolo-service.yolopeers.com'
            }
        }
    ]
})

enjoy.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial