From 151d0e38e6b6f63335d9a1023bb8d2da2d3bccb0 Mon Sep 17 00:00:00 2001 From: Owen Date: Sun, 3 Aug 2025 14:47:36 -0700 Subject: [PATCH] Stop sending requests when you get a terminate --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index dbb141f..483aa23 100644 --- a/main.go +++ b/main.go @@ -479,6 +479,11 @@ persistent_keepalive_interval=5`, fixKey(privateKey.String()), fixKey(wgData.Pub // Close the WireGuard device and TUN closeWgTunnel() + if stopFunc != nil { + stopFunc() // stop the ws from sending more requests + stopFunc = nil // reset stopFunc to nil to avoid double stopping + } + // Mark as disconnected connected = false