Stop sending requests when you get a terminate

Former-commit-id: 151d0e38e6
This commit is contained in:
Owen
2025-08-03 14:47:36 -07:00
parent b5dacf8d43
commit e9cab2705c
+5
View File
@@ -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