From d438e42a8047c3ea37ec2f0eaa8010fb22fc21d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Thu, 17 Jul 2025 21:39:22 +0200 Subject: Destroy ICE and close WS sessions on connection termination --- main/WebSocket.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'main/WebSocket.hs') diff --git a/main/WebSocket.hs b/main/WebSocket.hs index 5c49aa1..7a957e2 100644 --- a/main/WebSocket.hs +++ b/main/WebSocket.hs @@ -27,8 +27,10 @@ instance Show WebSocketAddress where show (WebSocketAddress _ _) = "websocket" instance PeerAddressType WebSocketAddress where - sendBytesToAddress (WebSocketAddress _ conn) msg = do - WS.sendDataMessage conn $ WS.Binary $ BL.fromStrict msg + sendBytesToAddress (WebSocketAddress _ conn) msg = do + WS.sendDataMessage conn $ WS.Binary $ BL.fromStrict msg + connectionToAddressClosed (WebSocketAddress _ conn) = do + WS.sendClose conn BL.empty startWebsocketServer :: Server -> String -> Int -> (String -> IO ()) -> IO () startWebsocketServer server addr port logd = do -- cgit v1.2.3