mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-05 09:04:09 -04:00
[client] Fix WASM peer connection to lazy peers (#5097)
WASM peers now properly initiate relay connections instead of waiting for offers that lazy peers won't send.
This commit is contained in:
@@ -669,10 +669,17 @@ func (conn *Conn) isConnectedOnAllWay() (connected bool) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if runtime.GOOS != "js" && conn.statusICE.Get() == worker.StatusDisconnected && !conn.workerICE.InProgress() {
|
// For JS platform: only relay connection is supported
|
||||||
|
if runtime.GOOS == "js" {
|
||||||
|
return conn.statusRelay.Get() == worker.StatusConnected
|
||||||
|
}
|
||||||
|
|
||||||
|
// For non-JS platforms: check ICE connection status
|
||||||
|
if conn.statusICE.Get() == worker.StatusDisconnected && !conn.workerICE.InProgress() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If relay is supported with peer, it must also be connected
|
||||||
if conn.workerRelay.IsRelayConnectionSupportedWithPeer() {
|
if conn.workerRelay.IsRelayConnectionSupportedWithPeer() {
|
||||||
if conn.statusRelay.Get() == worker.StatusDisconnected {
|
if conn.statusRelay.Get() == worker.StatusDisconnected {
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user