Code Monkey home page Code Monkey logo

node_mdns's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node_mdns's Issues

Install fails Centos

I get the following while trying to npm install mdns

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install', 'mdns' ]
2 info using [email protected]
3 info using [email protected]
4 verbose read json /root/node-tests/package.json
5 verbose read json /root/node-tests/node_modules/vitals/package.json
6 verbose read json /root/node-tests/node_modules/test/package.json
7 verbose read json /root/node-tests/node_modules/should/package.json
8 verbose read json /root/node-tests/package.json
9 verbose cache add [ 'mdns', null ]
10 silly cache add name=undefined spec="mdns" args=["mdns",null]
11 verbose parsed url { pathname: 'mdns', path: 'mdns', href: 'mdns' }
12 silly lockFile 5e6f4f79-mdns mdns
13 verbose lock mdns /root/.npm/5e6f4f79-mdns.lock
14 silly lockFile 5e6f4f79-mdns mdns
15 verbose addNamed [ 'mdns', '' ]
16 verbose addNamed [ null, '' ]
17 silly lockFile 5f1e5f16-mdns mdns@
18 verbose lock mdns@ /root/.npm/5f1e5f16-mdns.lock
19 silly addNameRange { name: 'mdns', range: '', hasData: false }
20 verbose url raw mdns
21 verbose url resolving [ 'https://registry.npmjs.org/', './mdns' ]
22 verbose url resolved https://registry.npmjs.org/mdns
23 info trying registry request attempt 1 at 20:01:38
24 verbose etag "7WBHGETKNT1GCWJ9KQT3ASHNM"
25 http GET https://registry.npmjs.org/mdns
26 http 304 https://registry.npmjs.org/mdns
27 silly registry.get cb [ 304,
27 silly registry.get   { server: 'CouchDB/1.2.0 (Erlang OTP/R15B)',
27 silly registry.get     etag: '"7WBHGETKNT1GCWJ9KQT3ASHNM"',
27 silly registry.get     date: 'Mon, 03 Dec 2012 01:00:56 GMT',
27 silly registry.get     'content-length': '0' } ]
28 verbose etag mdns from cache
29 silly addNameRange number 2 { name: 'mdns', range: '', hasData: true }
30 silly addNameRange versions [ 'mdns', [ '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7' ] ]
31 verbose addNamed [ 'mdns', '0.0.7' ]
32 verbose addNamed [ '0.0.7', '0.0.7' ]
33 silly lockFile 7006f484-mdns-0-0-7 [email protected]
34 verbose lock [email protected] /root/.npm/7006f484-mdns-0-0-7.lock
35 verbose read json /root/.npm/mdns/0.0.7/package/package.json
36 silly lockFile 7006f484-mdns-0-0-7 [email protected]
37 silly lockFile 5f1e5f16-mdns mdns@
38 silly resolved [ { name: 'mdns',
38 silly resolved     version: '0.0.7',
38 silly resolved     description: 'multicast DNS service discovery',
38 silly resolved     main: './lib/mdns.js',
38 silly resolved     scripts: { test: 'utils/testrun', install: 'node-gyp rebuild' },
38 silly resolved     keywords: [ 'zeroconf', 'bonjour', 'dns_sd', 'mDNSResponder' ],
38 silly resolved     devDependencies:
38 silly resolved      { ejs: '*',
38 silly resolved        less: '*',
38 silly resolved        mkdirp: '*',
38 silly resolved        nopt: '*',
38 silly resolved        slide: '*',
38 silly resolved        glob: '*',
38 silly resolved        ncp: '*',
38 silly resolved        minimatch: '*' },
38 silly resolved     repository: { type: 'git', url: 'http://github.com/agnat/node_mdns.git' },
38 silly resolved     homepage: 'http://agnat.github.com/node_mdns',
38 silly resolved     bugs: { url: 'http://github.com/agnat/node_mdns/issues' },
38 silly resolved     licenses: [ [Object] ],
38 silly resolved     author: { name: 'David Siegel', email: '[email protected]' },
38 silly resolved     contributors: [ [Object], [Object], [Object], [Object] ],
38 silly resolved     gypfile: true,
38 silly resolved     readme: 'h1. mdns -- node.js Service Discovery\n\n|_. Package:       | mdns |\n|_. Description:   | multicast DNS service discovery |\n|_. Version:       | 0.0.7 |\n|_. Installation:  | @npm install mdns@ |\n|_. Documentation: | "mdns user guide":http://agnat.github.com/node_mdns/user_guide.html |\n|_. License:       | "MIT":http://github.com/agnat/node_mdns/blob/master/LICENSE |\n\nmdns adds multicast DNS service discovery, also known as zeroconf or bonjour to "node.js":/joyent/node. It provides an object based interface to announce and browse services on the local network.\n\nh2. Synopsis\n\nbc.. // import the module\nvar mdns = require(\'mdns\');\n\n// advertise a http server on port 4321\nvar ad = mdns.createAdvertisement(mdns.tcp(\'http\'), 4321);\nad.start();\n\n// watch all http servers\nvar browser = mdns.createBrowser(mdns.tcp(\'http\'));\nbrowser.on(\'serviceUp\', function(service) {\n  console.log("service up: ", service);\n});\nbrowser.on(\'serviceDown\', function(service) {\n  console.log("service down: ", service);\n});\nbrowser.start();\n\n// discover all available service types\nvar all_the_types = mdns.browseThemAll(); // all_the_types is just another browser...\n\nh2. Installation\n\nmdns is available as a npm package:\n\nbc. npm install mdns\n\nOn Linux and other systems using the avahi daemon the avahi dns_sd compat library and its header files are required.  On debianesque systems the package name is @libavahi-compat-libdnssd-dev@.  On other platforms Apples "mDNSResponder":http://opensource.apple.com/tarballs/mDNSResponder/ is recommended. Care should be taken not to install more than one mDNS stack on a system. \n\nIf you want to play with the latest source code, here is a more manual approach:\n\nbc.. git clone http://github.com/agnat/node_mdns\ncd node_mdns\nnpm link && npm test\n\nh2. Documentation\n\nSee the "user guide":http://agnat.github.com/node_mdns/user_guide.html.\n\nh2. Contributors\n\n... in random order:\n\n* Orlando Vazquez ("@orlandov":http://github.com/orlandov)\n* Ryan Dahl ("@ry":http://github.com/ry)\n* Dominic Tarr ("@dominictarr":http://github.com/dominictarr)\n* Emil Stenqvist ("@emilisto":http://github.com/emilisto)\n\nYour name is missing on the list? Shame on me. Please open an issue.\n\nh2. Bugs and Contributions\n\nIf you find a bug, please report it using the "issue tracker":http://github.com/agnat/node_mdns/issues.\n\n<!-- vim: set linebreak filetype=textile spell spelllang=en_us : -->\n',
38 silly resolved     readmeFilename: 'README.textile',
38 silly resolved     _id: '[email protected]',
38 silly resolved     _from: 'mdns' } ]
39 info install [email protected] into /root/node-tests
40 info installOne [email protected]
41 verbose from cache /root/.npm/mdns/0.0.7/package/package.json
42 info /root/node-tests/node_modules/mdns unbuild
43 verbose read json /root/node-tests/node_modules/mdns/package.json
44 verbose tar unpack /root/.npm/mdns/0.0.7/package.tgz
45 silly lockFile 9f1d2d5e-oot-node-tests-node-modules-mdns /root/node-tests/node_modules/mdns
46 verbose lock /root/node-tests/node_modules/mdns /root/.npm/9f1d2d5e-oot-node-tests-node-modules-mdns.lock
47 silly gunzTarPerm modes [ '755', '644' ]
48 silly gunzTarPerm extractEntry package.json
49 silly gunzTarPerm extractEntry .npmignore
50 silly gunzTarPerm extractEntry LICENSE
51 silly gunzTarPerm extractEntry CHANGES
52 silly gunzTarPerm extractEntry examples/express_app.js
53 silly gunzTarPerm extractEntry tests/test_dns_sd.js
54 silly gunzTarPerm extractEntry tests/test_odd_ends.js
55 silly gunzTarPerm extractEntry tests/test_functional.js
56 silly gunzTarPerm extractEntry tests/test_service_type.js
57 silly gunzTarPerm extractEntry binding.gyp
58 silly gunzTarPerm extractEntry src/txt_record_buffer_to_object.cpp
59 silly gunzTarPerm extractEntry src/dns_service_get_addr_info.cpp
60 silly gunzTarPerm extractEntry src/txt_record_create.cpp
61 silly gunzTarPerm extractEntry src/skeleton.cpp_
62 silly gunzTarPerm extractEntry src/mdns_utils.cpp
63 silly gunzTarPerm extractEntry src/dns_service_browse.cpp
64 silly gunzTarPerm extractEntry src/txt_record_deallocate.cpp
65 silly gunzTarPerm extractEntry src/dns_service_process_result.cpp
66 silly gunzTarPerm extractEntry src/dns_service_ref_deallocate.cpp
67 silly gunzTarPerm extractEntry src/winsock_watcher.hpp
68 silly gunzTarPerm extractEntry src/dns_sd.cpp
69 silly gunzTarPerm extractEntry src/dns_service_ref.cpp
70 silly gunzTarPerm extractEntry src/dns_service_enumerate_domains.cpp
71 silly gunzTarPerm extractEntry src/mdns.hpp
72 silly gunzTarPerm extractEntry src/mdns_settings.hpp
73 silly gunzTarPerm extractEntry src/demangle.cpp
74 silly gunzTarPerm extractEntry src/dns_service_ref_sock_fd.cpp
75 silly gunzTarPerm extractEntry src/txt_record_set_value.cpp
76 silly gunzTarPerm extractEntry src/mdns_utils.hpp
77 silly gunzTarPerm extractEntry src/txt_record_ref.hpp
78 silly gunzTarPerm extractEntry src/dns_service_ref.hpp
79 silly gunzTarPerm extractEntry src/winsock_watcher.cpp
80 silly gunzTarPerm extractEntry src/txt_record_ref.cpp
81 silly gunzTarPerm extractEntry src/dns_service_register.cpp
82 silly gunzTarPerm extractEntry src/txt_record_get_length.cpp
83 silly gunzTarPerm extractEntry src/dns_service_resolve.cpp
84 silly gunzTarPerm extractEntry lib/dns_sd.js
85 silly gunzTarPerm extractEntry lib/mdns_service.js
86 silly gunzTarPerm extractEntry lib/browser.js
87 silly gunzTarPerm extractEntry lib/advertisement.js
88 silly gunzTarPerm extractEntry lib/resolver_sequence_tasks.js
89 silly gunzTarPerm extractEntry lib/io_watcher.js
90 silly gunzTarPerm extractEntry lib/mdns.js
91 silly gunzTarPerm extractEntry lib/service_type.js
92 silly gunzTarPerm extractEntry utils/coverage
93 silly gunzTarPerm extractEntry utils/docpack
94 silly gunzTarPerm extractEntry utils/render_report
95 silly gunzTarPerm extractEntry utils/testrun
96 silly gunzTarPerm extractEntry utils/lib/ncov.js
97 silly gunzTarPerm extractEntry utils/lib/lcov.js
98 silly gunzTarPerm extractEntry utils/lib/bunch.js
99 silly gunzTarPerm extractEntry utils/lib/view.js
100 silly gunzTarPerm extractEntry utils/lib/actors.js
101 silly gunzTarPerm extractEntry utils/lib/compiler.js
102 silly gunzTarPerm extractEntry utils/lib/obj.js
103 silly gunzTarPerm extractEntry utils/lib/mdns_test.js
104 silly gunzTarPerm extractEntry utils/jsf
105 silly gunzTarPerm extractEntry Makefile
106 silly gunzTarPerm extractEntry wscript
107 silly gunzTarPerm extractEntry node-waf.bat
108 silly gunzTarPerm extractEntry README.textile
109 verbose read json /root/node-tests/node_modules/mdns/package.json
110 silly lockFile 9f1d2d5e-oot-node-tests-node-modules-mdns /root/node-tests/node_modules/mdns
111 info preinstall [email protected]
112 verbose from cache /root/node-tests/node_modules/mdns/package.json
113 verbose readDependencies using package.json deps
114 verbose from cache /root/node-tests/node_modules/mdns/package.json
115 verbose readDependencies using package.json deps
116 silly resolved []
117 verbose about to build /root/node-tests/node_modules/mdns
118 info build /root/node-tests/node_modules/mdns
119 verbose from cache /root/node-tests/node_modules/mdns/package.json
120 verbose linkStuff [ false, false, false, '/root/node-tests/node_modules' ]
121 info linkStuff [email protected]
122 verbose linkBins [email protected]
123 verbose linkMans [email protected]
124 verbose rebuildBundles [email protected]
125 info install [email protected]
126 verbose unsafe-perm in lifecycle false
127 silly exec sh "-c" "node-gyp rebuild"
128 silly sh,-c,node-gyp rebuild,/root/node-tests/node_modules/mdns spawning
129 info [email protected] Failed to exec install script
130 info /root/node-tests/node_modules/mdns unbuild
131 verbose from cache /root/node-tests/node_modules/mdns/package.json
132 info preuninstall [email protected]
133 info uninstall [email protected]
134 verbose true,/root/node-tests/node_modules,/root/node-tests/node_modules unbuild [email protected]
135 info postuninstall [email protected]
136 error [email protected] install: `node-gyp rebuild`
136 error `sh "-c" "node-gyp rebuild"` failed with 1
137 error Failed at the [email protected] install script.
137 error This is most likely a problem with the mdns package,
137 error not with npm itself.
137 error Tell the author that this fails on your system:
137 error     node-gyp rebuild
137 error You can get their info via:
137 error     npm owner ls mdns
137 error There is likely additional logging output above.
138 error System Linux 2.6.32-279.14.1.el6.x86_64
139 error command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "mdns"
140 error cwd /root/node-tests
141 error node -v v0.8.15
142 error npm -v 1.1.66
143 error code ELIFECYCLE
144 verbose exit [ 1, true ]

