cmd/hello: use safesocket client to connect

This commit is contained in:
Brad Fitzpatrick
2021-01-29 13:49:17 -08:00
parent 006a224f50
commit 60e189f699
2 changed files with 9 additions and 6 deletions
+5
View File
@@ -27,6 +27,11 @@ func ConnCloseWrite(c net.Conn) error {
return c.(closeable).CloseWrite()
}
// ConnectDefault connects to the local Tailscale daemon.
func ConnectDefault() (net.Conn, error) {
return Connect("/var/run/tailscale/tailscaled.sock", 41112)
}
// Connect connects to either path (on Unix) or the provided localhost port (on Windows).
func Connect(path string, port uint16) (net.Conn, error) {
return connect(path, port)