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
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commit802eac8

Browse files
authored
feat: Add TURNLocalProxyURL to avoid roundtripping outside coderd (#405)
1 parent175c42e commit802eac8

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

‎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/dial.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ type DialOptions struct {
3636
// TURNProxyAuthToken is used to authenticate a TURN proxy request.
3737
TURNProxyAuthTokenstring
3838

39-
// TURNProxyURL is the URL to proxy all TURN data through.
40-
// This URL is sent to the listener during handshake so both
41-
// ends connect to the same TURN endpoint.
42-
TURNProxyURL*url.URL
39+
// TURNRemoteProxyURL is the URL to proxy listener TURN data through.
40+
TURNRemoteProxyURL*url.URL
41+
42+
// TURNLocalProxyURL is the URL to proxy client TURN data through.
43+
TURNLocalProxyURL*url.URL
4344
}
4445

4546
// DialWebsocket dials the broker with a WebSocket and negotiates a connection.
@@ -91,9 +92,9 @@ func Dial(ctx context.Context, conn net.Conn, options *DialOptions) (*Dialer, er
9192
}
9293

9394
varturnProxy proxy.Dialer
94-
ifoptions.TURNProxyURL!=nil {
95+
ifoptions.TURNLocalProxyURL!=nil {
9596
turnProxy=&turnProxyDialer{
96-
baseURL:options.TURNProxyURL,
97+
baseURL:options.TURNLocalProxyURL,
9798
token:options.TURNProxyAuthToken,
9899
}
99100
}
@@ -141,8 +142,8 @@ func Dial(ctx context.Context, conn net.Conn, options *DialOptions) (*Dialer, er
141142
}
142143

143144
varturnProxyURLstring
144-
ifoptions.TURNProxyURL!=nil {
145-
turnProxyURL=options.TURNProxyURL.String()
145+
ifoptions.TURNRemoteProxyURL!=nil {
146+
turnProxyURL=options.TURNRemoteProxyURL.String()
146147
}
147148

148149
bmsg:=BrokerMessage{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp