From 595ee70386d63c760ecab07c876a11b4cb17fd9d Mon Sep 17 00:00:00 2001 From: Christopher Reichert Date: Sun, 14 Dec 2014 14:05:15 -0600 Subject: [PATCH] Keep client connections alive using Network.WebSocket.forkPingThread. --- yesod-websockets/Yesod/WebSockets.hs | 1 + yesod-websockets/yesod-websockets.cabal | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/yesod-websockets/Yesod/WebSockets.hs b/yesod-websockets/Yesod/WebSockets.hs index 3df66e81..38f3215b 100644 --- a/yesod-websockets/Yesod/WebSockets.hs +++ b/yesod-websockets/Yesod/WebSockets.hs @@ -53,6 +53,7 @@ webSockets inner = do (WaiWS.getRequestHead req) (\pconn -> do conn <- WS.acceptRequest pconn + WS.forkPingThread conn 30 runInIO $ runReaderT inner conn) src sink diff --git a/yesod-websockets/yesod-websockets.cabal b/yesod-websockets/yesod-websockets.cabal index 4112b6a2..b801bbb4 100644 --- a/yesod-websockets/yesod-websockets.cabal +++ b/yesod-websockets/yesod-websockets.cabal @@ -1,6 +1,3 @@ --- Initial yesod-websockets.cabal generated by cabal init. For further --- documentation, see http://haskell.org/cabal/users-guide/ - name: yesod-websockets version: 0.2.0 synopsis: WebSockets support for Yesod @@ -22,7 +19,7 @@ library , wai , wai-websockets >= 2.1 - , websockets >= 0.8 + , websockets >= 0.9.2 , transformers >= 0.2 , yesod-core >= 1.4 , monad-control >= 0.3