mirror of
https://github.com/fosrl/newt.git
synced 2026-02-08 05:56:40 +00:00
Make sure to call stop function inside of clients
This commit is contained in:
4
main.go
4
main.go
@@ -1199,6 +1199,10 @@ persistent_keepalive_interval=5`, fixKey(privateKey.String()), fixKey(wgData.Pub
|
||||
logger.Info("Websocket connected")
|
||||
|
||||
if !connected {
|
||||
// make sure the stop function is called
|
||||
if stopFunc != nil {
|
||||
stopFunc()
|
||||
}
|
||||
// request from the server the list of nodes to ping at newt/ping/request
|
||||
stopFunc = client.SendMessageInterval("newt/ping/request", map[string]interface{}{}, 3*time.Second)
|
||||
logger.Info("Requesting exit nodes from server")
|
||||
|
||||
Reference in New Issue
Block a user