@hackage socketio0.1.2

Socket.IO server

Socket.IO for Haskell folks.

Socket.IO
http://socket.io/
Protocol
https://github.com/LearnBoost/socket.io-spec
{-# 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