From b53298e339b47c6f0b53ab9fd0cfa3fb7741fc28 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 4 Sep 2026 14:51:08 +0200 Subject: feat(node): log the host candidates the WebRTC answer offers "DataChannel closed" from a peer and a clean node log look identical: the answer-ready line reported only the srflx count, not the host addresses. On a NAT'd host or a VM the sole host candidate is an address no other machine can route to, and that is exactly the case you cannot see. The line now reads `... host: 192.168.200.173, 1 srflx`, so "did the node offer anything routable" is answerable from the journal. Co-Authored-By: Claude Sonnet 5 --- .../src/meshbay_node/transport/webrtc_server.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'packages/meshbay-node') 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: -- cgit v1.2.3