Description
Socket.IO server.
Description
Socket.IO for Haskell folks.
- Socket.IO
- Protocol
{-# LANGUAGE OverloadedStrings #-}
import Web.SocketIO
-- listens to port 4000
main = server 4000 $ do
-- ping pong
on "ping" $ emit "pong" []
-- msg :: CallbackM [Text]
on "echo" $ msg >>= emit "pong"
-- do some IO
on "Kim Jong-Un" $ liftIO launchMissile