How to discover other Tailscale devices on Android and iOS?

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

1 Like

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?