Skip to content

Commit

Permalink
Merge pull request #5 from ocharles/master
Browse files Browse the repository at this point in the history
Add a Haskell implementation
  • Loading branch information
ericmoritz committed Jun 13, 2012
2 parents 23fb15e + a6c1e47 commit 2aa229f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions competition/Makefile
@@ -1,5 +1,9 @@
build: build:
javac -cp webbit-0.4.7-full.jar EchoWsServer.java javac -cp webbit-0.4.7-full.jar EchoWsServer.java
ghc --make -O2 -threaded wsdemo-snap.hs


clean: clean:
rm *.class rm *.class
rm *snap.hi
rm *snap.o
rm wsdemo-snap
10 changes: 10 additions & 0 deletions competition/wsdemo-snap.hs
@@ -0,0 +1,10 @@
import Control.Monad
import Snap.Http.Server
import Network.WebSockets
import Network.WebSockets.Snap

echo :: Request -> WebSockets Hybi00 ()
echo req = acceptRequest req >> forever (receive >>= send)

main :: IO ()
main = quickHttpServe $ runWebSocketsSnap echo
5 changes: 4 additions & 1 deletion configure_ubuntu.sh
@@ -1,4 +1,4 @@
sudo apt-get install -y emacs python-dev python-setuptools build-essential erlang-nox libevent-dev git golang mercurial default-jdk ruby rubygems sudo apt-get install -y emacs python-dev python-setuptools build-essential erlang-nox libevent-dev git golang mercurial default-jdk ruby rubygems haskell-platform
sudo easy_install ws4py gevent sudo easy_install ws4py gevent


git clone git://github.com/ericmoritz/wsdemo.git wsdemo git clone git://github.com/ericmoritz/wsdemo.git wsdemo
Expand All @@ -17,3 +17,6 @@ popd
npm install websocket npm install websocket
sudo go get code.google.com/p/go.net/websocket sudo go get code.google.com/p/go.net/websocket
sudo gem install em-websocket sudo gem install em-websocket

sudo cabal update
sudo cabal install snap-server snap-core websockets websockets-snap

0 comments on commit 2aa229f

Please sign in to comment.