Crash due to "Unknown Error"

Hi, so we're seeing crash in the following function because serviceName, serviceType and replyDomain are NULL, which occurs when DNSServiceErrorType is -65537, aka "Uknown Error". We haven't figured out what is causing the unknown error, but regardless mdns shouldn't crash when this happens.

static
void
DNSSD_API
OnServiceChanged(DNSServiceRef sdRef, DNSServiceFlags flags, 
        uint32_t interfaceIndex, DNSServiceErrorType errorCode, 
        const char * serviceName, const char * serviceType,
        const char * replyDomain, void * context)
{
    HandleScope scope;
    ServiceRef * serviceRef = static_cast<ServiceRef*>(context);
    Handle<Function> callback = serviceRef->GetCallback();
    Handle<Object> this_ = serviceRef->GetThis();

    const size_t argc(8);
    Local<Value> args[argc];
    args[0] = Local<Object>::New(serviceRef->handle_);
    args[1] = Integer::New(flags);
    args[2] = Integer::New(interfaceIndex);
    args[3] = Integer::New(errorCode);
    args[4] = String::New(serviceName);
    args[5] = String::New(serviceType);
    args[6] = String::New(replyDomain);
    if (serviceRef->GetContext().IsEmpty()) {
        args[7] = Local<Value>::New(Undefined());
    } else {
        args[7] = Local<Value>::New(serviceRef->GetContext());
    }
    callback->Call(this_, argc, args);
}

