Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit75de15b

Browse files
committed
migrate to coder/websocket 1.8.12
1 parentbadebc7 commit75de15b

34 files changed

+98
-160
lines changed

‎coderd/healthcheck/websocket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import (
1010
"time"
1111

1212
"golang.org/x/xerrors"
13-
"nhooyr.io/websocket"
1413

1514
"github.com/coder/coder/v2/coderd/healthcheck/health"
1615
"github.com/coder/coder/v2/codersdk/healthsdk"
16+
"github.com/coder/websocket"
1717
)
1818

1919
typeWebsocketReport healthsdk.WebsocketReport

‎coderd/httpapi/httpapi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ const websocketCloseMaxLen = 123
268268
funcWebsocketCloseSprintf(formatstring,vars...any)string {
269269
msg:=fmt.Sprintf(format,vars...)
270270

271-
// Cap msg length at 123 bytes.nhooyr/websocket only allows close messages
271+
// Cap msg length at 123 bytes.coder/websocket only allows close messages
272272
// of this length.
273273
iflen(msg)>websocketCloseMaxLen {
274274
// Trim the string to 123 bytes. If we accidentally cut in the middle of

‎coderd/httpapi/websocket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"time"
77

88
"golang.org/x/xerrors"
9-
"nhooyr.io/websocket"
109

1110
"cdr.dev/slog"
11+
"github.com/coder/websocket"
1212
)
1313

1414
// Heartbeat loops to ping a WebSocket to keep it alive.

‎coderd/provisionerjobs.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@ import (
1212

1313
"github.com/google/uuid"
1414
"golang.org/x/xerrors"
15-
"nhooyr.io/websocket"
1615

1716
"cdr.dev/slog"
18-
"github.com/coder/coder/v2/codersdk/wsjson"
19-
2017
"github.com/coder/coder/v2/coderd/database"
2118
"github.com/coder/coder/v2/coderd/database/db2sdk"
2219
"github.com/coder/coder/v2/coderd/database/dbauthz"
2320
"github.com/coder/coder/v2/coderd/database/pubsub"
2421
"github.com/coder/coder/v2/coderd/httpapi"
2522
"github.com/coder/coder/v2/codersdk"
23+
"github.com/coder/coder/v2/codersdk/wsjson"
2624
"github.com/coder/coder/v2/provisionersdk"
25+
"github.com/coder/websocket"
2726
)
2827

2928
// Returns provisioner logs based on query parameters.

‎coderd/provisionerjobs_internal_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"github.com/stretchr/testify/assert"
1515
"github.com/stretchr/testify/require"
1616
"go.uber.org/mock/gomock"
17-
"nhooyr.io/websocket"
1817

1918
"github.com/coder/coder/v2/coderd/database"
2019
"github.com/coder/coder/v2/coderd/database/dbmock"
@@ -23,6 +22,7 @@ import (
2322
"github.com/coder/coder/v2/codersdk"
2423
"github.com/coder/coder/v2/provisionersdk"
2524
"github.com/coder/coder/v2/testutil"
25+
"github.com/coder/websocket"
2626
)
2727

2828
funcTestConvertProvisionerJob_Unit(t*testing.T) {

‎coderd/workspaceagents.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"golang.org/x/exp/slices"
2121
"golang.org/x/sync/errgroup"
2222
"golang.org/x/xerrors"
23-
"nhooyr.io/websocket"
2423
"tailscale.com/tailcfg"
2524

2625
"cdr.dev/slog"
@@ -42,6 +41,7 @@ import (
4241
"github.com/coder/coder/v2/codersdk/wsjson"
4342
"github.com/coder/coder/v2/tailnet"
4443
"github.com/coder/coder/v2/tailnet/proto"
44+
"github.com/coder/websocket"
4545
)
4646

4747
// @Summary Get workspace agent by ID
@@ -378,7 +378,7 @@ func (api *API) workspaceAgentLogs(rw http.ResponseWriter, r *http.Request) {
378378

379379
// Allow client to request no compression. This is useful for buggy
380380
// clients or if there's a client/server incompatibility. This is
381-
// needed with e.g.nhooyr/websocket and Safari (confirmed in 16.5).
381+
// needed with e.g.coder/websocket and Safari (confirmed in 16.5).
382382
//
383383
// See:
384384
// * https://github.com/nhooyr/websocket/issues/218

‎coderd/workspaceagents_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/stretchr/testify/require"
2121
"golang.org/x/xerrors"
2222
"google.golang.org/protobuf/types/known/timestamppb"
23-
"nhooyr.io/websocket"
2423
"tailscale.com/tailcfg"
2524

2625
"cdr.dev/slog"
@@ -50,6 +49,7 @@ import (
5049
"github.com/coder/coder/v2/tailnet/tailnettest"
5150
"github.com/coder/coder/v2/testutil"
5251
"github.com/coder/quartz"
52+
"github.com/coder/websocket"
5353
)
5454

5555
funcTestWorkspaceAgent(t*testing.T) {
@@ -2058,7 +2058,7 @@ type workspace struct {
20582058

20592059
funcwaitForUpdates(
20602060
t*testing.T,
2061-
//nolint:revive // t takes precedence
2061+
//nolint:revive // t takes precedence
20622062
ctx context.Context,
20632063
stream tailnetproto.DRPCTailnet_WorkspaceUpdatesClient,
20642064
currentStatemap[uuid.UUID]workspace,

‎coderd/workspaceagentsrpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"github.com/google/uuid"
1515
"github.com/hashicorp/yamux"
1616
"golang.org/x/xerrors"
17-
"nhooyr.io/websocket"
1817

1918
"cdr.dev/slog"
2019
"github.com/coder/coder/v2/agent/proto"
@@ -30,6 +29,7 @@ import (
3029
"github.com/coder/coder/v2/codersdk"
3130
"github.com/coder/coder/v2/tailnet"
3231
tailnetproto"github.com/coder/coder/v2/tailnet/proto"
32+
"github.com/coder/websocket"
3333
)
3434

3535
// @Summary Workspace agent RPC API

‎coderd/workspaceagentsrpc_internal_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@ import (
88
"testing"
99
"time"
1010

11-
"github.com/coder/coder/v2/coderd/util/ptr"
12-
"github.com/coder/coder/v2/coderd/wspubsub"
13-
1411
"github.com/google/uuid"
1512
"github.com/stretchr/testify/require"
1613
"go.uber.org/mock/gomock"
17-
"nhooyr.io/websocket"
1814

1915
"github.com/coder/coder/v2/coderd/database"
2016
"github.com/coder/coder/v2/coderd/database/dbmock"
2117
"github.com/coder/coder/v2/coderd/database/dbtime"
18+
"github.com/coder/coder/v2/coderd/util/ptr"
19+
"github.com/coder/coder/v2/coderd/wspubsub"
2220
"github.com/coder/coder/v2/testutil"
21+
"github.com/coder/websocket"
2322
)
2423

2524
funcTestAgentConnectionMonitor_ContextCancel(t*testing.T) {

‎coderd/workspaceapps/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/go-jose/go-jose/v4/jwt"
1818
"github.com/google/uuid"
1919
"go.opentelemetry.io/otel/trace"
20-
"nhooyr.io/websocket"
2120

2221
"cdr.dev/slog"
2322
"github.com/coder/coder/v2/agent/agentssh"
@@ -32,6 +31,7 @@ import (
3231
"github.com/coder/coder/v2/codersdk"
3332
"github.com/coder/coder/v2/codersdk/workspacesdk"
3433
"github.com/coder/coder/v2/site"
34+
"github.com/coder/websocket"
3535
)
3636

3737
const (

‎codersdk/agentsdk/agentsdk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/google/uuid"
1616
"github.com/hashicorp/yamux"
1717
"golang.org/x/xerrors"
18-
"nhooyr.io/websocket"
1918
"storj.io/drpc"
2019
"tailscale.com/tailcfg"
2120

@@ -25,6 +24,7 @@ import (
2524
"github.com/coder/coder/v2/codersdk"
2625
drpcsdk"github.com/coder/coder/v2/codersdk/drpc"
2726
tailnetproto"github.com/coder/coder/v2/tailnet/proto"
27+
"github.com/coder/websocket"
2828
)
2929

3030
// ExternalLogSourceID is the statically-defined ID of a log-source that

‎codersdk/provisionerdaemons.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ import (
1515
"golang.org/x/exp/maps"
1616
"golang.org/x/exp/slices"
1717
"golang.org/x/xerrors"
18-
"nhooyr.io/websocket"
1918

2019
"github.com/coder/coder/v2/buildinfo"
2120
"github.com/coder/coder/v2/codersdk/drpc"
2221
"github.com/coder/coder/v2/codersdk/wsjson"
2322
"github.com/coder/coder/v2/provisionerd/proto"
2423
"github.com/coder/coder/v2/provisionerd/runner"
24+
"github.com/coder/websocket"
2525
)
2626

2727
typeLogSourcestring

‎codersdk/websocket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"net"
66

7-
"nhooyr.io/websocket"
7+
"github.com/coder/websocket"
88
)
99

1010
// wsNetConn wraps net.Conn created by websocket.NetConn(). Cancel func

‎codersdk/websocket_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import (
88

99
"github.com/stretchr/testify/assert"
1010
"github.com/stretchr/testify/require"
11-
"nhooyr.io/websocket"
1211

1312
"github.com/coder/coder/v2/codersdk"
1413
"github.com/coder/coder/v2/testutil"
14+
"github.com/coder/websocket"
1515
)
1616

1717
// TestWebsocketNetConn_LargeWrites tests that we can write large amounts of data thru the netconn

‎codersdk/workspaceagents.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import (
1212

1313
"github.com/google/uuid"
1414
"golang.org/x/xerrors"
15-
"nhooyr.io/websocket"
1615

1716
"github.com/coder/coder/v2/coderd/tracing"
1817
"github.com/coder/coder/v2/codersdk/wsjson"
18+
"github.com/coder/websocket"
1919
)
2020

2121
typeWorkspaceAgentStatusstring

‎codersdk/workspacesdk/dialer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import (
99
"slices"
1010

1111
"golang.org/x/xerrors"
12-
"nhooyr.io/websocket"
1312

1413
"cdr.dev/slog"
1514
"github.com/coder/coder/v2/buildinfo"
1615
"github.com/coder/coder/v2/codersdk"
1716
"github.com/coder/coder/v2/tailnet"
1817
"github.com/coder/coder/v2/tailnet/proto"
18+
"github.com/coder/websocket"
1919
)
2020

2121
varpermanentErrorStatuses= []int{

‎codersdk/workspacesdk/dialer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/stretchr/testify/assert"
1414
"github.com/stretchr/testify/require"
1515
"go.uber.org/mock/gomock"
16-
"nhooyr.io/websocket"
1716
"tailscale.com/tailcfg"
1817

1918
"cdr.dev/slog"
@@ -26,6 +25,7 @@ import (
2625
tailnetproto"github.com/coder/coder/v2/tailnet/proto"
2726
"github.com/coder/coder/v2/tailnet/tailnettest"
2827
"github.com/coder/coder/v2/testutil"
28+
"github.com/coder/websocket"
2929
)
3030

3131
funcTestWebsocketDialer_TokenController(t*testing.T) {

‎codersdk/workspacesdk/workspacesdk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414

1515
"github.com/google/uuid"
1616
"golang.org/x/xerrors"
17-
"nhooyr.io/websocket"
1817
"tailscale.com/tailcfg"
1918
"tailscale.com/wgengine/capture"
2019

@@ -23,6 +22,7 @@ import (
2322
"github.com/coder/coder/v2/tailnet"
2423
"github.com/coder/coder/v2/tailnet/proto"
2524
"github.com/coder/quartz"
25+
"github.com/coder/websocket"
2626
)
2727

2828
varErrSkipClose=xerrors.New("skip tailnet close")

‎codersdk/wsjson/decoder.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import (
55
"encoding/json"
66
"sync/atomic"
77

8-
"nhooyr.io/websocket"
9-
108
"cdr.dev/slog"
9+
"github.com/coder/websocket"
1110
)
1211

1312
typeDecoder[Tany]struct {

‎codersdk/wsjson/encoder.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import (
55
"encoding/json"
66

77
"golang.org/x/xerrors"
8-
"nhooyr.io/websocket"
8+
9+
"github.com/coder/websocket"
910
)
1011

1112
typeEncoder[Tany]struct {

‎enterprise/coderd/provisionerdaemons.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ import (
1515
"go.opentelemetry.io/otel/trace"
1616
"golang.org/x/exp/maps"
1717
"golang.org/x/xerrors"
18-
"nhooyr.io/websocket"
1918
"storj.io/drpc/drpcmux"
2019
"storj.io/drpc/drpcserver"
2120

2221
"cdr.dev/slog"
23-
2422
"github.com/coder/coder/v2/coderd/database"
2523
"github.com/coder/coder/v2/coderd/database/db2sdk"
2624
"github.com/coder/coder/v2/coderd/database/dbauthz"
@@ -35,6 +33,7 @@ import (
3533
"github.com/coder/coder/v2/codersdk"
3634
"github.com/coder/coder/v2/provisionerd/proto"
3735
"github.com/coder/coder/v2/provisionersdk"
36+
"github.com/coder/websocket"
3837
)
3938

4039
func (api*API)provisionerDaemonsEnabledMW(next http.Handler) http.Handler {

‎enterprise/coderd/workspaceproxycoordinate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import (
44
"net/http"
55

66
"github.com/google/uuid"
7-
"nhooyr.io/websocket"
87

98
"github.com/coder/coder/v2/apiversion"
109
"github.com/coder/coder/v2/coderd/httpapi"
1110
"github.com/coder/coder/v2/codersdk"
1211
"github.com/coder/coder/v2/tailnet/proto"
12+
"github.com/coder/websocket"
1313
)
1414

1515
// @Summary Workspace Proxy Coordinate

‎enterprise/wsproxy/wsproxysdk/wsproxysdk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
"github.com/google/uuid"
1212
"golang.org/x/xerrors"
13-
"nhooyr.io/websocket"
1413
"tailscale.com/tailcfg"
1514

1615
"cdr.dev/slog"
@@ -19,6 +18,7 @@ import (
1918
"github.com/coder/coder/v2/codersdk"
2019
"github.com/coder/coder/v2/codersdk/workspacesdk"
2120
agpl"github.com/coder/coder/v2/tailnet"
21+
"github.com/coder/websocket"
2222
)
2323

2424
// Client is a HTTP client for a subset of Coder API routes that external

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp