[launchd-dev] Dynamic port listening

Hamish Allan hamish at gmail.com
Mon Nov 12 14:51:16 PST 2007


Hi Dave,

On Nov 12, 2007 7:15 PM, Dave Zarzycki <zarzycki at apple.com> wrote:

> Sure, set the port to zero. The kernel will dynamically assign a free
> port.

Ah, thanks.

> Actually, the launchd code should handle that for you. Just set
> Bonjour to true in the plist.

Unfortunately, the SSH port is bound only to the loopback interface
(so that others on my LAN cannot access it). As such, I need to
register the service as being on localhost rather than
mymachine.local, as per the following:

$ dns-sd -P ServiceName _http._tcp . <port> localhost 127.0.0.1

However, the Bonjour key (which I set to "http" as the SockServiceName
is 0) causes it to be registered as being on mymachine.local. Can I do
anything about this?

Thanks,
Hamish


More information about the launchd-dev mailing list