Skip to content

Instantly share code, notes, and snippets.

@ikennaokpala
Forked from casualjim/gist:910404
Created April 11, 2011 12:52
Show Gist options
  • Save ikennaokpala/913458 to your computer and use it in GitHub Desktop.
Save ikennaokpala/913458 to your computer and use it in GitHub Desktop.
package com.mojolly.backchat
package web
class MySocketIOClient extends Client {
def receive = {
case Connected => {
}
case Message(msg) => {
//handlePlainTextMessage
}
case JsonMessage(msg) => //handleJsonMessage(msg)
case Disconnected(_, _) => {
// do stuff on disconnect
}
case m => log.warn("Unknown message format found: %s", m)
}
}
class SocketIOApp extends ScalatraServlet with SocketIOSupport with Logging {
get("/?") {
"Hello, I don't do anything but serve websockets. Visit https://backchat.io for more information."
}
connect {
new MySocketIOClient
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment