Parses a tailcat address locally, without network access, and returns its public metadata. The pre-shared key embedded in the address is deliberately not returned.
Arguments
- address
A tailcat address, as a string or the tailcat_secret returned by
TailcatServer$address. Surrounding whitespace is ignored. Addresses are secrets.
Value
A list with elements
public_key, the server's public key;disco_public_key, the server's discovery key;has_preshared_key,TRUEif the address carries a pre-shared key;region_id, the number of the relay region the server registered in.0means the address names no region number: its relay details are embedded inregionsinstead, or (for an address that has neither) are missing, and a client cannot use it;regions, the relay regions embedded in the address, orNULL. Each is a list withregion_id,region_code,region_name, andnodes; each node is a list with fields such asname,region_id,host_name,cert_name,ipv4,ipv6,stun_port,relay_port, andinsecure_for_tests(fields tailcat omits are absent).
Field names are snake_case versions of tailcat's (which follow Tailscale's DERPRegion and DERPNode types), with the relay (DERP) port as relay_port.
Examples
try(tailcat_address_parse("not an address"))
#> Error in tailcat_address_parse("not an address") : `address` is invalid.
#> ℹ tailcat: invalid tailcat address