我可以从命令行使用Bonjour吗? [英] Can I use Bonjour from command line?

查看:153
本文介绍了我可以从命令行使用Bonjour吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从命令行使用Bonjour?例如,如果我想注册服务,则键入类似的内容:bonjour -register service_name端口.然后Bonjour为我的服务分配了一个免费IP.或者,例如,如果我想查看可用服务的列表,请键入以下内容:bonjour -showServices.然后,我获得了所有可用服务的列表以及它们的名称,IP地址和端口.是否存在类似的东西?

Is it possible to use Bonjour from command line? For example if I want to register a service I type something like that: bonjour -register service_name port. And then Bonjour allocate a free IP for my service. Or, for example, if I want to see a list of available services I type something like: bonjour -showServices. And then I get list of all available services with their names, IP addresses and ports. Does something like that exist?

我对现有文档感到困惑.例如

I am kind of confused by the available documentation. For example here, in the beginning of the document I see:

要注册您的服务,请致电 DNSServiceRegister.

To register your service, call DNSServiceRegister.

我应该在哪里称呼它?在命令行中?在Java中?在C ++中?在python中?没有提供这种上下文是很奇怪的.

Where should I call it? In the command line? In Java? In C++? In python? It is kind of strange that this kind of context is not provided.

通常,我只找到有关zeroconf和Bonjour的一般信息(应该做什么).但是我找不到具体而简单的东西.就像使用Bonjour的"Hello World"示例一样.

In general, I find just a general information about zeroconf and Bonjour (what it is supposed to do). But I cannot find something concrete and simple. Like "Hello World" examples of usage of Bonjour.

有人可以帮我吗?

推荐答案

dns-sd是可在Windows和Mac OS X上运行的命令行程序.

dns-sd is the command line program that works on both windows and Mac OS X.

我经常使用它通过ssh在Internet上传输iTunes共享.我的典型用法是dns-sd -P my_music _daap._tcp. local 3690 localhost 127.0.0.1.假定我已经在本地端口3690到共享iTunes在外部网络上的主机的端口3689上设置了ssh隧道侦听.这样会在iTunes中显示一个名为"my_music"的iTunes共享小图标.

I often use it to tunnel iTunes shares over the internet with ssh. My typical use is dns-sd -P my_music _daap._tcp. local 3690 localhost 127.0.0.1. This assumes that I've set up an ssh tunnel listen on localhost port 3690 to port 3689 of the host sharing iTunes on the foreign network. This makes a little iTunes share icon appear in iTunes named "my_music".

这篇关于我可以从命令行使用Bonjour吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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