On desktop the tailscale-cli can be used. Is there a way to get tailscale status
programmatically on mobile?
You can query the Tailscale ālocalapiā. The documentation isnāt super clear, but itās an http interface running on the local device. An example go client library for the localapi is here: tailscale package - tailscale.com/client/tailscale - pkg.go.dev
Thank you! Cool to see that there is a way! From the example it looks like http://local-tailscaled.sock/localapi/v0/status
should return json with the status but at least with Chrome on Android, Iām getting ERR_NAME_NOT_RESOLVED.
Ah, the way to connect to the socket varies a bit by platform. Look at DoLocalRequest to see how it translates the local-tailscaled.sock: https://github.com/tailscale/tailscale/blob/main/client/tailscale/tailscale.go#L69
This all needs much better documentation, we just havenāt had time yet.
į§
Maybe I should add that Iām trying to get the Tailscale status from my (third party) app while the vanilla Tailscale Android app is running. Is that possible? On Android local-tailscaled.sock
seems to be translated to tailscaled.sock:41112
according to tailscale/paths.go at e016eaf41009a4898fecf24a68d146af5874a795 Ā· tailscale/tailscale Ā· GitHub and tailscale/tailscale.go at e016eaf41009a4898fecf24a68d146af5874a795 Ā· tailscale/tailscale Ā· GitHub . This still seems inaccessible from other apps (e.g. termux) and looks a lot like a unix domain socket that is accessible only by the Tailscale app itself, no?