aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node')
-rw-r--r--packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py b/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py
index e333ae8..94dfd8e 100644
--- a/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py
+++ b/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py
@@ -4681,8 +4681,21 @@ class WebRTCTransport:
# srflx lines — the symptom the multi-server fan-out exists to prevent.
answer_sdp = pc.localDescription.sdp
srflx = answer_sdp.count(" typ srflx")
- log.info("WebRTC answer ready for peer=%s (ICE gather %.2fs, %d srflx)",
- peer_id, time.monotonic() - gather_start, srflx)
+ # The host addresses this node put in the answer. When a peer reports
+ # "DataChannel closed" the first question is whether the node offered
+ # anything that peer could route to at all — on a NAT'd host or a VM the
+ # only host candidate is an address no one else can reach, and the log
+ # otherwise looks identical to a working connection.
+ host_addrs: set[str] = set()
+ for line in answer_sdp.splitlines():
+ if line.startswith("a=candidate:") and " typ host " in line:
+ parts = line.split()
+ if len(parts) > 5:
+ host_addrs.add(parts[4])
+ log.info(
+ "WebRTC answer ready for peer=%s (ICE gather %.2fs, host: %s, %d srflx)",
+ peer_id, time.monotonic() - gather_start,
+ ", ".join(sorted(host_addrs)) or "none", srflx)
return answer_sdp, []
async def close_peer(self, peer_id: str) -> None: