How to use TLS in Play!Framework WebSockets (“wss://”)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I cannot use wss:// in my simple WebSocket app created with Play!Framework 2.2. It echoes the message back. The endpoint is like this def indexWS2 = WebSocket.using[String] { request => { println("got connection to indexWS2") var channel: Option[Concurrent.Channel[String]] = None val outEnumerator: Enumerator[String] = Concurrent.unicast(c => channel = Some(c)) // Log events to the console val myIteratee: Iteratee[String, Unit] = Iteratee.foreach[String] {gotString => { println("received: " + gotString) // send string back channel.foreach(_