This tool is designed to immitate netcat for the purposes of SSH's ProxyCommand. It may work for other uses of netcat within a Tailscale network but I wouldn't trust it.
On first run you will need to login, a link is provided for ease of use. Auth keys are also supported, see below for use
sean@laptop:~$ ssh -o 'ProxyCommand tailscale-netcat -host %h -port %p' myserver
2022/04/02 15:54:42 NeedsLogin: https://login.tailscale.com/a/12345678
kex_exchange_identification: Connection closed by remote host
On second login, you'll be in:
sean@laptop:~$ ssh -o 'ProxyCommand tailscale-netcat -host %h -port %p' myserver
sean@myserver:~$
Optional Env Vars:
TS_AUTHKEY
is now enabled for this project. You can provide this variable with a key, consult the tailscale documentation to determine the appropriate key to use.
TS_STATEDIR
is the location where Tailscale keeps its state data.. This is used to not need to re-authorise the instance.