From 0482f001ec30badc83018469bef8f2a98019f320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Tue, 16 Jul 2024 23:55:08 +0900 Subject: [PATCH] fix(nat): transport on tcp --- gold/link/nat.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gold/link/nat.go b/gold/link/nat.go index a144722..d85627a 100644 --- a/gold/link/nat.go +++ b/gold/link/nat.go @@ -92,10 +92,17 @@ func (l *Link) onQuery(packet []byte) { notify := make(head.Notify, len(peers)) for _, p := range peers { lnk, ok := l.me.IsInPeer(p) + eps := "" + if l.me.ep.Network() == "udp" { // udp has real p2p + eps = lnk.endpoint.String() + } + if eps == "" { + eps = l.rawep // use registered ep only + } if ok { notify[p] = [2]string{ lnk.endpoint.Network(), - lnk.endpoint.String(), + eps, } } }