From 3cf68ac0db0e5f839d3f1dd8f345e44584ed13f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 25 Jul 2026 09:28:44 +0200 Subject: Move common WebSocket setup to the module --- src/Attach.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/Attach.hs') diff --git a/src/Attach.hs b/src/Attach.hs index c15b0a5..cf6bd1c 100644 --- a/src/Attach.hs +++ b/src/Attach.hs @@ -30,7 +30,7 @@ import Text.Blaze.Html5 qualified as H import Text.Blaze.Html5.Attributes qualified as A import JavaScript -import WebSocket (startClient, receiveMessage) +import WebSocket (startDefaultWebSocketConnections) data AttachState = AttachState @@ -120,11 +120,7 @@ initiateAttachConnection baseHead dgst = do Nothing -> return () locationAssign "./" - startClient asServer "a.discovery.erebosprotocol.net" 443 "" $ \conn -> do - void $ forkIO $ forever $ do - msg <- receiveMessage conn - receivedFromCustomAddress asServer conn msg - void $ serverPeerCustom asServer conn + startDefaultWebSocketConnections asServer runExceptT (discoverySearch asServer dgst) >>= \case Right _ -> return () -- cgit v1.2.3