2023-01-27 21:37:20 +00:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2021-11-07 20:11:50 +00:00
|
|
|
|
|
|
|
package safesocket
|
|
|
|
|
|
|
|
import (
|
2024-06-11 02:38:10 +00:00
|
|
|
"context"
|
2021-11-07 20:11:50 +00:00
|
|
|
"net"
|
|
|
|
|
|
|
|
"github.com/akutz/memconn"
|
|
|
|
)
|
|
|
|
|
|
|
|
const memName = "Tailscale-IPN"
|
|
|
|
|
2023-01-30 17:34:51 +00:00
|
|
|
func listen(path string) (net.Listener, error) {
|
|
|
|
return memconn.Listen("memu", memName)
|
2021-11-07 20:11:50 +00:00
|
|
|
}
|
|
|
|
|
2024-06-11 02:38:10 +00:00
|
|
|
func connect(ctx context.Context, _ string) (net.Conn, error) {
|
|
|
|
return memconn.DialContext(ctx, "memu", memName)
|
2021-11-07 20:11:50 +00:00
|
|
|
}
|