diff --git a/example/Main-Client.hs b/example/Main-Client.hs
--- a/example/Main-Client.hs
+++ b/example/Main-Client.hs
@@ -6,8 +6,9 @@
 
 module Main where
 
+import Network.Wai.Trans (runClientAppT)
 import Network.WebSockets (runServer, runClient, ServerApp, ClientApp)
-import Network.WebSockets.Simple (toClientAppT', hoistWebSocketsApp)
+import Network.WebSockets.Simple (toClientAppT', hoistWebSocketsApp, expBackoffStrategy)
 import Network.WebSockets.RPC
 import Network.WebSockets.RPC.ACKable (ackableRPCClient)
 import Network.WebSockets.RPC.Trans.Client (newEnv, Env, runWebSocketClientRPCT')
@@ -77,11 +78,12 @@
       runWS :: WebSocketClientRPCT MyRepDSL MyComDSL IO a -> IO a
       runWS = runWebSocketClientRPCT' env
 
-  client <- runWebSocketClientRPCT' env (rpcClientSimple myClient)
+  client <- runWebSocketClientRPCT' env (rpcClientSimple (\_ -> putStrLn "connection closed"
+                                                         ) myClient)
 
   -- client <- ackableRPCClient id ("client" :: String) myClient
   let myClient' :: ClientApp ()
       myClient' = runClientAppT runM $ toClientAppT' $ runWebSocketClientRPCTSimple runWS client
 
   threadDelay 1000000
-  runClientAppTBackingOff id "127.0.0.1" 8080 "" myClient'
+  expBackoffStrategy $ runClient "127.0.0.1" 8080 "" $ runClientAppT id myClient'
diff --git a/example/Main.hs b/example/Main.hs
--- a/example/Main.hs
+++ b/example/Main.hs
@@ -69,7 +69,8 @@
 main = do
   let runM = id
 
-  server <- execWebSocketServerRPCTSimple $ rpcServerSimple myServer
+  server <- execWebSocketServerRPCTSimple $ rpcServerSimple ( \_ -> putStrLn "connection closed"
+                                                            ) myServer
 
   -- server <- ackableRPCServer runM ("server" :: String) myServer
   let myServer' :: ServerApp
diff --git a/src/Network/WebSockets/RPC.hs b/src/Network/WebSockets/RPC.hs
--- a/src/Network/WebSockets/RPC.hs
+++ b/src/Network/WebSockets/RPC.hs
@@ -35,10 +35,12 @@
                                     , RPCIdentified (..)
                                     )
 import Network.WebSockets (acceptRequest, receiveDataMessage, sendDataMessage, DataMessage (Text, Binary), ConnectionException, runClient)
-import Network.WebSockets.Simple (WebSocketsApp (..), hoistWebSocketsApp)
+import Network.WebSockets.Simple (WebSocketsApp (..), hoistWebSocketsApp, WebSocketsAppParams (..))
 import Network.Wai.Trans (ServerAppT, ClientAppT, runClientAppT)
 import Data.Aeson (ToJSON, FromJSON, decode, encode)
 import Data.IORef (newIORef, readIORef, writeIORef)
+import Data.Word (Word16)
+import Data.ByteString.Lazy (ByteString)
 
 import Control.Monad (forever, void)
 import Control.Monad.IO.Class (liftIO, MonadIO)
@@ -129,11 +131,12 @@
                  . ( MonadBaseControl IO m
                    , MonadIO m
                    )
-                => RPCServer sub sup rep com m
+                => (Maybe (Word16, ByteString) -> m ()) -- ^ see 'Network.WebSockets.Simple.onClose'
+                -> RPCServer sub sup rep com m
                 -> WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) (WebSocketServerRPCT sub sup m)
