I'm trying to figure out exactly how to use web sockets and am having a little difficulty. I have one page where I dump a load of JSON data. I want to then create another page that establishes a web socket with the first page and pulls data from there. But, I can't quite seem to figure out how to communicate with another url via web sockets.
Any and all help would be greatly appreciated.
In my Controller class I have the page that gets the json defined by:
def sqlTest = Action {
val json = Json.toJson(getData)
Ok(json)
}
Then, I have my web socket defined as
def socket = WebSocket.accept[JsValue, JsValue] { request =>
ActorFlow.actorRef(out => MyWebSocketActor.props(out))
}
Thanks in advance.