Using `localapi`

Hi, I read about the localapi in this blog post, and I would like to use the whois endpoint to provide lightweight authentication for an internal service.

Is the intent for the localapi to be used publicly? I can’t find any documentation on it?

I see it discussed here, but I can’t seem to get it to work. With every request I make, e.g.

echo -e "GET /localapi/v0/status HTTP/1.0\r\n" | nc -U /run/tailscale/tailscaled.sock

I get this response:

<html><title>Tailscale</title><body><h1>Tailscale</h1>This is the local Tailscale daemon.

I expect I’m not formatting my URL correctly, as this check appears to fail, but I’m not familiar enough with go and the http server library to know exactly what is going wrong.

I can get it to work on windows, e.g.

Invoke-WebRequest http://localhost:41112/localapi/v0/status

returns a json blob as I’d expect.

@gilbert — do it like this with curl.

curl --unix-socket /run/tailscale/tailscaled.sock http://localhost/localapi/v0/status

Ah, I was running an out of date version of tailscale. Updating fixed it for me. :smiley:

Sorry for the confusion.

Does anyone know how that works on Android?

Before 1.34.1, I was able to connect to the localapi on Windows through http://localhost:41112/localapi/v0/, but now it’s not working anymore. Has anyone found a workaround (or a new endpoint) that doesn’t require rewriting my project in Go and consuming their library?