socketio

Socket.IO server

Latest on Hackage:0.1.3

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

MIT licensed by Ting-Yen Lai
Maintained by banacorn@gmail.com

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
comments powered byDisqus