Our fix is as so:

    if(serviceName)
      args[4] = String::New(serviceName);
    else
      args[4] = Local<Value>::New(Undefined());
    if(serviceType)
      args[5] = String::New(serviceType);
    else
      args[5] = Local<Value>::New(Undefined());
    if(replyDomain)
      args[6] = String::New(replyDomain);
    else
      args[6] = Local<Value>::New(Undefined());

Browser's autoResolve option broken

Setting autoResolve to false in Browser's options has no effect, since it's stored with

self.autoresolve = options.autoResolve || true;

Any falsey value therefore results in the flag being set to true.

DNSServiceResolve fails with browseThemAll

This is probably not a bug, but rather something I don't understand.

I'm using .browseThemAll to find all local services, and I'd like to know which machines they are on (even just the MAC address would do). However, I can't seem to do that, despite attempts to pass a resolver sequence in.

It seems to come down to the fact that DNSServiceResolve() requires a machine name to resolve, and the wildcard searches don't have that information. Is there a resolver sequence that will work for wildcards? I've not been able to find one with my various attempts. If so, it might be worth adding to the docs.

OS X: install broke somewhere between 0.6.8 and 0.6.15

Just discovered that someone went wonky after node 0.6.8 regarding installing node mdns on Mac OS X:
(It was working fine in 0.6.8)

$ npm install mdns
npm http GET https://registry.npmjs.org/mdns
npm http 304 https://registry.npmjs.org/mdns

[email protected] install /Users/railnerd/mdnsfun/node_modules/mdns
node-gyp rebuild

info it worked if it ends with ok
info downloading: http://nodejs.org/dist/v0.6.15/node-v0.6.15.tar.gz
spawn python [ '/Users/railnerd/.node-gyp/0.6.15/tools/gyp_addon',
'binding.gyp',
'-I/Users/railnerd/mdnsfun/node_modules/mdns/build/config.gypi',
'-f',
'make' ]
Traceback (most recent call last):
File "/Users/railnerd/.node-gyp/0.6.15/tools/gyp_addon", line 38, in
rc = gyp.main(gyp_args)
File "/Users/railnerd/.node-gyp/0.6.15/tools/gyp/pylib/gyp/init.py", line 471, in main
options.circular_check)
File "/Users/railnerd/.node-gyp/0.6.15/tools/gyp/pylib/gyp/init.py", line 111, in Load
depth, generator_input_info, check, circular_check)
File "/Users/railnerd/.node-gyp/0.6.15/tools/gyp/pylib/gyp/input.py", line 2289, in Load
depth, check)
File "/Users/railnerd/.node-gyp/0.6.15/tools/gyp/pylib/gyp/input.py", line 361, in LoadTargetBuildFile
includes, True, check)
File "/Users/railnerd/.node-gyp/0.6.15/tools/gyp/pylib/gyp/input.py", line 208, in LoadOneBuildFile
raise Exception("%s not found (cwd: %s)" % (build_file_path, os.getcwd()))
Exception: binding.gyp not found (cwd: /Users/railnerd/mdnsfun/node_modules/mdns) while trying to load binding.gyp
ERR! Error: gyp_addon failed with exit code: 1
at Array.0 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:196:18)
at EventEmitter._tickCallback (node.js:192:40)
ERR! not ok

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! sh "-c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls mdns
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Darwin 11.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "mdns"
npm ERR! cwd /Users/railnerd/mdnsfun
npm ERR! node -v v0.6.15
npm ERR! npm -v 1.1.16
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: node-gyp rebuild
npm ERR! message sh "-c" "node-gyp rebuild" failed with 1
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/railnerd/mdnsfun/npm-debug.log
npm not ok
$

