4 ms·
This general concept is very similar to Apple’s Bonjour based “Sleep Proxy” service. Basically, if you have an Apple TV or something similar it will automatica
by varenc 4y ago
This general concept is very similar to Apple’s Bonjour based “Sleep Proxy” service. Basically, if you have an Apple TV or something similar it will automatically wake up a sleeping device when someone requests its services. SSH or media sharing for example. While a device is sleeping the proxy will keep advertising its services via Bonjour. Low power always-on Apple devices are sleep proxies by default but you can turn any Mac into a Sleep Proxy by passing a flag to mDNSResponder.
More details: https://en.wikipedia.org/wiki/Bonjour_Sleep_Proxy https://en.wikipedia.org/wiki/Bonjour_Sleep_Proxy
- gotschi_ 4y agoI kind of made a general purpose sleep proxy myself a few years ago with a apache and some cgi scripts getting triggered when I visit my /jellyfin or /guacamole It just listened to the fixed routes, woke the server and proxied the page when finished (sometimes took 2 loads) But basically is the same as in the arzicle except I didn‘t need to manually WOL anything and my server just went to sleep by itself
- 314 4y agoThis is a nice idea, I was jsut wondering how to do that. Another approach (if it is supported by the adaptor) is to configure WoL so that it does not need a magic packet. Some adaptors can be configured to wake on any "directed packet". I have a linux server sitting downstairs that I might play around with. It would be nice if the sleep support featured a timer and integration with the system cron daemon. Then it could wake on a directed packet or when there is a scheduled task.
- varenc 4y agoInteresting! I believe all the new Mac products also work like this. While sleeping a Mac will still stay on WiFi if it’s on a power adapter and the sleeping M1/M2 Macs stay on WiFi even while on battery. They also still respond to some mDNS traffic. When I try to access certain services on a sleeping Mac, like SSH, it’ll immediately wake up. Even port scanning with `nmap -p 22 <ip>` will cause a wake up. That sounds like the wake on “directed packet” thing? In practice I think this mostly obviates the need for a Bonjour Sleep Proxy. Also, fun tip: You can easily check if a Mac on the network is sleeping or not based on its ping response TTL. While awake it uses a TTL of 64 but while sleeping it uses a TTL of 32. You can use this little signal to roughly keep a log of when the Macs on your network are awake vs sleeping. (Not too much of an actual privacy concern I think)
- 314 4y agoNice. I'll have to try this. I may have ssh'd into a sleeping mac before and assumed that it had failed to sleep. I did not realise what it was doing.