Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bonjour Discovery in Javascript? Maybe?

So its a longshot, I'll start with that.

Is it/could it be possible to discover bonjour advertised HTTP services in javascript alone?

Why would this be useful? Imagine a local service looking after some data (eg your current lat/long), the data is exposed via a webservice and advertised by Bonjour Zeroconf. A (remote) website might want to know your current lat/long and rather than having to know you're running MyGPSserverVersion2 the site could use javascript to search the local bonjour for _Compatible_location_services._tcp and then continue once it had an IP address.

If this is impossible (I think its probably the case, Javascript is fairly restricted) then what are the hurdles and does anyone have any ideas as to how to overcome them?

like image 270
JP. Avatar asked Dec 01 '09 19:12

JP.


2 Answers

The short answer is no ( at least not on the Linux platform ).

Funny you should ask: I have been working on bringing this sort of functionality within reach of web browsers. One of my success in this endeavor is an NPAPI mDNS plugin for Chrome. The plugin basically interfaces with Avahi ZeroConf (mDNS - Multicast DNS Server).

I am currently working on yet another bridge to close this gap: a "lightweight" database ( a la CouchDb ) that will be used by desktop applications to register their HTTP end-points. Extensions would then read those end-points from Javascript and be able to interact directly with the advertised services.

UPDATE: There is hope through W3C Service Discovery.

like image 120
jldupont Avatar answered Nov 14 '22 16:11

jldupont


This seems to be possible using the Chrome's Sockets API, but I've only taken a cursory look.

mdns-browser seems to implement this using said APIs.

like image 5
Jim O'Brien Avatar answered Nov 14 '22 15:11

Jim O'Brien