I am looking for a way that clients on the local network can find all instances of my server application without any configuration. Instead of hacking something, I would like to use an existing solution. Personally, I need this to be done in Python, but I would be happy to hear about solutions in any other language.
So why am I not using avahi or OpenSLP or some other Zeroconf / SLP solution? Well, there are a few additional criteria, and I get the impression that none of the above systems matches them.
I am looking for a solution that:
- Flexible . It should not require superuser rights, i.e. Use only ports> 1024.
- Solid It must allow multiple services of the same and different types of services on the same machine and continue to advertise the services, even if the instance that launched the ad server stops or fails.
- portable . It should work almost everywhere, or at least on * BSD, Debian / gentoo / RedHat / SuSe Linux, Mac OS X, Solaris, and Windows NT.
- Light Ideally, a single Python script would be the whole solution. I'm not at all interested in address auto-configuration or something like that, although I would love to make a decision that has a lot of features that I don't need. In addition, any one-time setup is a strict absence-no.
I expect something like this:
def registerService(service): # (type, port) if listen(multicast, someport): if fork() == child: services = [service] for q in queriesToMe(): if q == DISCOVERY: answer(filter(q.criteria, services)) elif q == ADVERTISE and q.sender == "localhost": services.append(q.service) else: advertiseAt("localhost", service)
source share