runServerWith' :: String -> Int -> WS.ConnectionOptions -> WS.ServerApp -> IO ()
runServerWith' host port opts app = S.withSocketsDo $ do
    sock <- WS.makeListenSocket host port
    _ <- forever $ do
        (conn, _) <- S.accept sock
        a <- async $ Control.Exception.finally
             (runApp' conn opts app)
             (S.sClose conn)
        link a
        return ()
    S.sClose sock
runServerWith' :: String -> Int -> WS.ConnectionOptions -> WS.ServerApp -> IO ()
runServerWith' host port opts app = S.withSocketsDo $ do
    sock <- WS.makeListenSocket host port
    _ <- forever $ do
        (conn, _) <- S.accept sock
        a <- async $ Control.Exception.finally
             (runApp' conn opts app)
             (S.sClose conn)
        link a
        return ()
    S.sClose sock
runServerWith' host port opts app = S.withSocketsDo $ do
    sock <- WS.makeListenSocket host port
    _ <- forever $ do
        (conn, _) <- S.accept sock
        a <- async $ Control.Exception.finally
             (runApp' conn opts app)
             (S.sClose conn)
        link a
        return ()
    S.sClose sock