diff --git a/paths/paths.go b/paths/paths.go index 343692f20..ad8d7654c 100644 --- a/paths/paths.go +++ b/paths/paths.go @@ -21,6 +21,11 @@ var AppSharedDir syncs.AtomicValue[string] // DefaultTailscaledSocket returns the path to the tailscaled Unix socket // or the empty string if there's no reasonable default. func DefaultTailscaledSocket() string { + envSocket := os.Getenv("TS_SOCKET") + if envSocket != "" { + return envSocket + } + if runtime.GOOS == "windows" { return `\\.\pipe\ProtectedPrefix\Administrators\Tailscale\tailscaled` }