EXC_BAD_ACCESS from on_service_registered

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000003
0x0000000100041e20 in v8::Object::InternalFieldCount ()
(gdb) where
#0  0x0000000100041e20 in v8::Object::InternalFieldCount ()
#1  0x0000000125873934 in node::ObjectWrap::Unwrap<node_mdns::Advertisement> (handle={val_ = 0x1004a5ce0}) at node_object_wrap.h:51
#2  0x000000012586fc0b in node_mdns::Advertisement::on_service_registered (unnamed_arg=0x100716b00, flags=2, errorCode=0, name=0x7fff5fbff698 "Christians Mac", regtype=0x7fff5fbff2a7 "_evo._tcp.", domain=0x7fff5fbfeeb6 "96429962.members.btmm.icloud.com.", context=0x100717d10) at advertisement.cpp:244
#3  0x00007fff8f47d521 in handle_regservice_response ()
#4  0x00007fff8f47eacc in DNSServiceProcessResult ()
#5  0x0000000125863901 in node_mdns::mDNSBase::Event (this=0x100716bd0, revents=1) at mdns_base.cpp:77
#6  0x0000000125863852 in node_mdns::mDNSBase::io_event (w=0x100716bf0, revents=1) at mdns_base.cpp:86
#7  0x00000001000309b7 in ev_invoke_pending ()
#8  0x000000010003470d in ev_run ()
#9  0x0000000100004d40 in node::Start ()
#10 0x00000001000011d4 in start ()

Use Avahi DBus interface

The avahi dns_sd compat library is somewhat limited. Better use avahis DBus interface. To do so, I need a node dbus implementation. I currently have two experiments going:

  • a libdbus binding
  • an implementation of the dbus protocol in javascript

Expose browser.resolve(...)

Currently there is no way to run a resolver sequence later on. browser.resolve(...) should be refactored into a proper actor.

failure to install on latest Ubuntu 11.04 + nodejs 0.6.2

dave@ubu:~/Sources/webhack$ npm install mdns
npm WARN [email protected] package.json: bugs['web'] should probably be bugs['url']

[email protected] install /home/dave/Sources/webhack/node_modules/mdns
node-waf configure build

Setting srcdir to : /home/dave/Sources/webhack/node_modules/mdns
Setting blddir to : /home/dave/Sources/webhack/node_modules/mdns/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
'configure' finished successfully (0.321s)
Waf: Entering directory /home/dave/Sources/webhack/node_modules/mdns/build' [1/7] cxx: src/mdns_base.cpp -> build/Release/src/mdns_base_1.o In file included from ../src/mdns_base.cpp:1:0: ../src/mdns_base.hpp:4:25: fatal error: node_events.h: No such file or directory compilation terminated. Waf: Leaving directory/home/dave/Sources/webhack/node_modules/mdns/build'
Build failed: -> task failed (err #1):
{task: cxx mdns_base.cpp -> mdns_base_1.o}
npm ERR! error installing [email protected] Error: [email protected] install: node-waf configure build
npm ERR! error installing [email protected] sh "-c" "node-waf configure build" failed with 1
npm ERR! error installing [email protected] at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected] at ChildProcess.emit (events.js:70:17)
npm ERR! error installing [email protected] at maybeExit (child_process.js:359:16)
npm ERR! error installing [email protected] at Process.onexit (child_process.js:395:5)
npm ERR! [email protected] install: node-waf configure build
npm ERR! sh "-c" "node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls mdns
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 3.0.0-13-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "mdns"
npm ERR! cwd /home/dave/Sources/webhack
npm ERR! node -v v0.6.2
npm ERR! npm -v 1.0.106
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/dave/Sources/webhack/npm-debug.log
npm not ok

Adding maintainers to project?

Agnat -

Great work putting this module together, thank you!

