A function that, given an actor to send upstream messages to, returns actor props to create an actor to handle the SockJS connection
Transforms SockJS message flows into flows of another type.
Transforms SockJS message flows into flows of another type.
The transformation may be more than just converting from one message to another, it may also produce messages, such as close messages with an appropriate error code if the message can't be consumed.
(Since version 0.5.0) Use MessageFormatter instead
Defaults message transformers.
Defaults (old) message formatters.
Accepts a SockJS using the given flow.
Creates an action that will either accept the SockJS connection, using the given flow to handle the in and out stream, or return a result to reject the request.
Create a SockJS handler that will pass messages to/from the actor created by the given props.
Create a SockJS handler that will pass messages to/from the actor created by the given props.
Given a request and an actor ref to send messages to, the function passed should return the props for an actor to create to handle this SockJS connection.
For example:
def sockjs = SockJS.acceptWithActor[JsValue, JsValue] { req => out => MySockJSActor.props(out) }
(Since version 0.5.0) Use accept with a flow that wraps a Sink.actorRef and Source.actorRef, or play.api.libs.ActorFlow.actorRef
Creates a SockJS handler that will adapt the incoming stream and send it back out.
Creates a SockJS handler that will adapt the incoming stream and send it back out.
(Since version 0.5.0) Use accept with an Akka streams flow instead
Creates a SockJS handler that will either reject the connection with the given result, or will be handled by the given inbound and outbound channels, asynchronously
Creates a SockJS handler that will either reject the connection with the given result, or will be handled by the given inbound and outbound channels, asynchronously
(Since version 0.5.0) Use acceptOrResult with an Akka streams flow instead
Create a SockJS handler that will pass messages to/from the actor created by the given props asynchronously.
Create a SockJS handler that will pass messages to/from the actor created by the given props asynchronously.
Given a request, this method should return a future of either:
- A result to reject the WebSocket with, or - A function that will take the sending actor, and create the props that describe the actor to handle this SockJS connection
For example:
def subscribe = SockJS.acceptWithActor[JsValue, JsValue] { req => val isAuthenticated: Future[Boolean] = authenticate(req) val isAuthenticated.map { case false => Left(Forbidden) case true => Right(MySockJSActor.props) } }
(Since version 0.5.0) Use accept with a flow that wraps a Sink.actorRef and Source.actorRef, or play.api.libs.ActorFlow.actorRef
Accepts a SockJS connection using the given inbound/outbound channels.
Accepts a SockJS connection using the given inbound/outbound channels.
(Since version 0.5.0) Use accept with an Akka streams flow instead