From b58e7c9fad2425c0e00ab09fbc3f9fab44883134 Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 21 Jul 2025 17:04:29 -0700 Subject: [PATCH] Holepunch to the right endpoint --- common.go | 1 + main.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common.go b/common.go index 57826fc..bdc3420 100644 --- a/common.go +++ b/common.go @@ -53,6 +53,7 @@ type HolePunchMessage struct { type HolePunchData struct { ServerPubKey string `json:"serverPubKey"` + Endpoint string `json:"endpoint"` } type EncryptedHolePunchMessage struct { diff --git a/main.go b/main.go index f0ace5a..6eeb8de 100644 --- a/main.go +++ b/main.go @@ -234,6 +234,8 @@ func main() { } gerbilServerPubKey = holePunchData.ServerPubKey + + go keepSendingUDPHolePunch(holePunchData.Endpoint, id, sourcePort) }) connectTimes := 0 @@ -620,8 +622,6 @@ func main() { } defer olm.Close() - go keepSendingUDPHolePunch(endpoint, id, sourcePort) - // Wait for interrupt signal sigCh := make(chan os.Signal, 1) signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)