Merge pull request #889 from creichert/master
Keep client WebSocket connections alive using Network.WebSockets.forkPingThread
This commit is contained in:
commit
af7b2dd230
@ -97,7 +97,7 @@ scaffold isBare = do
|
|||||||
Right backend -> runResourceT $ yield (backendBS backend) $$ sink
|
Right backend -> runResourceT $ yield (backendBS backend) $$ sink
|
||||||
|
|
||||||
let projectnameReplacer = if isBare
|
let projectnameReplacer = if isBare
|
||||||
then LT.replace "cd PROJECTNAME && " ""
|
then LT.replace "cd PROJECTNAME && " ""
|
||||||
else LT.replace "PROJECTNAME" (LT.pack project)
|
else LT.replace "PROJECTNAME" (LT.pack project)
|
||||||
|
|
||||||
TLIO.putStr $ projectnameReplacer $ renderTextUrl undefined $(textFile "input/done.cg")
|
TLIO.putStr $ projectnameReplacer $ renderTextUrl undefined $(textFile "input/done.cg")
|
||||||
|
|||||||
@ -53,6 +53,7 @@ webSockets inner = do
|
|||||||
(WaiWS.getRequestHead req)
|
(WaiWS.getRequestHead req)
|
||||||
(\pconn -> do
|
(\pconn -> do
|
||||||
conn <- WS.acceptRequest pconn
|
conn <- WS.acceptRequest pconn
|
||||||
|
WS.forkPingThread conn 30
|
||||||
runInIO $ runReaderT inner conn)
|
runInIO $ runReaderT inner conn)
|
||||||
src
|
src
|
||||||
sink
|
sink
|
||||||
|
|||||||
@ -1,8 +1,5 @@
|
|||||||
-- Initial yesod-websockets.cabal generated by cabal init. For further
|
|
||||||
-- documentation, see http://haskell.org/cabal/users-guide/
|
|
||||||
|
|
||||||
name: yesod-websockets
|
name: yesod-websockets
|
||||||
version: 0.2.0
|
version: 0.2.1
|
||||||
synopsis: WebSockets support for Yesod
|
synopsis: WebSockets support for Yesod
|
||||||
description: WebSockets support for Yesod
|
description: WebSockets support for Yesod
|
||||||
homepage: https://github.com/yesodweb/yesod
|
homepage: https://github.com/yesodweb/yesod
|
||||||
@ -22,7 +19,7 @@ library
|
|||||||
, wai
|
, wai
|
||||||
|
|
||||||
, wai-websockets >= 2.1
|
, wai-websockets >= 2.1
|
||||||
, websockets >= 0.8
|
, websockets >= 0.9
|
||||||
, transformers >= 0.2
|
, transformers >= 0.2
|
||||||
, yesod-core >= 1.4
|
, yesod-core >= 1.4
|
||||||
, monad-control >= 0.3
|
, monad-control >= 0.3
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user