public static class Handshake.Server$
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Handshake.Server$ |
MODULE$
Static reference to the singleton instance of this Scala object.
|
Constructor and Description |
---|
Server$() |
Modifier and Type | Method and Description |
---|---|
HttpResponse |
buildResponse(Sec$minusWebSocket$minusKey key,
scala.util.Either<akka.stream.Graph<akka.stream.FlowShape<FrameEvent,FrameEvent>,java.lang.Object>,akka.stream.Graph<akka.stream.FlowShape<Message,Message>,java.lang.Object>> handler,
scala.Option<java.lang.String> subprotocol) |
akka.util.OptionVal<UpgradeToWebSocket> |
websocketUpgrade(scala.collection.immutable.List<HttpHeader> headers,
boolean hostHeaderPresent)
Validates a client WebSocket handshake.
|
public static final Handshake.Server$ MODULE$
public akka.util.OptionVal<UpgradeToWebSocket> websocketUpgrade(scala.collection.immutable.List<HttpHeader> headers, boolean hostHeaderPresent)
Right(UpgradeToWebSocket)
or
Left(MessageStartError)
.
From: http://tools.ietf.org/html/rfc6455#section-4.2.1
1. An HTTP/1.1 or higher GET request, including a "Request-URI" [RFC2616] that should be interpreted as a /resource name/ defined in Section 3 (or an absolute HTTP/HTTPS URI containing the /resource name/).
2. A |Host| header field containing the server's authority.
3. An |Upgrade| header field containing the value "websocket", treated as an ASCII case-insensitive value.
4. A |Connection| header field that includes the token "Upgrade", treated as an ASCII case-insensitive value.
5. A |Sec-WebSocket-Key| header field with a base64-encoded (see Section 4 of [RFC4648]) value that, when decoded, is 16 bytes in length.
6. A |Sec-WebSocket-Version| header field, with a value of 13.
7. Optionally, an |Origin| header field. This header field is sent by all browser clients. A connection attempt lacking this header field SHOULD NOT be interpreted as coming from a browser client.
8. Optionally, a |Sec-WebSocket-Protocol| header field, with a list of values indicating which protocols the client would like to speak, ordered by preference.
9. Optionally, a |Sec-WebSocket-Extensions| header field, with a list of values indicating which extensions the client would like to speak. The interpretation of this header field is discussed in Section 9.1.
headers
- (undocumented)hostHeaderPresent
- (undocumented)public HttpResponse buildResponse(Sec$minusWebSocket$minusKey key, scala.util.Either<akka.stream.Graph<akka.stream.FlowShape<FrameEvent,FrameEvent>,java.lang.Object>,akka.stream.Graph<akka.stream.FlowShape<Message,Message>,java.lang.Object>> handler, scala.Option<java.lang.String> subprotocol)