kfix / SleepProxyServer

mDNS (Bonjour) Sleep Proxy Server (python 2 implementation) for Mac OSX "Wake on Demand"
BSD 2-Clause "Simplified" License
30 stars 8 forks source link

SleepProxyServer

mDNS (Bonjour) Sleep Proxy Server implementation for Python

Provides the Wake on Demand service, similarly to Apple TV and Airport Express devices

Status

SPS has been tested against SleepProxyClient, OSX 10.9's mDNSResponder, and OSX 10.10's discoveryd.
See Debugging instructions below to test other implementations.
Selective-port waking is not implemented, any TCP request to a sleep client will result in a wakeup attempt.

A port to C(++) or Go would be welcome for resource limited ARM devices.

Internals

The included server daemon, scripts/sleeproxyd, binds port 5353 and loops up some greenlets:

Installation

Being based on ZeroConf, SPS requires almost no configuration.
Just run it and clients will see its mDNS advertisement and register to it within their regular polling intervals and/or just before sleeping.
sudo pmset networkoversleep 1 may be necessary to ensure OSX clients will publish services at-all-costs.
You must ensure both SPS server and client use the same network-segment and IP subnet and that IP Multicast traffic between them is not blocked.

gevent 1.0 is required for its co-operative threading feature; its packaged in Debian jessie.
Because of this, SPS can't be run under python3 (FIXME: replace gevent with asyncio)

Development & Debugging

Further Reading