stdinClient :: WS.ClientApp ()
stdinClient conn = do
    putStrLn "echoClient Connected!"
    -- Fork a thread that writes WS data to stdout
    _ <- forkIO $ forever $ do
        msg <- WS.receiveData conn
        liftIO $ Text.putStrLn msg
        -- Read from stdin and write to WS
    let loop' = do
            line <- Text.getLine
            unless (Text.null line) $ WS.sendTextData conn line >> loop'
    loop'
    WS.sendClose conn ("Bye!" :: Text)
stdinClient :: WS.ClientApp ()
stdinClient conn = do
    putStrLn "echoClient Connected!"
    -- Fork a thread that writes WS data to stdout
    _ <- forkIO $ forever $ do
        msg <- WS.receiveData conn
        liftIO $ Text.putStrLn msg
        -- Read from stdin and write to WS
    let loop' = do
            line <- Text.getLine
            unless (Text.null line) $ WS.sendTextData conn line >> loop'
    loop'
    WS.sendClose conn ("Bye!" :: Text)
stdinClient conn = do
    putStrLn "echoClient Connected!"
    -- Fork a thread that writes WS data to stdout
    _ <- forkIO $ forever $ do
        msg <- WS.receiveData conn
        liftIO $ Text.putStrLn msg
        -- Read from stdin and write to WS
    let loop' = do
            line <- Text.getLine
            unless (Text.null line) $ WS.sendTextData conn line >> loop'
    loop'
    WS.sendClose conn ("Bye!" :: Text)