What is the Play 2.5.x equivalent to acceptWithActor[String, JsValue]? : <p>Before I migrated to Play 2.5.x I used <code>WebSocket.acceptWithActor</code> frequently. Now I can't get my web sockets to stay open when using different input and output, in my case, input is String, output is JsValue.</p>

<p>My receiver before Play 2.5.x:</p>

<pre><code>object Application extends Controller {
    def myWebSocket = WebSocket.acceptWithActor[String, JsValue] { request =&gt;
        out =&gt; MyActor.props(out)
}
</code></pre>

<p>My receiver in Play 2.5.x:</p>

<pre><code>@Singleton
class Application @Inject() (implicit system: ActorSystem, materializer: Materializer) extends Controller {
  implicit val messageFlowTransformer = 
                  MessageFlowTransformer.jsonMessageFlowTransformer[String, JsValue]
  def myWebSocket = WebSocket.accept[String, JsValue] { request =&gt;
    ActorFlow.actorRef(out =&gt; MyActor.props(out))
  }
}
</code></pre>

<p>In my actor <code>preStart</code> is called immediately followed by <code>postStop</code>, so this is obviously incorrect, but I can't seem to find any solution in the documentation (<a href="https://www.playframework.com/documentation/2.5.x/ScalaWebSockets" rel="noreferrer">https://www.playframework.com/documentation/2.5.x/ScalaWebSockets</a>). 
If I use <code>WebSocket.accept[String, String]</code> the socket stays open.</p>

<p>What am I doing wrong?</p>