We are now using your project as the primary mdns module for the hook.io project ( see: https://github.com/emilisto/node_mdns and https://github.com/hookio )

As more people start to test your node_mdns, we've been noticing a few minor issues. Most of these have already been reported at https://github.com/agnat/node_mdns/issues @emilisto has been the primary person integrating mdns to hook.io

It's to important for me that we'll be able to quickly push updates to node_mdns ( since it's now going to be heavily depended on ). The obvious solution would be for me to fork the project and maintain a new npm module ( maybe mdns2 ), but I'd much rather help contribute back to your project and not create another npm module.

Would you be willing to add me as a contributor to your project on Github and npm? Please let me know.

Thanks again! :-)

How to handle mDNS (avahi-daemon) stop

Hello, how is it possible to handle a stop/start of hte mDNS daemon (avahi-daemon for me on debian).

In case of daemon stop, what can we do to restart the advertising service?
Thx.

Rewrite the Test Suite

Goals:

  • write and use test infrastructure that helps with common tasks
  • guard against concurrent test runs on the same network
  • overall a more systematic approach
  • better coverage

Node/mdns API conflict?

net.Server and sub-types use listen(port, [host], [cb]) to determine which port and address to listen on; mdns supports 'host' in the options hash, but specifying it results in only service shutdowns being reported by the browser. mdns also supports the 'interfaceIndex' option, which does seem to constrain advertisements to reporting service at a singe IP address. However, as far as I know, Node doesn't provide any mechanism for converting a hostname or IP address into a local interface index.

For API compatibility, it would seem that mdns should resolve 'host' to an IP address using the same semantics as Node does, then determine the interface index(s) associated with that IP automatically.

Feature request: limit to localhost

I'm not sure if this is possible to do with mDNS or if the option already exist, but when working in a development environment it would be quite nice to be able to limit the mDNS Advertisement and Browser to localhost.

Multiple serviceUp events

var mdns = require('mdns'),
    ad = mdns.createAdvertisement('osc', 9000, 'udp'),
    browser = mdns.createBrowser('osc', 'udp');

browser.on('serviceUp', function(info, flags) {
  console.log("Up:", info);
});

ad.start();
browser.start();

I am unsure why this happens.

Re-advertsing a record with a changed txtRecord doesn't work as expected.

Hi,

I'm trying to use your node_mdns module to advertise not only the existence of a server but specifics about the service.

So imagine for a moment that I wanted to advertise the list of current logged in users on my linux system, and when it changed I wanted to update the txtRecord with a current list of logged in users:

And every time my list of users changed I did the following:

if(mdnsAd!=null){
mdnsAd.stop();
}
var currentUsers = Users.loggedIn();
var now = new Date();

mdns.createAdvertisement(
mdns.tcp('user-watch'), config.port, { txtRecord: { users: currentUsers, updatedAt: now }},function(err,service){
mdnsAd = service;
mdnsAd.start();
});

Well what happens is it seems like the first advertisement I did, regardless of calling stop on it, is used from there on out. So if user 'A' was logged in the first time I created an advertisment, and then user 'B' logged in, I would breifly get an advertisement containing 'A,B', but then the advertisement reverts back to 'A', and has the updatedAt set to the first advertisement's timestamp.

Is this expected behavior?

Keeping track of service up/down state

Hi,

I see a potential need to be aware of services going down. Currently, the serviceDown event is useless, in the sense that it doesn't tell you which service (as mentioned in issue #8) went down. I believe there is an elegant and by-the-book way to do this.

One can keep track of a service's up-state by holding on to the resolver object. I did some tests. The scenario I propose for adding support is this:

Create a browser with resolve-sequence options { persistResolver: true }. Once a service is announced as up, the user can register a "down" event listener on the service. Unfortunately services are not event emitters (would be nice if they were). After the service has been resolved and options.persistResolver is true, the resolver does not auto-close, but is instead fed to the down-listener. It can then decide to close or not. Close the resolver, and its resources will be freed. Alternatively, it's possible to leave it open, and wait for an "up" event on that service.

In any case, for "power users", control is given to make smart decisions on how to deal with service lifecycles.

What do you think of this idea? I've tested out the concept, and it works fine for me.

npm-published mdns requires Python 2.6/3.0

Although this seems to have been fixed in the repo, the version of node_mdns currently published in the npm registry fails to build on Python 2.5 or earlier. This makes it unusable from npm on OS X out of the box as, at least up to OS X 10.6, it ships with Python 2.5.

Could you please publish a version without the Python 2.6 requirement?

Fails to install on Windows

The error is:
'node-waf' is not recognized as an internal or external command, operable program or batch file.

Is there some way I can workaround this? Thanks.

Full log below.

E:\Code\test>npm install mdns
npm http GET https://registry.npmjs.org/mdns
npm http 304 https://registry.npmjs.org/mdns

> [email protected] install E:\Code\test\node_modules\mdns
> node-waf configure build

'node-waf' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! error installing [email protected]

npm ERR! [email protected] install: `node-waf configure build`
npm ERR! `cmd "/c" "node-waf configure build"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls mdns
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "mdns"
npm ERR! cwd E:\Code\test
npm ERR! node -v v0.7.1
npm ERR! npm -v 1.1.0-2
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `node-waf configure build`
npm ERR! message `cmd "/c" "node-waf configure build"` failed with 1
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     E:\Code\test\npm-debug.log
npm not ok

How to interpret interfaceIndex?

Any idea how I can map interfaceIndex back to os.networkInterfaces()?

Your documentation is absolutely wonderful, but it seems to be missing this one detail.

interface index throws "bad param"

@agnat thanks for the information (in #53). After some hacking in libuv I think I have managed to get the network index, however when I tried it out in mdns I got this error:

/Users/Andreas/Sites/node_modules/tcpnet/node_modules/mdns/lib/browser.js:57
  dns_sd.DNSServiceBrowse(self.serviceRef, flags, ifaceIdx, '' + requested_typ
         ^
Error: DNSServiceBrowse(): bad param
    at new Browser (/Users/Andreas/Sites/node_modules/tcpnet/node_modules/mdns/lib/browser.js:57:10)
    at Object.create [as createBrowser] (/Users/Andreas/Sites/node_modules/tcpnet/node_modules/mdns/lib/browser.js:85:10)
    at Object.<anonymous> (/Users/Andreas/Sites/node_modules/tcpnet/test.js:4:6)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

To reproduce simply execute this:

var mdns = require('mdns');

mdns.createBrowser(mdns.tcp('http'), {
  interfaceIndex: 1
});

Note ifconfig returned:

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=3<RXCSUM,TXCSUM>
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    inet 127.0.0.1 netmask 0xff000000 
    inet6 ::1 prefixlen 128 
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=2b<RXCSUM,TXCSUM,VLAN_HWTAGGING,TSO4>
    ether <hidden>
    media: autoselect (none)
    status: inactive
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether <hidden> 
    inet6 fe80::5ab0:35ff:fe84:84b1%en1 prefixlen 64 scopeid 0x5 
    inet 192.168.0.198 netmask 0xffffff00 broadcast 192.168.0.255
    media: autoselect
    status: active
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
    ether <hidden>
    media: autoselect
    status: inactive
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
    lladdr <hidden>
    media: autoselect <full-duplex>
    status: inactive

Node version: v0.8.16
OS: OS X, 10.8.2

serviceChanged and serviceDown events only report partial service info

The info argument passed with service* events on mdns.Browser are missing the fullname/host/port/addresses fields for serviceChanged and serviceDown. Is that intentional? Should those fields be cached from the serviceUp event, and if so, why are serviceChanged events reported before serviceUp?

Please update NPM repo

Forcing an NPM install of 006 works fine in Windows 64 with VS C++ installed, but when there are dependent packages making use of MDNS (Hook for example) this approach doesn't work as NPM still fails on the WAF error as it pulls the 005 package and tries to install it instead.

Please, for the love of my sanity and all that's good, update the NPM package so we can install MDNS again :)

Windows 7 Node v0.8.2 Build Fails

Fresh install of 0.8.2

npm http GET https://registry.npmjs.org/mdns
npm http 200 https://registry.npmjs.org/mdns

> [email protected] install C:\Users\ANTON\node_modules\mdns
> node-gyp rebuild


C:\Users\ANTON\node_modules\mdns>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
  txt_record_get_length.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  txt_record_buffer_to_object.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  dns_service_process_result.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  txt_record_deallocate.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  dns_service_browse.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  dns_service_enumerate_domains.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  dns_service_register.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  dns_service_ref_sock_fd.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  dns_service_resolve.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  mdns_utils.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  dns_service_ref.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  winsock_watcher.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  txt_record_ref.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  dns_service_ref_deallocate.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  txt_record_set_value.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  txt_record_create.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  dns_service_get_addr_info.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  dns_sd.cpp
c:\users\anton\documents\github\node_mdns\src\mdns.hpp(15): fatal error C1083: Cannot open include file: 'dns_sd.h': No such file or directory [C:\Users\ANTON\Documents\GitHub\node_mdns\build\dns_sd_bindings.vcxproj]
  Generating Code...
gyp ERR! rebuild error Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! rebuild error     at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:214:23)
gyp ERR! rebuild error     at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! rebuild error     at Process._handle.onexit (child_process.js:674:10)
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls mdns
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "link"
npm ERR! cwd C:\Users\ANTON\Documents\GitHub\node_mdns
npm ERR! node -v v0.8.2
npm ERR! npm -v 1.1.36
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `node-gyp rebuild`
npm ERR! message `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\ANTON\Documents\GitHub\node_mdns\npm-debug.log
npm ERR! not ok code 0

Raspberry Pi support

Hi, Sorry if this is in the worn area, just wondering if anyone has tried to use this library with the raspberry Pi, and if there is anything i should know before i attempt it myself?

Fix length and charset constraints applied to subtype labels

In #48 @ronkorving pointed out correctly:

From Apple's docs:

"Subtype labels may be up to 63 bytes long, and may contain any eight- bit byte values, including zero bytes. However, due to the nature of using a C-string-based API, conventional DNS escaping must be used for dots ('.'), commas (','), backslashes ('') and zero bytes, as shown below:" etc.

[...] yet node-mdns applies the same rules to it as to the main types.

This needs fixing.

However, fixing it will introduce a breaking change. On the discovery side subtypes are currently reported as an array of strings. Apple's description above does not define a string encoding and allows arbitrary binary data. The proper way to handle this in node is to use an array of buffers.

I can't jump to v2.0.0 immediately, because I need v1.1.0 as an intermediate release to deprecate interfaceIndex cleanly. v2.0.0 will follow a few weeks later.

Fails to build on Debian 6.0

npm http GET https://registry.npmjs.org/mdns
npm http 304 https://registry.npmjs.org/mdns

> [email protected] install /home/revues/mdns/node_modules/mdns
> node-gyp rebuild

make: Entering directory `/home/revues/mdns/node_modules/mdns/build'
  CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o
In file included from ../src/dns_sd.cpp:1:
../src/mdns.hpp:15:20: warning: dns_sd.h: No such file or directory
In file included from ../src/dns_sd.cpp:4:
../src/mdns_utils.hpp:10: error: ‘DNSServiceErrorType’ was not declared in this scope
../src/mdns_utils.hpp:11: error: ‘DNSServiceErrorType’ was not declared in this scope
../src/mdns_utils.hpp:27: error: ‘DNSServiceErrorType’ has not been declared
../src/mdns_utils.hpp: In function ‘v8::Local<v8::Value> node_mdns::mdnsError(const char*, int)’:
../src/mdns_utils.hpp:29: error: ‘node_mdns::errorString’ cannot be used as a function
../src/mdns_utils.hpp: At global scope:
../src/mdns_utils.hpp:35: error: ‘DNSServiceErrorType’ has not been declared
In file included from ../src/dns_sd.cpp:5:
../src/dns_service_ref.hpp:24: error: ISO C++ forbids declaration of ‘DNSServiceRef’ with no type
../src/dns_service_ref.hpp:24: error: expected ‘;’ before ‘&’ token
../src/dns_service_ref.hpp:25: error: ‘DNSServiceRef’ has not been declared
../src/dns_service_ref.hpp:41: error: ‘DNSServiceRef’ does not name a type
In file included from ../src/dns_sd.cpp:6:
../src/txt_record_ref.hpp:22: error: ISO C++ forbids declaration of ‘TXTRecordRef’ with no type
../src/txt_record_ref.hpp:22: error: expected ‘;’ before ‘&’ token
../src/txt_record_ref.hpp:23: error: expected ‘;’ before ‘void’
../src/txt_record_ref.hpp:23: error: ‘TXTRecordRef’ has not been declared
../src/txt_record_ref.hpp:26: error: ‘TXTRecordRef’ does not name a type
../src/txt_record_ref.hpp: In member function ‘void node_mdns::TxtRecordRef::SetTxtRecordRef(int)’:
../src/txt_record_ref.hpp:23: error: ‘ref_’ was not declared in this scope
../src/dns_sd.cpp: At global scope:
../src/dns_sd.cpp:37: error: ‘v8::Handle<v8::Value> node_mdns::buildException(const v8::Arguments&)’ redeclared as different kind of symbol
../src/mdns_utils.hpp:11: error: previous declaration of ‘v8::Local<v8::Value> node_mdns::buildException’
../src/dns_sd.cpp: In function ‘void node_mdns::init(v8::Handle<v8::Object>)’:
../src/dns_sd.cpp:70: error: cannot convert ‘v8::Local<v8::Value>’ to ‘v8::Handle<v8::Value> (*)(const v8::Arguments&)’ for argument ‘3’ to ‘void node_mdns::defineFunction(v8::Handle<v8::Object>, const char*, v8::Handle<v8::Value> (*)(const v8::Arguments&))’
../src/dns_sd.cpp: In function ‘v8::Handle<v8::Value> node_mdns::buildException(const v8::Arguments&)’:
../src/dns_sd.cpp:84: error: ‘v8::Handle<v8::Value> node_mdns::buildException(const v8::Arguments&)’ redeclared as different kind of symbol
../src/mdns_utils.hpp:11: error: previous declaration of ‘v8::Local<v8::Value> node_mdns::buildException’
../src/dns_sd.cpp:93: error: ‘DNSServiceErrorType’ was not declared in this scope
../src/dns_sd.cpp:93: error: expected ‘;’ before ‘error’
../src/dns_sd.cpp:94: error: ‘error’ was not declared in this scope
../src/dns_sd.cpp: In function ‘void node_mdns::addConstants(v8::Handle<v8::Object>)’:
../src/dns_sd.cpp:100: error: ‘kDNSServiceClass_IN’ was not declared in this scope
../src/dns_sd.cpp:103: error: ‘kDNSServiceErr_NoError’ was not declared in this scope
../src/dns_sd.cpp:104: error: ‘kDNSServiceErr_Unknown’ was not declared in this scope
../src/dns_sd.cpp:105: error: ‘kDNSServiceErr_NoSuchName’ was not declared in this scope
../src/dns_sd.cpp:106: error: ‘kDNSServiceErr_NoMemory’ was not declared in this scope
../src/dns_sd.cpp:107: error: ‘kDNSServiceErr_BadParam’ was not declared in this scope
../src/dns_sd.cpp:108: error: ‘kDNSServiceErr_BadReference’ was not declared in this scope
../src/dns_sd.cpp:109: error: ‘kDNSServiceErr_BadState’ was not declared in this scope
../src/dns_sd.cpp:110: error: ‘kDNSServiceErr_BadFlags’ was not declared in this scope
../src/dns_sd.cpp:111: error: ‘kDNSServiceErr_Unsupported’ was not declared in this scope
../src/dns_sd.cpp:112: error: ‘kDNSServiceErr_NotInitialized’ was not declared in this scope
../src/dns_sd.cpp:113: error: ‘kDNSServiceErr_AlreadyRegistered’ was not declared in this scope
../src/dns_sd.cpp:114: error: ‘kDNSServiceErr_NameConflict’ was not declared in this scope
../src/dns_sd.cpp:115: error: ‘kDNSServiceErr_Invalid’ was not declared in this scope
../src/dns_sd.cpp:116: error: ‘kDNSServiceErr_Firewall’ was not declared in this scope
../src/dns_sd.cpp:117: error: ‘kDNSServiceErr_Incompatible’ was not declared in this scope
../src/dns_sd.cpp:118: error: ‘kDNSServiceErr_BadInterfaceIndex’ was not declared in this scope
../src/dns_sd.cpp:119: error: ‘kDNSServiceErr_Refused’ was not declared in this scope
../src/dns_sd.cpp:120: error: ‘kDNSServiceErr_NoSuchRecord’ was not declared in this scope
../src/dns_sd.cpp:121: error: ‘kDNSServiceErr_NoAuth’ was not declared in this scope
../src/dns_sd.cpp:122: error: ‘kDNSServiceErr_NoSuchKey’ was not declared in this scope
../src/dns_sd.cpp:123: error: ‘kDNSServiceErr_NATTraversal’ was not declared in this scope
../src/dns_sd.cpp:124: error: ‘kDNSServiceErr_DoubleNAT’ was not declared in this scope
../src/dns_sd.cpp:125: error: ‘kDNSServiceErr_BadTime’ was not declared in this scope
../src/dns_sd.cpp:152: error: ‘kDNSServiceType_A’ was not declared in this scope
../src/dns_sd.cpp:153: error: ‘kDNSServiceType_NS’ was not declared in this scope
../src/dns_sd.cpp:154: error: ‘kDNSServiceType_MD’ was not declared in this scope
../src/dns_sd.cpp:155: error: ‘kDNSServiceType_MF’ was not declared in this scope
../src/dns_sd.cpp:156: error: ‘kDNSServiceType_CNAME’ was not declared in this scope
../src/dns_sd.cpp:157: error: ‘kDNSServiceType_SOA’ was not declared in this scope
../src/dns_sd.cpp:158: error: ‘kDNSServiceType_MB’ was not declared in this scope
../src/dns_sd.cpp:159: error: ‘kDNSServiceType_MG’ was not declared in this scope
../src/dns_sd.cpp:160: error: ‘kDNSServiceType_MR’ was not declared in this scope
../src/dns_sd.cpp:161: error: ‘kDNSServiceType_NULL’ was not declared in this scope
../src/dns_sd.cpp:162: error: ‘kDNSServiceType_WKS’ was not declared in this scope
../src/dns_sd.cpp:163: error: ‘kDNSServiceType_PTR’ was not declared in this scope
../src/dns_sd.cpp:164: error: ‘kDNSServiceType_HINFO’ was not declared in this scope
../src/dns_sd.cpp:165: error: ‘kDNSServiceType_MINFO’ was not declared in this scope
../src/dns_sd.cpp:166: error: ‘kDNSServiceType_MX’ was not declared in this scope
../src/dns_sd.cpp:167: error: ‘kDNSServiceType_TXT’ was not declared in this scope
../src/dns_sd.cpp:168: error: ‘kDNSServiceType_RP’ was not declared in this scope
../src/dns_sd.cpp:169: error: ‘kDNSServiceType_AFSDB’ was not declared in this scope
../src/dns_sd.cpp:170: error: ‘kDNSServiceType_X25’ was not declared in this scope
../src/dns_sd.cpp:171: error: ‘kDNSServiceType_ISDN’ was not declared in this scope
../src/dns_sd.cpp:172: error: ‘kDNSServiceType_RT’ was not declared in this scope
../src/dns_sd.cpp:173: error: ‘kDNSServiceType_NSAP’ was not declared in this scope
../src/dns_sd.cpp:174: error: ‘kDNSServiceType_NSAP_PTR’ was not declared in this scope
../src/dns_sd.cpp:175: error: ‘kDNSServiceType_SIG’ was not declared in this scope
../src/dns_sd.cpp:176: error: ‘kDNSServiceType_KEY’ was not declared in this scope
../src/dns_sd.cpp:177: error: ‘kDNSServiceType_PX’ was not declared in this scope
../src/dns_sd.cpp:178: error: ‘kDNSServiceType_GPOS’ was not declared in this scope
../src/dns_sd.cpp:179: error: ‘kDNSServiceType_AAAA’ was not declared in this scope
../src/dns_sd.cpp:180: error: ‘kDNSServiceType_LOC’ was not declared in this scope
../src/dns_sd.cpp:181: error: ‘kDNSServiceType_NXT’ was not declared in this scope
../src/dns_sd.cpp:182: error: ‘kDNSServiceType_EID’ was not declared in this scope
../src/dns_sd.cpp:183: error: ‘kDNSServiceType_NIMLOC’ was not declared in this scope
../src/dns_sd.cpp:184: error: ‘kDNSServiceType_SRV’ was not declared in this scope
../src/dns_sd.cpp:185: error: ‘kDNSServiceType_ATMA’ was not declared in this scope
../src/dns_sd.cpp:186: error: ‘kDNSServiceType_NAPTR’ was not declared in this scope
../src/dns_sd.cpp:187: error: ‘kDNSServiceType_KX’ was not declared in this scope
../src/dns_sd.cpp:188: error: ‘kDNSServiceType_CERT’ was not declared in this scope
../src/dns_sd.cpp:189: error: ‘kDNSServiceType_A6’ was not declared in this scope
../src/dns_sd.cpp:190: error: ‘kDNSServiceType_DNAME’ was not declared in this scope
../src/dns_sd.cpp:191: error: ‘kDNSServiceType_SINK’ was not declared in this scope
../src/dns_sd.cpp:192: error: ‘kDNSServiceType_OPT’ was not declared in this scope
../src/dns_sd.cpp:241: error: ‘kDNSServiceType_TKEY’ was not declared in this scope
../src/dns_sd.cpp:242: error: ‘kDNSServiceType_TSIG’ was not declared in this scope
../src/dns_sd.cpp:243: error: ‘kDNSServiceType_IXFR’ was not declared in this scope
../src/dns_sd.cpp:244: error: ‘kDNSServiceType_AXFR’ was not declared in this scope
../src/dns_sd.cpp:245: error: ‘kDNSServiceType_MAILB’ was not declared in this scope
../src/dns_sd.cpp:246: error: ‘kDNSServiceType_MAILA’ was not declared in this scope
../src/dns_sd.cpp:247: error: ‘kDNSServiceType_ANY’ was not declared in this scope
../src/dns_sd.cpp:250: error: ‘kDNSServiceFlagsMoreComing’ was not declared in this scope
../src/dns_sd.cpp:251: error: ‘kDNSServiceFlagsAdd’ was not declared in this scope
../src/dns_sd.cpp:252: error: ‘kDNSServiceFlagsDefault’ was not declared in this scope
../src/dns_sd.cpp:253: error: ‘kDNSServiceFlagsNoAutoRename’ was not declared in this scope
../src/dns_sd.cpp:254: error: ‘kDNSServiceFlagsShared’ was not declared in this scope
../src/dns_sd.cpp:255: error: ‘kDNSServiceFlagsUnique’ was not declared in this scope
../src/dns_sd.cpp:256: error: ‘kDNSServiceFlagsBrowseDomains’ was not declared in this scope
../src/dns_sd.cpp:257: error: ‘kDNSServiceFlagsRegistrationDomains’ was not declared in this scope
../src/dns_sd.cpp:258: error: ‘kDNSServiceFlagsLongLivedQuery’ was not declared in this scope
../src/dns_sd.cpp:259: error: ‘kDNSServiceFlagsAllowRemoteQuery’ was not declared in this scope
../src/dns_sd.cpp:260: error: ‘kDNSServiceFlagsForceMulticast’ was not declared in this scope
make: *** [Release/obj.target/dns_sd_bindings/src/dns_sd.o] Error 1
make: Leaving directory `/home/revues/mdns/node_modules/mdns/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:236:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Linux 3.5.2-linode45
gyp ERR! command "node" "/usr/lib/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/revues/mdns/node_modules/mdns
gyp ERR! node -v v0.8.14
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok 
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls mdns
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.5.2-linode45
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "mdns"
npm ERR! cwd /home/revues/mdns
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/revues/mdns/npm-debug.log
npm ERR! not ok code 0

missing serviceUp events

The browser only reports serviceDown events for some services, no serviceUp events. This seems to happen, for example, when passing the 'host' option to createAdvertisement().

Multiply announcement in series dosn't work

Hi

doing two announcements in series seams to either emit something wrong in serviceUp or announce something wrong.

Here is smal testcase: https://gist.github.com/4197908

output:

WARNING: don't use IOWatcher, it'll be removed in v0.9
done 1/3
WARNING: don't use IOWatcher, it'll be removed in v0.9
WARNING: don't use IOWatcher, it'll be removed in v0.9
{ port: 52090,
  addresses: [ '192.168.0.198', 'fe80::5ab0:35ff:fe84:84b1' ] }
done 2/3
WARNING: don't use IOWatcher, it'll be removed in v0.9
WARNING: don't use IOWatcher, it'll be removed in v0.9
{ port: 52090,
  addresses: [ '192.168.0.198', 'fe80::5ab0:35ff:fe84:84b1' ] }

As you will also see doing two announcements in parallel works fine:

testcase: https://gist.github.com/4197922

output:

WARNING: don't use IOWatcher, it'll be removed in v0.9
done 1/2
WARNING: don't use IOWatcher, it'll be removed in v0.9
WARNING: don't use IOWatcher, it'll be removed in v0.9
WARNING: don't use IOWatcher, it'll be removed in v0.9
{ port: 52174,
  addresses: [ '192.168.0.198', 'fe80::5ab0:35ff:fe84:84b1' ] }
done 2n/2
WARNING: don't use IOWatcher, it'll be removed in v0.9
{ port: 52173,
  addresses: [ '192.168.0.198', 'fe80::5ab0:35ff:fe84:84b1' ] }
done 2a/2

Support TXT Records

mdns services may have an associated TXT record containing arbitrary key value pairs. This is very useful to expose meta information.

[solved] Error: DNSServiceRegister(): unknown

Just for the sake of documenting the solution:

Solution:

Check to see that avahi-daemon is installed and runs correctly.

Here's the error:

*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: DNSServiceRegister(): unknown
    at new Advertisement (/home/user/project/node_modules/mdns/lib/advertisement.js:55:10)
    at Object.create [as createAdvertisement] (/home/user/project/node_modules/mdns/lib/advertisement.js:63:10)
    at Object.<anonymous> (/home/user/project/lib/test-mdns.js:5:15)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)
    at Array.0 (module.js:470:10)
    at EventEmitter._tickCallback (node.js:192:40)

