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<org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<FrameEvent,FrameEvent>,java.lang.Object>,org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<Message,Message>,java.lang.Object>> handler,
scala.Option<java.lang.String> subprotocol,
WebSocketSettings settings,
org.apache.pekko.event.LoggingAdapter log) |
org.apache.pekko.util.OptionVal<UpgradeToWebSocketLowLevel> |
websocketUpgrade(scala.collection.immutable.List<HttpHeader> headers,
boolean hostHeaderPresent,
WebSocketSettings settings,
org.apache.pekko.event.LoggingAdapter log)
Validates a client WebSocket handshake.
|
public static final Handshake.Server$ MODULE$
public org.apache.pekko.util.OptionVal<UpgradeToWebSocketLowLevel> websocketUpgrade(scala.collection.immutable.List<HttpHeader> headers, boolean hostHeaderPresent, WebSocketSettings settings, org.apache.pekko.event.LoggingAdapter log)
OptionVal.Some(UpgradeToWebSocketLowLevel)
or
OptionVal.None
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.
10. Optionally, other header fields, such as those used to send cookies or request authentication to a server. Unknown header fields are ignored, as per [RFC2616].
headers
- (undocumented)hostHeaderPresent
- (undocumented)settings
- (undocumented)log
- (undocumented)public HttpResponse buildResponse(Sec$minusWebSocket$minusKey key, scala.util.Either<org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<FrameEvent,FrameEvent>,java.lang.Object>,org.apache.pekko.stream.Graph<org.apache.pekko.stream.FlowShape<Message,Message>,java.lang.Object>> handler, scala.Option<java.lang.String> subprotocol, WebSocketSettings settings, org.apache.pekko.event.LoggingAdapter log)