Adding to Michael Neale's solution.
As stated there, Play doesn't support WSS natively, as of late October, 2013.
So simply switching to SSL wouldn't work.
Thankfully, when configuring an app to use SSL, Cloudbees sets up an Nginx server as a router, with the SSL endpoint being the router, so the workaround described there will work.
So, once you create a custom domain name and corresponding Cloudbees app alias, set up your SSL certificates in a Cloudbees router, and configure your app to be use that Cloudbees router, you'll be able to connect to the websockets.
But you'll have to force the URLs to be secure, since using the regular Play route resolvers won't work. They return ws://..., not wss://... websockets URLs.
Specifically, using the out-of-the-box Play Framework sample Scala Websocket Chat app as an example:
conf/routes defines:
GET /room/chat controllers.Application.chat(username)
Application defines:
def chat(username: String) = WebSocket.async[JsValue] { request => ChatRoom.join(username) }
and chatRoom.scala.js creates the web socket:
var WS = window['MozWebSocket'] ? MozWebSocket : WebSocket
var chatSocket = new WS("@routes.Application.chat(username).webSocketURL()")
That won't work, since @routes....webSocketURL() will return a ws://, not a wss:// url.
chatRoom.scala.js can be modified as follows to make it work regardless of whether it's running within an https:// or http:// page:
var WS = window['MozWebSocket'] ? MozWebSocket : WebSocket;
var wsUrl = "@controllers.api.routes.PubSubController.chat(username).webSocketURL()";
if(window.location.protocol == "https:") wsUrl = wsUrl.replace("ws:","wss:");
var chatSocket = new WS(wsUrl);
Hope this helps.