send websocket close message to agent

This commit is contained in:
henrygd
2025-07-12 18:49:40 -04:00
parent 4f879ccc66
commit b5d55ead4a
3 changed files with 6 additions and 7 deletions

View File

@@ -100,8 +100,7 @@ func (acr *agentConnectRequest) verifyWsConn(conn *gws.Conn, fpRecords []ws.Fing
// make sure connection is closed if there is an error
defer func() {
if err != nil {
wsConn.Close()
acr.hub.Logger().Error("WebSocket error", "error", err, "systems", fpRecords)
wsConn.Close([]byte(err.Error()))
}
}()