diff options
-rw-r--r-- | WebSockets.hs | 8 | ||||
-rw-r--r-- | debug-me.cabal | 2 | ||||
-rw-r--r-- | stack.yaml | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/WebSockets.hs b/WebSockets.hs index 395a707..6231298 100644 --- a/WebSockets.hs +++ b/WebSockets.hs @@ -31,7 +31,7 @@ import Data.Monoid runClientApp :: ClientApp () -> IO () runClientApp app = catchJust catchconnclosed - (runClient "localhost" 8081 "/" app) + (runClientWith "localhost" 8081 "/" connoptions [] app) (\_ -> return ()) where -- For some reason, runClient throws ConnectionClosed @@ -39,6 +39,11 @@ runClientApp app = catchJust catchconnclosed catchconnclosed ConnectionClosed = Just () catchconnclosed _ = Nothing + connoptions = defaultConnectionOptions + { connectionCompressionOptions = + PermessageDeflateCompression defaultPermessageDeflate + } + -- | Make a client that sends and receives LogMessages over a websocket. clientApp :: Mode @@ -138,6 +143,7 @@ instance WebSocketsData WireProtocol where WireProtocolError (Data.Aeson.decode s) _ -> WireProtocolError "received unknown websocket message" + fromDataMessage = fromLazyByteString . fromDataMessage protocolError :: Connection -> String -> IO a protocolError conn err = do diff --git a/debug-me.cabal b/debug-me.cabal index cbec817..8db9d4d 100644 --- a/debug-me.cabal +++ b/debug-me.cabal @@ -48,7 +48,7 @@ Executable debug-me , warp (>= 3.2) , wai (>= 3.2) , http-types (>= 0.9) - , websockets (>= 0.10) + , websockets (>= 0.11.1) , wai-websockets (>= 3.0) , uuid (>= 1.3) Other-Modules: @@ -3,4 +3,5 @@ packages: resolver: lts-8.12 extra-deps: - posix-pty-0.2.1 +- websockets-0.11.1.0 explicit-setup-deps: |