Small demo of using Pusher or Slanger with Play Framework 2.0
Scala
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
conf
project
public
.gitignore
README.md

README.md

Play 2.0 demo application using WebSockets via Pusher/Slanger...

It uses stuff from :

Getting it to work on OSX Lion

Before I forget, to get Slanger working on my MacBook Pro with OSX Lion and be able to work locally :

  • XCode latest version + command line tools
  • Homebrew to easily get wget :p

Installing Redis

Install Redis witch is necessary for Slanger (see http://redis.io/download ) :

wget http://redis.googlecode.com/files/redis-2.4.14.tar.gz (other version)
tar xzf redis-2.4.14.tar.gz
cd redis-2.4.14
make
make test
    
sudo mv src/redis-server /usr/bin
sudo mv src/redis-cli /usr/bin
mkdir ~/.redis
mv redis.conf ~/.redis

Installing Ruby (if you don't have it already)

Be sure to have ruby installed, with version 1.9.2-p290 or greater ... I didn't so I installedit via rvm, to avoid conflicts with the System version of Ruby :

  1. install rvm
$ curl -L get.rvm.io | bash -s stable
  1. ... and do what they ask to do (source ~/.rvm/scripts/...)

  2. install the latest version of ruby and make it the default version

rvm get head
rvm install 1.9.3
rvm use 1.9.3
rvm --default 1.9.3

Installing Slanger

As simple as :

gem install slanger

Launchin all the bazar

When all this is done, you can :

  • launch redis with default params:
redis-server
  • launch slanger passing the key and appId in params (+ more options if needed)
slanger --app_key mykeymouse --secret theSecret
  • go to the folder for the Play app
play run

Troubleshooting

I found those links useful when setting up my laptop: