在Javascript中发现Bonjour?也许? [英] Bonjour Discovery in Javascript? Maybe?

查看:123
本文介绍了在Javascript中发现Bonjour?也许?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以它是一个远景,我将从那开始。

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

是否可以在javascript中发现bonjour广告的HTTP服务?

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

为什么这会有用?想象一下本地服务正在寻找一些数据(例如您当前的纬度/经度),数据通过网络服务公开并由Bonjour Zeroconf做广告。一个(远程)网站可能想知道你当前的纬度/经度,而不是必须知道你正在运行 MyGPSserverVersion2 该网站可以使用javascript搜索本地bonjour _Compatible_location_services ._tcp 然后在有IP地址后继续。

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.

如果这是不可能的(我认为可能就是这种情况,Javascript相当受限制)然后有什么障碍,有没有人对如何克服它们有任何想法?

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?

推荐答案

这似乎可以使用Chrome的套接字API ,但我只是粗略一看。

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

mdns-browser 似乎使用所述API实现了这一点。

mdns-browser seems to implement this using said APIs.

这篇关于在Javascript中发现Bonjour?也许?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