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)