mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: migrate to coder/websocket 1.8.12 (#15898)
Migrates us to `coder/websocket` v1.8.12 rather than `nhooyr/websocket` on an older version. Works around https://github.com/coder/websocket/issues/504 by adding an explicit test for `xerrors.Is(err, io.EOF)` where we were previously getting `io.EOF` from the netConn.
This commit is contained in:
+3
-3
@@ -8,9 +8,9 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"nhooyr.io/websocket"
|
||||
"tailscale.com/derp"
|
||||
"tailscale.com/net/wsconn"
|
||||
|
||||
"github.com/coder/websocket"
|
||||
)
|
||||
|
||||
// WithWebsocketSupport returns an http.Handler that upgrades
|
||||
@@ -60,7 +60,7 @@ func WithWebsocketSupport(s *derp.Server, base http.Handler) (http.Handler, func
|
||||
c.Close(websocket.StatusPolicyViolation, "client must speak the derp subprotocol")
|
||||
return
|
||||
}
|
||||
wc := wsconn.NetConn(ctx, c, websocket.MessageBinary)
|
||||
wc := websocket.NetConn(ctx, c, websocket.MessageBinary)
|
||||
brw := bufio.NewReadWriter(bufio.NewReader(wc), bufio.NewWriter(wc))
|
||||
s.Accept(ctx, wc, brw, r.RemoteAddr)
|
||||
}), func() {
|
||||
|
||||
@@ -26,7 +26,6 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/xerrors"
|
||||
"nhooyr.io/websocket"
|
||||
"tailscale.com/derp"
|
||||
"tailscale.com/derp/derphttp"
|
||||
"tailscale.com/tailcfg"
|
||||
@@ -40,6 +39,7 @@ import (
|
||||
"github.com/coder/coder/v2/tailnet"
|
||||
tailnetproto "github.com/coder/coder/v2/tailnet/proto"
|
||||
"github.com/coder/coder/v2/testutil"
|
||||
"github.com/coder/websocket"
|
||||
)
|
||||
|
||||
type ClientNumber int
|
||||
|
||||
Reference in New Issue
Block a user