Tailscale Local API: files via Taildrop
Thinking of writing a GUI for Tailscale's Taildrop functionality. Here are some musings.
Connect to the /run/tailscale/tailscaled.sock
first. It speaks HTTP inside. curl --unix-socket /run/tailscale/tailscaled.sock <URL>
will work perfectly.
GET /localapi/v0/files/?waitsec=0
Accept: application/json
Returns Option<Vec<File>>
, where File
is:
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "CamelCase")]
struct File {
name: String,
size: usize
}
GET /localapi/v0/files/<NAME>
will give you the file. DELETE
method removes it from the taildrop directory.