Create a SockJS router that will pass messages to/from the actor created by the given props.
Create a SockJS router 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:
lazy val sockjs = SockJSRouter.acceptWithActor[JsValue, JsValue] { req => out => MySockJSActor.props(out) }
Create a SockJS router that will adapt the incoming stream and send it back out.
Creates a SockJS router with the given server
Creates a SockJS router with default server and a function to modify the default settings
Creates a SockJS router with default server and given settings
Creates a SockJS router that will either reject the connection with the given result, or will be handled by the given inbound and outbound channels, asynchronously
Create a SockJS router that will pass messages to/from the actor created by the given props asynchronously.
Create a SockJS router 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:
lazy val sockjs = SockJSRouter.acceptWithActor[JsValue, JsValue] { req => val isAuthenticated: Future[Boolean] = authenticate(req) val isAuthenticated.map { case false => Left(Forbidden) case true => Right(MySockJSActor.props) } }
Create a SockJS router that accepts a SockJS connection using the given inbound/outbound channels.
Create a SockJS router that accepts a connection using the given inbound/outbound channels asynchronously.
Create a SockJS router that accepts a connection using the given inbound/outbound channels asynchronously.
(Since version 0.3) Use SockJSRouter.tryAccept instead