Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 6f1e4ab

Browse files
committed
fix outdated references
1 parent f8b26db commit 6f1e4ab

File tree

6 files changed

+23
-11
lines changed

6 files changed

+23
-11
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ require (
2828
github.com/rjeczalik/notify v0.9.2
2929
github.com/spf13/cobra v1.2.1
3030
github.com/stretchr/testify v1.7.0
31+
go.uber.org/goleak v1.1.12 // indirect
3132
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
3233
golang.org/x/net v0.0.0-20210913180222-943fd674d43e
3334
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
422422
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
423423
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
424424
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
425+
go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA=
426+
go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
425427
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
426428
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
427429
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
@@ -667,6 +669,7 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f
667669
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
668670
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
669671
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
672+
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
670673
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
671674
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
672675
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

internal/cmd/tunnel.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ func (c *tunnneler) start(ctx context.Context) error {
117117
&wsnet.DialOptions{
118118
Log: &dialLog,
119119
TURNProxyAuthToken: c.token,
120-
TURNProxyURL: c.brokerAddr,
120+
TURNRemoteProxyURL: c.brokerAddr,
121+
TURNLocalProxyURL: c.brokerAddr,
121122
ICEServers: []webrtc.ICEServer{wsnet.TURNProxyICECandidate()},
122123
},
123124
nil,

wsnet/conn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/pion/webrtc/v3"
1515
"nhooyr.io/websocket"
1616

17-
"coder.com/m/product/coder/pkg/codersdk/legacy"
17+
"cdr.dev/coder-cli/coder-sdk"
1818
)
1919

2020
const (
@@ -89,7 +89,7 @@ func (t *turnProxyDialer) Dial(_, _ string) (c net.Conn, err error) {
8989
if err != nil {
9090
if resp != nil {
9191
defer resp.Body.Close()
92-
return nil, legacy.NewHTTPError(resp)
92+
return nil, coder.NewHTTPError(resp)
9393
}
9494
return nil, fmt.Errorf("dial: %w", err)
9595
}

wsnet/dial.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ import (
1515
"github.com/pion/webrtc/v3"
1616
"golang.org/x/net/proxy"
1717
"golang.org/x/xerrors"
18-
"k8s.io/utils/pointer"
1918
"nhooyr.io/websocket"
2019

20+
"cdr.dev/coder-cli/coder-sdk"
2121
"cdr.dev/slog"
22-
"coder.com/m/product/coder/pkg/codersdk/legacy"
2322
)
2423

2524
// DialOptions are configurable options for a wsnet connection.
@@ -61,7 +60,7 @@ func DialWebsocket(ctx context.Context, broker string, netOpts *DialOptions, wsO
6160
defer func() {
6261
_ = resp.Body.Close()
6362
}()
64-
return nil, legacy.NewHTTPError(resp)
63+
return nil, coder.NewHTTPError(resp)
6564
}
6665
return nil, fmt.Errorf("dial websocket: %w", err)
6766
}
@@ -129,8 +128,8 @@ func Dial(ctx context.Context, conn net.Conn, options *DialOptions) (*Dialer, er
129128

130129
log.Debug(ctx, "creating control channel", slog.F("proto", controlChannel))
131130
ctrl, err := rtc.CreateDataChannel(controlChannel, &webrtc.DataChannelInit{
132-
Protocol: pointer.String(controlChannel),
133-
Ordered: pointer.Bool(true),
131+
Protocol: strptr(controlChannel),
132+
Ordered: boolptr(true),
134133
})
135134
if err != nil {
136135
return nil, fmt.Errorf("create control channel: %w", err)
@@ -386,7 +385,7 @@ func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.
386385

387386
d.log.Debug(ctx, "opening data channel")
388387
dc, err := d.rtc.CreateDataChannel("proxy", &webrtc.DataChannelInit{
389-
Ordered: pointer.Bool(network != "udp"),
388+
Ordered: boolptr(network != "udp"),
390389
Protocol: &proto,
391390
})
392391
if err != nil {
@@ -463,3 +462,11 @@ func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.
463462
d.log.Debug(ctx, "dial channel ready")
464463
return c, nil
465464
}
465+
466+
func boolptr(b bool) *bool {
467+
return &b
468+
}
469+
470+
func strptr(s string) *string {
471+
return &s
472+
}

wsnet/listen.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
"golang.org/x/xerrors"
1919
"nhooyr.io/websocket"
2020

21+
"cdr.dev/coder-cli/coder-sdk"
2122
"cdr.dev/slog"
22-
"coder.com/m/product/coder/pkg/codersdk/legacy"
2323
)
2424

2525
// Codes for DialChannelResponse.
@@ -133,7 +133,7 @@ func (l *listener) dial(ctx context.Context) (<-chan error, error) {
133133
conn, resp, err := websocket.Dial(ctx, l.broker, nil)
134134
if err != nil {
135135
if resp != nil {
136-
return nil, legacy.NewHTTPError(resp)
136+
return nil, coder.NewHTTPError(resp)
137137
}
138138
return nil, err
139139
}

0 commit comments

Comments
 (0)