#tailscale #api #tailnet #tailscale-localapi

tailscale-localapi

Client for the Tailscale local API

6 releases (3 breaking)

new 0.4.2 May 4, 2025
0.4.1 Mar 31, 2025
0.4.0 Dec 27, 2023
0.3.0 Aug 23, 2023
0.1.0 Aug 21, 2023

#4 in #tailscale

Download history 1/week @ 2025-02-04 7/week @ 2025-02-11 5/week @ 2025-02-18 2/week @ 2025-02-25 1/week @ 2025-03-04 6/week @ 2025-03-11 6/week @ 2025-03-18 23/week @ 2025-03-25 114/week @ 2025-04-01 12/week @ 2025-04-08 14/week @ 2025-04-15 1/week @ 2025-04-22 55/week @ 2025-04-29

88 downloads per month

MIT license

17KB
384 lines

tailscale-localapi

This is a rust crate designed to interact with the Tailscale local API. On Linux and other Unix-like systems, this is through a unix socket. On macOS and Windows, this is through a local TCP port and a password. The Tailscale localapi is large but so far this crate does:

  1. Get the status of the node and the tailnet (similar to tailscale status)
  2. Get a certificate and key for the node (similar to tailscale cert)
  3. Get whois information for a given IP address in the tailnet

Limitations

This crate uses hyper and requires tokio and async rust.

Example

let socket_path = "/var/run/tailscale/tailscaled.sock";
let client = tailscale_localapi::LocalApi::new_with_socket_path(socket_path);
dbg!(client.status().await.unwrap());

Dependencies

~7–18MB
~206K SLoC