safesocket: fail early on js/wasm

Updates #3157

Change-Id: Ib78efb3b1ba34ca4fb34296033b95327188774a7
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2021-10-27 14:53:28 -07:00
parent 3b5ada1fd8
commit 2ce5fc7b0a

View File

@ -8,6 +8,7 @@
package safesocket
import (
"errors"
"fmt"
"io"
"io/ioutil"
@ -23,6 +24,9 @@
// TODO(apenwarr): handle magic cookie auth
func connect(path string, port uint16) (net.Conn, error) {
if runtime.GOOS == "js" {
return nil, errors.New("safesocket.Connect not yet implemented on js/wasm")
}
if runtime.GOOS == "darwin" && path == "" && port == 0 {
return connectMacOSAppSandbox()
}