Skip to content

Commit 5882daf

Browse files
authored
Force relay connection, do not waste signaling resources on ICE connection (#4628)
1 parent 11d71e6 commit 5882daf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

client/internal/peer/conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ func (conn *Conn) isConnectedOnAllWay() (connected bool) {
666666
}
667667
}()
668668

669-
if conn.statusICE.Get() == worker.StatusDisconnected && !conn.workerICE.InProgress() {
669+
if runtime.GOOS != "js" && conn.statusICE.Get() == worker.StatusDisconnected && !conn.workerICE.InProgress() {
670670
return false
671671
}
672672

client/internal/peer/env.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package peer
22

33
import (
44
"os"
5+
"runtime"
56
"strings"
67
)
78

@@ -10,5 +11,8 @@ const (
1011
)
1112

1213
func isForceRelayed() bool {
14+
if runtime.GOOS == "js" {
15+
return true
16+
}
1317
return strings.EqualFold(os.Getenv(EnvKeyNBForceRelay), "true")
1418
}

0 commit comments

Comments
 (0)