mirror of
https://github.com/fosrl/olm.git
synced 2026-02-08 05:56:41 +00:00
Merge branch 'apple' into dns
This commit is contained in:
14
olm/olm.go
14
olm/olm.go
@@ -33,6 +33,10 @@ type GlobalConfig struct {
|
||||
SocketPath string
|
||||
Version string
|
||||
|
||||
// Callbacks
|
||||
OnRegistered func()
|
||||
OnConnected func()
|
||||
|
||||
// Source tracking (not in JSON)
|
||||
sources map[string]string
|
||||
}
|
||||
@@ -574,6 +578,11 @@ func StartTunnel(config TunnelConfig) {
|
||||
|
||||
connected = true
|
||||
|
||||
// Invoke onConnected callback if configured
|
||||
if globalConfig.OnConnected != nil {
|
||||
go globalConfig.OnConnected()
|
||||
}
|
||||
|
||||
logger.Info("WireGuard device created.")
|
||||
})
|
||||
|
||||
@@ -1026,6 +1035,11 @@ func StartTunnel(config TunnelConfig) {
|
||||
"orgId": config.OrgID,
|
||||
// "doNotCreateNewClient": config.DoNotCreateNewClient,
|
||||
}, 1*time.Second)
|
||||
|
||||
// Invoke onRegistered callback if configured
|
||||
if globalConfig.OnRegistered != nil {
|
||||
go globalConfig.OnRegistered()
|
||||
}
|
||||
}
|
||||
|
||||
go keepSendingPing(olm)
|
||||
|
||||
Reference in New Issue
Block a user