From a8e0844758df7fb84a9243d0bfe5f9f9f754c5cc Mon Sep 17 00:00:00 2001 From: Owen Date: Sun, 18 Jan 2026 11:55:09 -0800 Subject: [PATCH] Send disconnecting message when stopping Former-commit-id: 1fb6e2a00d70ea73554dffc7b3e4caa19daa3b8b --- olm/olm.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/olm/olm.go b/olm/olm.go index 691d716..7476561 100644 --- a/olm/olm.go +++ b/olm/olm.go @@ -321,7 +321,7 @@ func (o *Olm) StartTunnel(config TunnelConfig) { userToken, config.OrgID, config.Endpoint, - 30 * time.Second, // 30 seconds + 30*time.Second, // 30 seconds config.PingTimeoutDuration, websocket.WithPingDataProvider(func() map[string]any { o.metaMu.Lock() @@ -479,6 +479,9 @@ func (o *Olm) StartTunnel(config TunnelConfig) { } func (o *Olm) Close() { + // send a disconnect message to the cloud to show disconnected + o.websocket.SendMessage("olm/disconnecting", map[string]any{}) + // Restore original DNS configuration // we do this first to avoid any DNS issues if something else gets stuck if err := dnsOverride.RestoreDNSOverride(); err != nil {