-rpcServerSimple f = WebSocketsApp
+rpcServerSimple onClose f = WebSocketsApp
   { onOpen = \send -> pure ()
-  , onReceive = \send eSubSup -> do
+  , onReceive = \WebSocketsAppParams{send} eSubSup -> do
       env <- getServerEnv
 
       let runSub :: Subscribe sub -> WebSocketServerRPCT sub sup m ()
@@ -165,6 +168,7 @@
       case eSubSup of
         Left sub -> runSub sub
         Right sup -> runSup sup
+  , onClose = lift . onClose
   }
 
 
@@ -256,12 +260,13 @@
 rpcClientSimple :: forall sub sup rep com m
                  . ( MonadIO m
                    )
-                => RPCClient sub sup rep com m
+                => (Maybe (Word16, ByteString) -> m ()) -- ^ see 'Network.WebSockets.Simple.onClose'
+                -> RPCClient sub sup rep com m
                 -> WebSocketClientRPCT rep com m (WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) (WebSocketClientRPCT rep com m))
-rpcClientSimple RPCClient{subscription,onSubscribe,onReply,onComplete} = do
+rpcClientSimple onClose RPCClient{subscription,onSubscribe,onReply,onComplete} = do
   _ident <- freshRPCID
   pure WebSocketsApp
-    { onOpen = \send -> do
+    { onOpen = \WebSocketsAppParams{send} -> do
         send $ Left $ Subscribe RPCIdentified{_ident, _params = subscription}
 
         env <- getClientEnv
@@ -276,7 +281,7 @@
 
         registerReplyComplete _ident (onReply RPCClientParams{supply,cancel}) onComplete
 
-    , onReceive = \send eRepCom -> do
+    , onReceive = \WebSocketsAppParams{send} eRepCom -> do
         let runRep :: Reply rep -> WebSocketClientRPCT rep com m ()
             runRep (Reply RPCIdentified{_ident = _ident',_params})
               | _ident' == _ident = runReply _ident _params
@@ -292,6 +297,7 @@
         case eRepCom of
           Left rep -> runRep rep
           Right com -> runCom com
+    , onClose = lift . onClose
     }
 
 
@@ -331,7 +337,7 @@
                               => (forall a. WebSocketClientRPCT rep com m a -> m a)
                               -> WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) (WebSocketClientRPCT rep com m)
                               -> WebSocketsApp (Either (Subscribe sub) (Supply sup)) (Either (Reply rep) (Complete com)) m
-runWebSocketClientRPCTSimple runWS x = hoistWebSocketsApp runWS lift x
+runWebSocketClientRPCTSimple runWS = hoistWebSocketsApp runWS lift
 
 
 execWebSocketClientRPCTSimple  :: ( MonadBaseControl IO m
@@ -351,7 +357,7 @@
                              => (forall a. WebSocketServerRPCT sub sup m a -> m a)
                              -> WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) (WebSocketServerRPCT sub sup m)
                              -> WebSocketsApp (Either (Reply rep) (Complete com)) (Either (Subscribe sub) (Supply sup)) m
-runWebSocketServerRPCTSimple runWS x = hoistWebSocketsApp runWS lift x
+runWebSocketServerRPCTSimple runWS = hoistWebSocketsApp runWS lift
 
 
 execWebSocketServerRPCTSimple  :: ( MonadBaseControl IO m
diff --git a/websockets-rpc.cabal b/websockets-rpc.cabal
--- a/websockets-rpc.cabal
+++ b/websockets-rpc.cabal
@@ -1,5 +1,5 @@
 Name:                   websockets-rpc
-Version:                0.5.1
+Version:                0.6.0
 Author:                 Athan Clark <athan.clark@gmail.com>
 Maintainer:             Athan Clark <athan.clark@gmail.com>
 License:                BSD3
@@ -44,7 +44,7 @@
                       , uuid
                       , wai-transformers
                       , websockets >= 0.11
-                      , websockets-simple >= 0.0.2.2
+                      , websockets-simple >= 0.0.5
 
 Test-suite test
   Type:                 exitcode-stdio-1.0