OpenIndiana Test Fails

Tried running the tests on OpenIndiana Development oi_151.1.5 X86 node v0.8.1
Build is fine but I am getting:

/home/anton/github/node_mdns/tests/test_odd_ends.js:23
  mdns.dns_sd.DNSServiceEnumerateDomains(enumerator.serviceRef,
              ^
Error: DNSServiceEnumerateDomains(): unknown
    at exports.DNSServiceEnumerateDomains (/home/anton/github/node_mdns/tests/test_odd_ends.js:23:15)
    at run_testcase (/home/anton/github/node_mdns/utils/testrun:191:3)
    at Array.0 (/home/anton/github/node_mdns/node_modules/slide/lib/bind-actor.js:15:8)
    at LOOP (/home/anton/github/node_mdns/node_modules/slide/lib/chain.js:15:14)
    at chain (/home/anton/github/node_mdns/node_modules/slide/lib/chain.js:20:5)
    at run_group (/home/anton/github/node_mdns/utils/testrun:171:5)
    at Array.0 (/home/anton/github/node_mdns/node_modules/slide/lib/bind-actor.js:15:8)
    at LOOP (/home/anton/github/node_mdns/node_modules/slide/lib/chain.js:15:14)
    at chain (/home/anton/github/node_mdns/node_modules/slide/lib/chain.js:20:5)
    at run_modules (/home/anton/github/node_mdns/utils/testrun:160:3)
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

I will have a further look this week but I thought I would log it now.

Node.js silently exists when listening for events

Mac OS X Snow Leopard
Node version v0.5.0-pre

mdns has been installed through npm

var mdns = require('mdns');

var browser = mdns.createBrowser('http');
browser.on('serviceUp', function(info, flags) {
  sys.puts("Up: " + sys.inspect(info));
});
browser.on('serviceDown', function(info, flags) {
  sys.puts("Down: " + sys.inspect(info));
});
browser.start();

Server doesn't start, instead it just silently fails.

[email protected] silently exists

OS: Windows 7 32bits
NodeJs: v0.6.14
Bonjour SDK: Bonjour SDK for WIndows 2.0.4, API successfully tested with Bonjour SDK\Samples\Java\BrowserApp.jar
mDNS: v0.0.6-dev, compiled by node-gyp, folder 'build / release' was copied to 'out / release ', files (dns_sd_bindings.exp, dns_sd_bindings.lib, dns_sd_bindings.node)

See the code below, its not work, the process dies...

Code:


var mdns = require('mdns');
console.log("loaded module mdns");
    
// advertise a http server on port 4321
var ad = mdns.createAdvertisement(mdns.tcp('http'), 4321);
ad.on('error', function(err) {
    console.log("advertisement error: ", err);
});
console.log("created avertisement");

// watch all http servers
var browser = mdns.createBrowser(mdns.tcp('http'));     
browser.on('error', function(err) {
    console.log("browser error: ", err);
});
browser.on('serviceUp', function(service) {
    console.log("service up: ", service);
});
browser.on('serviceDown', function(service) {
    console.log("service down: ", service);
});
browser.on('serviceChanged', function(service) {
    console.log("service changed: ", service);
});
console.log("created browser");
    
//Start
ad.start();
browser.start();
console.log("started app");

Output - Debug:
node example
Process started >>>
loaded module mdns
created avertisement
created browser
started app
<<< Process finished.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.