What do we want? - Future[Either[AuthFailure, AuthSuccess]] - Future[Option[AuthSuccess]] - Future[AuthSuccess]
What do we want? - Future[Either[AuthFailure, AuthSuccess]] - Future[Option[AuthSuccess]] - Future[AuthSuccess]
IMO: The first one, then the others as convenience based on the first. (_.toOption, _.toOption.get)
req
a successful authentication result, or fails with a NoSuchElementException if authentication fails
Implement this like routes.YourController.openSocket()
.
Implement this like routes.YourController.openSocket()
.
Called when a client has been created.
Called when a client has been created. Note however that messages cannot yet be sent to the client.
the client channel, can be used to push messages to the client
Called when a client has disconnected.
Called when a client has disconnected.
the disconnected client channel
Called when the client sends a message to the server.
Called when the client sends a message to the server.
the message
the client that sent the message
true if the message was handled, false otherwise
Opens a WebSocket connection.
Opens a WebSocket connection.
This is the controller for requests to ws://... or wss://... URIs.
a websocket connection using messages of type Message
Instead of returning an Unauthorized result upon authentication failures, this opens then immediately closes a connection connections, sends no messages and ignores any messages.
Instead of returning an Unauthorized result upon authentication failures, this opens then immediately closes a connection connections, sends no messages and ignores any messages.
The Java-WebSocket client library hangs if an Unauthorized result is returned after a websocket connection attempt.