Documentation
¶
Overview ¶
Package safesocket creates either a Unix socket, if possible, or otherwise a localhost TCP connection.
Index ¶
- Variables
- func ConnCloseRead(c net.Conn) error
- func ConnCloseWrite(c net.Conn) error
- func Connect(path string, port uint16) (net.Conn, error)
- func ConnectDefault() (net.Conn, error)
- func Listen(path string, port uint16) (_ net.Listener, gotPort uint16, _ error)
- func LocalTCPPortAndToken() (port int, token string, err error)
- func PlatformUsesPeerCreds() bool
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ConnCloseRead ¶
ConnCloseRead calls c's CloseRead method. c is expected to be either a UnixConn or TCPConn as returned from this package.
func ConnCloseWrite ¶
ConnCloseWrite calls c's CloseWrite method. c is expected to be either a UnixConn or TCPConn as returned from this package.
func Connect ¶
Connect connects to either path (on Unix) or the provided localhost port (on Windows).
func ConnectDefault ¶ added in v1.6.0
ConnectDefault connects to the local Tailscale daemon.
func Listen ¶
Listen returns a listener either on Unix socket path (on Unix), or the localhost port (on Windows). If port is 0, the returned gotPort says which port was selected on Windows.
func LocalTCPPortAndToken ¶ added in v1.6.0
LocalTCPPortAndToken returns the port number and auth token to connect to the local Tailscale daemon. It's currently only applicable on macOS when tailscaled is being run in the Mac Sandbox from the App Store version of Tailscale.
func PlatformUsesPeerCreds ¶ added in v1.6.0
func PlatformUsesPeerCreds() bool
PlatformUsesPeerCreds reports whether the current platform uses peer credentials to authenticate connections.
Types ¶
This section is empty.