Zeroconf 名称解析

发布于 2024-09-04 14:29:54 字数 581 浏览 6 评论 0原文

我正在开发带有嵌入式网络服务器的控制设备。 Web 服务器向任何请求它的 Web 浏览器(来自 Windows 浏览器、Mac 浏览器、iPhone android 等)提供控制接口。

我遇到的问题是一般了解如何访问设备的通用方法。即在网络浏览器中输入什么地址。

固定 IP 对于我的用户来说太技术性了,而且可能会出错,因为我的设备可能会插入许多不同的本地网络。使用 uPnp 服务发现需要在某些平台的客户端上运行软件,并且不像仅键入网址那么自然。我想实施名称解析。

我当前的实现使用 netbios 协议。因此,我可以在 Windows 浏览器中输入 //controller/ 并且它可以工作,但这不适用于 Mac 或智能手机。我还可以尝试实现Apples mDnsresponder,这应该让Mac和iPhone玩得开心(尽管我认为我仅限于//controller.local/)。也许 Android、Symbian 等也存在类似的情况,但是没有一种更通用的解决方案来创建我可以尝试的网络名称吗?

该平台目前基于 TI Cortex M3 处理器和 lwIP。

非常感谢任何有关如何找到解决方案的帮助或建议。

亲切的问候,

鲍勃

I am developing a control device with an embedded webserver. The webserver provides a control interface to any web browser that requests it (from Windows browsers, Mac browsers, iPhone android etc).

The problem I am having is with a general way of generically knowing how to access the device. i.e. what address to type in the web browser.

Fixed IPs are too techie for my users and could go wrong as my device could be plugged into many different Local networks. Using uPnp service discovery requires software to run on the client for some platforms and isn't as natural as just typing a web address. I want to implement Name Resolution.

My current implementation uses the netbios protocol. So from a windows browser I can type //controller/ and it works but this doesn't work with Macs or smartphones. I can in addition try to implement Apples mDnsresponder which should make Macs and iPhones play happy (although i think then im limited to //controller.local/). Maybe similar things exist for Android, Symbian etc too but is there not a more universal solution for creating one network name that I could try?

The platform is currently based on a TI Cortex M3 processor and lwIP.

Any help or suggestions for how to find a solution are much appreciated.

Kind Regards,

Bob

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

亣腦蒛氧 2024-09-11 14:29:55

为了使 Windows 用户能够使用 Zeroconf“自动”找到您的设备,他们需要:

  1. 安装 mDNS 守护程序(例如 mDNSResponder,可以从 Apple 免费获得)
  2. 安装第二软件,该软件知道如何向 mDNS 守护进程发出查询并显示可用服务本地网络(即您设备的嵌入式 Web 服务器)

Windows 版 Bonjour 捆绑了一个 Internet Explorer 插件,该插件足以满足第 2 项要求,并且对于您的用户来说可能不会“太技术化”。 (他们只需要下载并安装 Windows 版 Bonjour,然后勾选复选框即可安装 Internet Explorer 插件。)Mac 用户可以只使用 Safari 浏览器,该浏览器已经支持 Zeroconf。

难题的最后一部分(也是最棘手的部分)是,您必须修改自己的软件才能将控制器注册到“本地 mDNS 守护程序”。然而,大概不存在这样的事情,因为你的“控制设备”是一个嵌入式系统。因此,您需要编写自己的简单 mDNS 守护进程。这并不难做到,您可以使用 Apple 的 mDNSPosix 代码作为起点。但是,根据您的硬件限制,这可能不可行。

总而言之,Zeroconf 可能是一个棘手的协议栈。 “零配置”方面仅适用于用户体验。对于开发人员来说,它呈现出相当陡峭的学习曲线。如果您的用户通常只运行您的设备的单个实例,那么这可能是多余的。

For Windows users to be able to 'automagically' find your device using Zeroconf, they would need to:

  1. Have an mDNS daemon installed (like the mDNSResponder you mentioned, which is available for free from Apple)
  2. Have a second piece of software installed that knows how to issue queries to the mDNS daemon and display available services on the local network (i.e., your device's embedded web server)

Bonjour for Windows comes bundled with an Internet Explorer plugin that's adequate for item #2, and might not be 'too techie' for your users. (They would just need to download and install Bonjour for Windows and tick the box to install the Internet Explorer plugin.) Mac users could just use the Safari browser, which is already Zeroconf-aware.

The final piece of the puzzle---and the trickiest part---is that you would have to modify your own software to register your controller with the "local mDNS daemon". However, there's no such thing, presumably, because your 'control device' is an embedded system. So you'd need to write your own bare-bones mDNS daemon. It's not that hard to do, and you can use Apple's mDNSPosix code as a starting point. But, depending on your hardware constraints, this might not be feasible.

All in all, Zeroconf can be a tricky stack of protocols to work with. The 'zero configuration' aspect applies only to the user's experience. To a developer, it presents a fairly steep learning curve. If your users typically only have a single instance of your device running, it may be overkill.

花海 2024-09-11 14:29:55

我认为您可以使用 DynDns (www.dyndns.org),它对于您想要做的事情是免费的。即使您无法获得固定 IP 地址,您也可以使用它。在这种情况下,您可以使用 dyndns updater 实用程序。例如,您可以注册 ourCompanyName.dyndns.org,它将始终路由到您的本地计算机。

I think you can use DynDns (www.dyndns.org), it's free for what you are trying to do. You can use it even if you have no possibility of getting a fixed ip-address. In that case you would use the dyndns updater utility. You could e.g. register ourCompanyName.dyndns.org and it will always get routed to your local computer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文