mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-08 23:49:56 +00:00
control/controlhttp: allow client and server to communicate over WebSockets
We can't do Noise-over-HTTP in Wasm/JS (because we don't have bidirectional communication), but we should be able to do it over WebSockets. Reuses derp WebSocket support that allows us to turn a WebSocket connection into a net.Conn. Updates #3157 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
This commit is contained in:

committed by
Mihai Parparita

parent
80157f3f37
commit
a9f32656f5
@@ -1097,12 +1097,6 @@ func loadServerPubKeys(ctx context.Context, httpc *http.Client, serverURL string
|
||||
var out tailcfg.OverTLSPublicKeyResponse
|
||||
jsonErr := json.Unmarshal(b, &out)
|
||||
if jsonErr == nil {
|
||||
if runtime.GOOS == "js" {
|
||||
// As of 2022-05-20 it's not possible for js/wasm to make a bidi
|
||||
// Noise connection to the control plane. Instead, for now, pretend
|
||||
// like the server can't do Noise to force use of the old protocol.
|
||||
out.PublicKey = key.MachinePublic{}
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user