-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
specify device for advertisement and browsing #31
Comments
Yes, you can specify an interface index. See http://agnat.github.com/node_mdns/user_guide.html#advertisement |
Gotcha. Is there a way to get a map of these interfaces so I know which index is what interface? |
Well, since node v0.5.1 there is http://nodejs.org/docs/latest/api/os.html#os_os_networkinterfaces I haven't tried it yet, but I'd do something like this: var index = Object.keys(os.networkInterfces()).indexOf('en0') + 1; |
yea, I guess I was looking for clarification on if those two arrays would be in the same order. so that item 0 in os.networkInterfaces => 1 for mdns and so on. |
Hm, looking at the libuv sources, I doubt that it will work correctly. libuv omits interfaces that have no address assigned, possibly messing up the index values. I'll probably file an issue with the node/libuv guys. |
Is the index something the underlying mdns sys libraries accept as a parameter? Do they not accept any sort of string or return a list of valid index <-> string maps? If they do it would be simple enough to make a js wrapping for accepting the interface string and converting that to a valid index. |
On 18.05.2012, at 17:23, Roman Shtylman wrote:
Yes.
Yes. (No, they don't accept strings)
No.
Yes. If such an API existed I would have wrapped it a long time ago … ;-) I just hesitated to add highly platform specific code which doesn't really belong here. However, now that node has
|
Is there a way to specify which network device mdns should advertise on and/or browse? I have multiple virtual devices and would like to use a specific one.
The text was updated successfully, but these errors were encountered: