[nodejs] mDNS/zeroconf/bonjour service discovery add-on

627 views
Skip to first unread message

David Siegel

unread,
May 3, 2010, 5:54:31 PM5/3/10
to nod...@googlegroups.com
Hi everyone.
I'm absolutely new to node.js. Nevertheless, last weekend i somehow
found myself hacking on a mDNS add-on. Although it is quite
unfinished, lacking error handling, tests and documentation it already
does something (useful). To advertise a service do:

var mDNS = require('./mDNS');
var ad = mDNS.createAdvertisement('http', 4321, mDNS.TCP);
ad.start();

To browse for a service do:

var browser = mDNS.createBrowser('http', mDNS.TCP);
browser.addListener('serviceUp', function(info) { p('found', info); });
browser.addListener('serviceDown', function(info) { p('gone', info); });
browser.start();

The source code is available here:

http://github.com/agnat/node_mDNS

Comments, suggestions and patches are more than welcome.

Cheers,
David

--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.

Matthew Ranney

unread,
May 3, 2010, 6:12:27 PM5/3/10
to nod...@googlegroups.com
On Mon, May 3, 2010 at 2:54 PM, David Siegel <da...@artcom.de> wrote:
[...] 
var browser = mDNS.createBrowser('http', mDNS.TCP);
browser.addListener('serviceUp', function(info) { p('found', info); });
browser.addListener('serviceDown', function(info) { p('gone', info); });
browser.start();

Hey, that's really cool.  Thanks for making that.
 

Tim Caswell

unread,
May 3, 2010, 6:19:06 PM5/3/10
to nod...@googlegroups.com
Awesome, get this production quality and it will be super useful!

Brian Parkinson

unread,
Mar 13, 2011, 10:41:29 AM3/13/11
to nod...@googlegroups.com
HI - trying to run this (super-useful), but getting an error when
I start my node.js server.

I'm including:

var mdns = require('../agnat/node_mdns/lib/mdns');

the error is below - stats that the load cannot find the 'binding.js' file.
I have none. As well, your README.textile file states:

node-waf configure build && ./run_tests

I only see a 'run_tests' script, no configure or build.

Thanks.

b...

liaison: ./start

node.js:116
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module './binding'
at Function._resolveFilename (module.js:299:11)
at Function._load (module.js:245:25)
at require (module.js:327:19)
at Object.<anonymous>
(/Users/parki/hg/tip/liaiso...mdns_service.js:1:76)
at Module._compile (module.js:383:26)
at Object..js (module.js:389:10)
at Module.load (module.js:315:31)
at Function._load (module.js:276:12)
at require (module.js:327:19)
liaison: ./start

Nicholas Campbell

unread,
Mar 13, 2011, 2:05:15 PM3/13/11
to nod...@googlegroups.com, Tim Caswell
+1
Reply all
Reply to author
Forward
0 new messages