Holepunch to the right endpoint

This commit is contained in:
Owen
2025-07-21 17:04:29 -07:00
parent 85a8a737e8
commit b58e7c9fad
2 changed files with 3 additions and 2 deletions

View File

@@ -53,6 +53,7 @@ type HolePunchMessage struct {
type HolePunchData struct { type HolePunchData struct {
ServerPubKey string `json:"serverPubKey"` ServerPubKey string `json:"serverPubKey"`
Endpoint string `json:"endpoint"`
} }
type EncryptedHolePunchMessage struct { type EncryptedHolePunchMessage struct {

View File

@@ -234,6 +234,8 @@ func main() {
} }
gerbilServerPubKey = holePunchData.ServerPubKey gerbilServerPubKey = holePunchData.ServerPubKey
go keepSendingUDPHolePunch(holePunchData.Endpoint, id, sourcePort)
}) })
connectTimes := 0 connectTimes := 0
@@ -620,8 +622,6 @@ func main() {
} }
defer olm.Close() defer olm.Close()
go keepSendingUDPHolePunch(endpoint, id, sourcePort)
// Wait for interrupt signal // Wait for interrupt signal
sigCh := make(chan os.Signal, 1) sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM) signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)