safesocket: fail early on js/wasm

Updates #3157

Change-Id: Ib78efb3b1ba34ca4fb34296033b95327188774a7
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/3202/head
Brad Fitzpatrick 3 years ago
parent 3b5ada1fd8
commit 2ce5fc7b0a

@ -8,6 +8,7 @@
package safesocket package safesocket
import ( import (
"errors"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
@ -23,6 +24,9 @@ import (
// TODO(apenwarr): handle magic cookie auth // TODO(apenwarr): handle magic cookie auth
func connect(path string, port uint16) (net.Conn, error) { 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 { if runtime.GOOS == "darwin" && path == "" && port == 0 {
return connectMacOSAppSandbox() return connectMacOSAppSandbox()
} }

Loading…
Cancel
Save