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