net/wsconn: remove homegrown wrapper for turning a websocket.Conn into a net.Conn

The one from the nhooyr/websocket package seems to work equally well.

Signed-off-by: Mihai Parparita <mihai@tailscale.com>
This commit is contained in:
Mihai Parparita
2022-06-06 16:13:15 -07:00
committed by Mihai Parparita
parent cfb5bd0559
commit edc90ebc61
7 changed files with 7 additions and 115 deletions

View File

@@ -13,7 +13,6 @@ import (
"nhooyr.io/websocket"
"tailscale.com/control/controlbase"
"tailscale.com/net/dnscache"
"tailscale.com/net/wsconn"
"tailscale.com/types/key"
)
@@ -45,7 +44,7 @@ func Dial(ctx context.Context, addr string, machineKey key.MachinePrivate, contr
if err != nil {
return nil, err
}
netConn := wsconn.New(wsConn)
netConn := websocket.NetConn(context.Background(), wsConn, websocket.MessageBinary)
cbConn, err := cont(ctx, netConn)
if err != nil {
netConn.Close()