Skip to content

Commit

Permalink
fix(nat): transport on tcp
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Jul 16, 2024
1 parent 1bbec7f commit 0482f00
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gold/link/nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
}
Expand Down

0 comments on commit 0482f00

Please sign in to comment.